<commit_before>#!/bin/bash
set -x
BASE=$(dirname $0)
CODE_DIR=$(readlink -e "$BASE/../")

sudo apt-get install rpm # to be able to make rpms

BUILD_ROOT=$CODE_DIR/build

ARCH="$(uname -m)"
VERSION=$(git describe --long --always)

## debian wheezy
BUILD=${BUILD_ROOT}/sysvinit
mkdir -p ${BUILD}/usr/sbin
mkdir -p ${BUILD}/etc/metrictank

cp ${BASE}/config/metrictank-package.ini ${BUILD}/etc/metrictank/metrictank.ini
cp ${BASE}/config/storage-schemas.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/storage-aggregation.conf ${BUILD}/etc/metrictank/
cp ${BUILD_ROOT}/{metrictank,mt-*} ${BUILD}/usr/sbin/

PACKAGE_NAME="${BUILD}/metrictank-${VERSION}_${ARCH}.deb"
fpm -s dir -t deb \
  -v ${VERSION} -n metrictank -a ${ARCH} --description "metrictank, the gorilla-inspired timeseries database backend for graphite" \
  --deb-init ${BASE}/config/sysvinit/init.d/metrictank \
  --deb-default ${BASE}/config/sysvinit/default/metrictank \
  --replaces metric-tank --provides metric-tank \
  --conflicts metric-tank \
  -C ${BUILD} -p ${PACKAGE_NAME} .

## ubuntu 14.04
BUILD=${BUILD_ROOT}/upstart

mkdir -p ${BUILD}/usr/sbin
mkdir -p ${BUILD}/etc/init
mkdir -p ${BUILD}/etc/metrictank

cp ${BASE}/config/metrictank-package.ini ${BUILD}/etc/metrictank/metrictank.ini
cp ${BASE}/config/storage-schemas.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/storage-aggregation.conf ${BUILD}/etc/metrictank/
cp ${BUILD_ROOT}/{metrictank,mt-*} ${BUILD}/usr/sbin/

PACKAGE_NAME="${BUILD}/metrictank-${VERSION}_${ARCH}.deb"
fpm -s dir -t deb \
  -v ${VERSION} -n metrictank -a ${ARCH} --description "metrictank, the gorilla-inspired timeseries database backend for graphite" \
  --deb-upstart ${BASE}/config/upstart/metrictank \
  --replaces metric-tank --provides metric-tank \
  --conflicts metric-tank \
  -C ${BUILD} -p ${PACKAGE_NAME} .

## ubuntu 16.04, Debian 8, CentOS 7
BUILD=${BUILD_ROOT}/systemd

mkdir -p ${BUILD}/usr/sbin
mkdir -p ${BUILD}/lib/systemd/system/
mkdir -p ${BUILD}/etc/metrictank
mkdir -p ${BUILD}/var/run/raintank

cp ${BASE}/config/metrictank-package.ini ${BUILD}/etc/metrictank/metrictank.ini
cp ${BASE}/config/storage-schemas.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/storage-aggregation.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/systemd/metrictank.service $BUILD/lib/systemd/system/
cp ${BUILD_ROOT}/{metrictank,mt-*} ${BUILD}/usr/sbin/

PACKAGE_NAME="${BUILD}/metrictank-${VERSION}_${ARCH}.deb"
fpm -s dir -t deb \
  -v ${VERSION} -n metrictank -a ${ARCH} --description "metrictank, the gorilla-inspired timeseries database backend for graphite" \
  --config-files /etc/metrictank/ \
  -m "Raintank Inc. <<EMAIL>>" --vendor "raintank.io" \
  --license "Apache2.0" -C ${BUILD} -p ${PACKAGE_NAME} .

BUILD=${BUILD_ROOT}/systemd-centos7

mkdir -p ${BUILD}/usr/sbin
mkdir -p ${BUILD}/lib/systemd/system/
mkdir -p ${BUILD}/etc/metrictank
mkdir -p ${BUILD}/var/run/raintank

