diff --git a/.circleci/config.yml b/.circleci/config.yml index eab337204..c8cafc06c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,13 +8,22 @@ jobs: - checkout - run: make test - run: make build - - run: ./make-rpm + - run: ./make-release - run: name: Create artifacts command: | - mkdir -p /tmp/RPM - cp -r *.rpm /tmp/RPM + mkdir -p /tmp/release + cp -r eru*.rpm /tmp/release + cp -r eru*.deb /tmp/release + cp -r eru-core /tmp/release/eru-core_linux_x86_64 + cp -r core.yaml.sample /tmp/release + cp -r eru-core.service /tmp/release + - run: + name: Check files + command: | + rpm -qlp eru*.rpm + dpkg -c eru*.deb - store_artifacts: - path: /tmp/RPM - destination: RPM + path: /tmp/release + destination: Release diff --git a/make-release b/make-release new file mode 100755 index 000000000..f15c2f8b1 --- /dev/null +++ b/make-release @@ -0,0 +1,48 @@ +#!/bin/sh + +ROOT="`pwd`/build" +mkdir -p $ROOT + +after_install_script="$ROOT/after_install.sh" +RPMROOT="$ROOT/rpmbuild" +DEBROOT="$ROOT/debbuild" + +cat > $after_install_script << EOF +systemctl daemon-reload +EOF + +VERSION=$(cat VERSION) + +BIN="$RPMROOT/usr/bin" +CONF="$RPMROOT/etc/eru" +SERVICE="$RPMROOT/usr/lib/systemd/system" + +mkdir -p $BIN +mkdir -p $CONF +mkdir -p $SERVICE + +cp eru-core $BIN +cp core.yaml.sample $CONF +cp eru-core.service $SERVICE + +echo $VERSION rpm build begin + +fpm -f -s dir -t rpm -n eru-core --epoch 0 -v $VERSION --iteration 1.el7 -C $RPMROOT -p $PWD --verbose --rpm-auto-add-directories --category 'Development/App' --description 'docker eru core' --after-install $after_install_script --url 'https://github.com/projecteru2/core' --license 'MIT' --no-rpm-sign usr etc + +BIN="$DEBROOT/usr/bin" +CONF="$DEBROOT/etc/eru" +SERVICE="$DEBROOT/lib/systemd/system" + +mkdir -p $BIN +mkdir -p $CONF +mkdir -p $SERVICE + +cp eru-core $BIN +cp core.yaml.sample $CONF +cp eru-core.service $SERVICE + +echo $VERSION deb build begin + +fpm -f -s dir -t deb -n eru-core -v $VERSION --iteration 1.noarch -C $DEBROOT -p $PWD --verbose --category 'Development/App' --description 'docker eru core' --url 'https://github.com/projecteru2/core' --license 'MIT' --after-install $after_install_script --deb-no-default-config-files usr etc lib + +rm -rf $ROOT diff --git a/make-rpm b/make-rpm deleted file mode 100755 index 5165a8e30..000000000 --- a/make-rpm +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -ROOT="`pwd`/build" -BIN="$ROOT/usr/bin" -CONF="$ROOT/etc/eru" -SERVICE="$ROOT/usr/lib/systemd/system" - -mkdir -p $BIN -mkdir -p $CONF -mkdir -p $SERVICE - -mv eru-core $BIN -mv core.yaml.sample $CONF -mv eru-core.service $SERVICE - -VERSION=$(cat VERSION) -echo $VERSION rpm build begin - -fpm -f -s dir -t rpm -n eru-core --epoch 0 -v $VERSION --iteration 1.el7 -C $ROOT -p $PWD --verbose --rpm-auto-add-directories --category 'Development/App' --description 'docker eru core' --url 'https://github.com/projecteru2/core' --license 'MIT' --no-rpm-sign usr etc - -rm -rf $ROOT