From 0798841f837effc6d98733ba8bc2aa1f3afec8eb Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 21 Jan 2019 21:40:10 -0500 Subject: [PATCH 1/4] chore: standardize on a single naming scheme for releases - "build" Dockerfiles should start with build- - "release" scripts should have the name of the thing they are building appended --- .circleci/config.yml | 2 +- .../{update-build.Dockerfile => build-dokku-update.Dockerfile} | 0 contrib/{build.Dockerfile => build-dokku.Dockerfile} | 0 .../{herokuish-build.Dockerfile => build-herokuish.Dockerfile} | 0 contrib/{release => release-dokku} | 2 +- contrib/release-dokku-update | 2 +- contrib/release-herokuish | 2 +- docs/development/release-process.md | 2 +- tests/ci/setup.sh | 2 +- 9 files changed, 6 insertions(+), 6 deletions(-) rename contrib/{update-build.Dockerfile => build-dokku-update.Dockerfile} (100%) rename contrib/{build.Dockerfile => build-dokku.Dockerfile} (100%) rename contrib/{herokuish-build.Dockerfile => build-herokuish.Dockerfile} (100%) rename contrib/{release => release-dokku} (99%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 419719e1c..6bdc529f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ jobs: - run: | make ci-dependencies - run: | - ./contrib/release build + ./contrib/release-dokku build ./tests/ci/setup.sh - run: | echo 'export DOKKU_SKIP_CLEANUP=true' | sudo tee /home/dokku/.dokkurc/dokku_skip_cleanup diff --git a/contrib/update-build.Dockerfile b/contrib/build-dokku-update.Dockerfile similarity index 100% rename from contrib/update-build.Dockerfile rename to contrib/build-dokku-update.Dockerfile diff --git a/contrib/build.Dockerfile b/contrib/build-dokku.Dockerfile similarity index 100% rename from contrib/build.Dockerfile rename to contrib/build-dokku.Dockerfile diff --git a/contrib/herokuish-build.Dockerfile b/contrib/build-herokuish.Dockerfile similarity index 100% rename from contrib/herokuish-build.Dockerfile rename to contrib/build-herokuish.Dockerfile diff --git a/contrib/release b/contrib/release-dokku similarity index 99% rename from contrib/release rename to contrib/release-dokku index 832c7a227..519cbdaa4 100755 --- a/contrib/release +++ b/contrib/release-dokku @@ -49,7 +49,7 @@ fn-build-dokku() { --build-arg IS_RELEASE="$IS_RELEASE" \ --build-arg PLUGIN_MAKE_TARGET="build" \ --build-arg GOLANG_VERSION="$GOLANG_VERSION" \ - -f "contrib/build.Dockerfile" \ + -f "contrib/build-dokku.Dockerfile" \ -t "$NAME" . return "$?" } diff --git a/contrib/release-dokku-update b/contrib/release-dokku-update index 6f999ac5b..ff65578ff 100755 --- a/contrib/release-dokku-update +++ b/contrib/release-dokku-update @@ -32,7 +32,7 @@ fn-build-dokku() { pushd "$ROOT_DIR" >/dev/null docker build \ - -f "contrib/update-build.Dockerfile" \ + -f "contrib/build-dokku-update.Dockerfile" \ -t dokku-update:build . return "$?" } diff --git a/contrib/release-herokuish b/contrib/release-herokuish index 9a3bc96b3..381897f15 100755 --- a/contrib/release-herokuish +++ b/contrib/release-herokuish @@ -32,7 +32,7 @@ fn-build-dokku() { pushd "$ROOT_DIR" >/dev/null docker build \ - -f "contrib/herokuish-build.Dockerfile" \ + -f "contrib/build-herokuish.Dockerfile" \ -t herokuish:build . return "$?" } diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 9d76c8985..872c6f443 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -7,7 +7,7 @@ To propose a release, the following tasks need to be performed: ```shell export PACKAGECLOUD_TOKEN=SOME_TOKEN # supports major/minor/patch/betafish -contrib/release +contrib/release-dokku ``` > If you are a maintainer and need the PACKAGECLOUD_TOKEN in order to make a release, please contact @josegonzalez to get this information. diff --git a/tests/ci/setup.sh b/tests/ci/setup.sh index 9bfb8fcc9..143444bf9 100755 --- a/tests/ci/setup.sh +++ b/tests/ci/setup.sh @@ -43,7 +43,7 @@ install_dokku() { return fi - "${ROOT_DIR}/contrib/release" build + "${ROOT_DIR}/contrib/release-dokku" build echo "dokku dokku/hostname string dokku.me" | sudo debconf-set-selections echo "dokku dokku/key_file string /root/.ssh/id_rsa.pub" | sudo debconf-set-selections From af35de509bb7479d3ae4c253dc57538c4e30306c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 21 Jan 2019 21:40:29 -0500 Subject: [PATCH 2/4] fix: drop extra release call in test run --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6bdc529f5..e7748e480 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,6 @@ jobs: - run: | make ci-dependencies - run: | - ./contrib/release-dokku build ./tests/ci/setup.sh - run: | echo 'export DOKKU_SKIP_CLEANUP=true' | sudo tee /home/dokku/.dokkurc/dokku_skip_cleanup From f5c45b99ad5685983388ef693c5606534ce2b103 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 21 Jan 2019 21:53:35 -0500 Subject: [PATCH 3/4] refactor: use a base image when running the build process in CI --- contrib/build-base.Dockerfile | 6 ++++++ contrib/build-dokku-update.Dockerfile | 2 +- contrib/build-dokku.Dockerfile | 6 +++--- contrib/build-herokuish.Dockerfile | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 contrib/build-base.Dockerfile diff --git a/contrib/build-base.Dockerfile b/contrib/build-base.Dockerfile new file mode 100644 index 000000000..a7f7f141e --- /dev/null +++ b/contrib/build-base.Dockerfile @@ -0,0 +1,6 @@ +FROM ubuntu:14.04 + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get -y install gcc git build-essential wget ruby-dev ruby1.9.1 lintian rpm help2man man-db +RUN command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc diff --git a/contrib/build-dokku-update.Dockerfile b/contrib/build-dokku-update.Dockerfile index dde97653f..193ce217b 100644 --- a/contrib/build-dokku-update.Dockerfile +++ b/contrib/build-dokku-update.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:14.04 +FROM dokku/build-base:0.0.1 ENV DEBIAN_FRONTEND=noninteractive diff --git a/contrib/build-dokku.Dockerfile b/contrib/build-dokku.Dockerfile index df9452e69..94e286f5e 100644 --- a/contrib/build-dokku.Dockerfile +++ b/contrib/build-dokku.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:14.04 +FROM dokku/build-base:0.0.1 ENV DEBIAN_FRONTEND=noninteractive @@ -36,7 +36,7 @@ RUN PLUGIN_MAKE_TARGET=${PLUGIN_MAKE_TARGET} \ SKIP_GO_CLEAN=true \ make version copyfiles \ && rm -rf plugins/common/*.go plugins/common/glide* plugins/common/vendor/ \ - && make deb-herokuish deb-dokku deb-plugn deb-sshcommand deb-sigil deb-dokku-update \ - rpm-herokuish rpm-dokku rpm-plugn rpm-sshcommand rpm-sigil rpm-dokku-update + && make deb-dokku deb-plugn deb-sshcommand deb-sigil \ + rpm-dokku rpm-plugn rpm-sshcommand rpm-sigil RUN ls -lha /tmp/ diff --git a/contrib/build-herokuish.Dockerfile b/contrib/build-herokuish.Dockerfile index 3aaf33cad..5375f9c87 100644 --- a/contrib/build-herokuish.Dockerfile +++ b/contrib/build-herokuish.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:14.04 +FROM dokku/build-base:0.0.1 ENV DEBIAN_FRONTEND=noninteractive From 7ac9c33112b8ecc295de2f9f8e53389a2be91069 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 21 Jan 2019 21:57:03 -0500 Subject: [PATCH 4/4] tests: split by classname instead of filename --- tests.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests.mk b/tests.mk index 1c6d8ef23..cbda94884 100644 --- a/tests.mk +++ b/tests.mk @@ -239,5 +239,5 @@ test: setup-deploy-tests lint unit-tests deploy-tests test-ci: @mkdir -p test-results/bats - @cd tests/unit && echo "executing tests: $(shell cd tests/unit ; circleci tests glob *.bats | circleci tests split --split-by=timings | xargs)" - cd tests/unit && bats --formatter bats-format-junit -e -T -o ../../test-results/bats $(shell cd tests/unit ; circleci tests glob *.bats | circleci tests split --split-by=timings | xargs) + @cd tests/unit && echo "executing tests: $(shell cd tests/unit ; circleci tests glob *.bats | circleci tests split --split-by=timings --timings-type=classname | xargs)" + cd tests/unit && bats --formatter bats-format-junit -e -T -o ../../test-results/bats $(shell cd tests/unit ; circleci tests glob *.bats | circleci tests split --split-by=timings --timings-type=classname | xargs)