cp ${BASE}/config/metrictank-package.ini ${BUILD}/etc/metrictank/metrictank.ini
cp ${BASE}/config/storage-schemas.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/storage-aggregation.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/systemd/metrictank.service $BUILD/lib/systemd/system/
cp ${BUILD_ROOT}/{metrictank,mt-*} ${BUILD}/usr/sbin/

PACKAGE_NAME="${BUILD}/metrictank-${VERSION}.el7.${ARCH}.rpm"
fpm -s dir -t rpm \
  -v ${VERSION} -n metrictank -a ${ARCH} --description "metrictank, the gorilla-inspired timeseries database backend for graphite" \
  --config-files /etc/metrictank/ \
  -m "Raintank Inc. <<EMAIL>>" --vendor "raintank.io" \
  --license "Apache2.0" -C ${BUILD} -p ${PACKAGE_NAME} .

## CentOS 6
BUILD=${BUILD_ROOT}/upstart-0.6.5

mkdir -p ${BUILD}/usr/sbin
mkdir -p ${BUILD}/etc/init
mkdir -p ${BUILD}/etc/metrictank

cp ${BASE}/config/metrictank-package.ini ${BUILD}/etc/metrictank/metrictank.ini
cp ${BASE}/config/storage-schemas.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/storage-aggregation.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/upstart-0.6.5/metrictank.conf $BUILD/etc/init
cp ${BUILD_ROOT}/{metrictank,mt-*} ${BUILD}/usr/sbin/

PACKAGE_NAME="${BUILD}/metrictank-${VERSION}.el6.${ARCH}.rpm"
fpm -s dir -t rpm \
  -v ${VERSION} -n metrictank -a ${ARCH} --description "metrictank, the gorilla-inspired timeseries database backend for graphite" \
  --replaces metric-tank --provides metric-tank \
  --conflicts metric-tank \
  -C ${BUILD} -p ${PACKAGE_NAME} .
<commit_msg>always mark /etc/metrictank as config dir<commit_after>#!/bin/bash
set -x
BASE=$(dirname $0)
CODE_DIR=$(readlink -e "$BASE/../")

sudo apt-get install rpm # to be able to make rpms

BUILD_ROOT=$CODE_DIR/build

ARCH="$(uname -m)"
VERSION=$(git describe --long --always)

## debian wheezy
BUILD=${BUILD_ROOT}/sysvinit
mkdir -p ${BUILD}/usr/sbin
mkdir -p ${BUILD}/etc/metrictank

cp ${BASE}/config/metrictank-package.ini ${BUILD}/etc/metrictank/metrictank.ini
cp ${BASE}/config/storage-schemas.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/storage-aggregation.conf ${BUILD}/etc/metrictank/
cp ${BUILD_ROOT}/{metrictank,mt-*} ${BUILD}/usr/sbin/

PACKAGE_NAME="${BUILD}/metrictank-${VERSION}_${ARCH}.deb"
fpm -s dir -t deb \
  -v ${VERSION} -n metrictank -a ${ARCH} --description "metrictank, the gorilla-inspired timeseries database backend for graphite" \
  --deb-init ${BASE}/config/sysvinit/init.d/metrictank \
  --deb-default ${BASE}/config/sysvinit/default/metrictank \
  --replaces metric-tank --provides metric-tank \
  --conflicts metric-tank \
  --config-files /etc/metrictank/ \
  -C ${BUILD} -p ${PACKAGE_NAME} .

## ubuntu 14.04
BUILD=${BUILD_ROOT}/upstart

mkdir -p ${BUILD}/usr/sbin
mkdir -p ${BUILD}/etc/init
mkdir -p ${BUILD}/etc/metrictank

cp ${BASE}/config/metrictank-package.ini ${BUILD}/etc/metrictank/metrictank.ini
cp ${BASE}/config/storage-schemas.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/storage-aggregation.conf ${BUILD}/etc/metrictank/
cp ${BUILD_ROOT}/{metrictank,mt-*} ${BUILD}/usr/sbin/

PACKAGE_NAME="${BUILD}/metrictank-${VERSION}_${ARCH}.deb"
fpm -s dir -t deb \
  -v ${VERSION} -n metrictank -a ${ARCH} --description "metrictank, the gorilla-inspired timeseries database backend for graphite" \
  --deb-upstart ${BASE}/config/upstart/metrictank \
  --replaces metric-tank --provides metric-tank \
  --conflicts metric-tank \
  --config-files /etc/metrictank/ \
  -C ${BUILD} -p ${PACKAGE_NAME} .

## ubuntu 16.04, Debian 8, CentOS 7
BUILD=${BUILD_ROOT}/systemd

mkdir -p ${BUILD}/usr/sbin
mkdir -p ${BUILD}/lib/systemd/system/
mkdir -p ${BUILD}/etc/metrictank
mkdir -p ${BUILD}/var/run/raintank

cp ${BASE}/config/metrictank-package.ini ${BUILD}/etc/metrictank/metrictank.ini
cp ${BASE}/config/storage-schemas.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/storage-aggregation.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/systemd/metrictank.service $BUILD/lib/systemd/system/
cp ${BUILD_ROOT}/{metrictank,mt-*} ${BUILD}/usr/sbin/

PACKAGE_NAME="${BUILD}/metrictank-${VERSION}_${ARCH}.deb"
fpm -s dir -t deb \
  -v ${VERSION} -n metrictank -a ${ARCH} --description "metrictank, the gorilla-inspired timeseries database backend for graphite" \
  --config-files /etc/metrictank/ \
  -m "Raintank Inc. <<EMAIL>>" --vendor "raintank.io" \
  --license "Apache2.0" -C ${BUILD} -p ${PACKAGE_NAME} .

BUILD=${BUILD_ROOT}/systemd-centos7

mkdir -p ${BUILD}/usr/sbin
mkdir -p ${BUILD}/lib/systemd/system/
mkdir -p ${BUILD}/etc/metrictank
mkdir -p ${BUILD}/var/run/raintank

cp ${BASE}/config/metrictank-package.ini ${BUILD}/etc/metrictank/metrictank.ini
cp ${BASE}/config/storage-schemas.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/storage-aggregation.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/systemd/metrictank.service $BUILD/lib/systemd/system/
cp ${BUILD_ROOT}/{metrictank,mt-*} ${BUILD}/usr/sbin/

PACKAGE_NAME="${BUILD}/metrictank-${VERSION}.el7.${ARCH}.rpm"
fpm -s dir -t rpm \
  -v ${VERSION} -n metrictank -a ${ARCH} --description "metrictank, the gorilla-inspired timeseries database backend for graphite" \
  --config-files /etc/metrictank/ \
  -m "Raintank Inc. <<EMAIL>>" --vendor "raintank.io" \
  --license "Apache2.0" -C ${BUILD} -p ${PACKAGE_NAME} .

## CentOS 6
BUILD=${BUILD_ROOT}/upstart-0.6.5

mkdir -p ${BUILD}/usr/sbin
mkdir -p ${BUILD}/etc/init
mkdir -p ${BUILD}/etc/metrictank

cp ${BASE}/config/metrictank-package.ini ${BUILD}/etc/metrictank/metrictank.ini
cp ${BASE}/config/storage-schemas.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/storage-aggregation.conf ${BUILD}/etc/metrictank/
cp ${BASE}/config/upstart-0.6.5/metrictank.conf $BUILD/etc/init
cp ${BUILD_ROOT}/{metrictank,mt-*} ${BUILD}/usr/sbin/

PACKAGE_NAME="${BUILD}/metrictank-${VERSION}.el6.${ARCH}.rpm"
fpm -s dir -t rpm \
  -v ${VERSION} -n metrictank -a ${ARCH} --description "metrictank, the gorilla-inspired timeseries database backend for graphite" \
  --replaces metric-tank --provides metric-tank \
  --conflicts metric-tank \
  --config-files /etc/metrictank/ \
  -C ${BUILD} -p ${PACKAGE_NAME} .

{'fraction_non_alphanumeric': 0.18973613595706618, 'fraction_numerical': 0.005590339892665474, 'mean_word_length': 4.17650462962963, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1633478', 'n_tokens_mistral': 3387, 'n_tokens_neox': 3224, 'n_words': 667}