From 229f303e2cfcad593a4a304961d54380bc070619 Mon Sep 17 00:00:00 2001 From: Lorenzo Fontana Date: Wed, 9 Jan 2019 09:18:26 +0100 Subject: [PATCH] feat(integration): build images before integration tests Signed-off-by: Lorenzo Fontana --- .travis.yml | 3 ++- hack/ci-build-image.sh | 11 +++++++++++ hack/{release-image.sh => ci-release-image.sh} | 2 -- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100755 hack/ci-build-image.sh rename hack/{release-image.sh => ci-release-image.sh} (95%) diff --git a/.travis.yml b/.travis.yml index 3ae5b5a5..aec8509d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ services: script: - make test - make _output/bin/kubectl-trace +- ./hack/ci-build-image.sh - make integration after_success: -- ./hack/release-image.sh +- ./hack/ci-release-image.sh diff --git a/hack/ci-build-image.sh b/hack/ci-build-image.sh new file mode 100755 index 00000000..6e36c102 --- /dev/null +++ b/hack/ci-build-image.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -xeo pipefail + +make=$(command -v make) + +makeopts="" +if [[ ! -z "$TRAVIS_PULL_REQUEST_BRANCH" ]]; then + makeopts="-e GIT_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH image/build" +fi + +$make $makeopts image/build diff --git a/hack/release-image.sh b/hack/ci-release-image.sh similarity index 95% rename from hack/release-image.sh rename to hack/ci-release-image.sh index 42f9b9fb..8dee914c 100755 --- a/hack/release-image.sh +++ b/hack/ci-release-image.sh @@ -12,8 +12,6 @@ if [[ ! -z "$TRAVIS_PULL_REQUEST_BRANCH" ]]; then makeopts="-e GIT_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH image/build" fi -$make $makeopts image/build - if [[ ! -z "$QUAY_TOKEN" ]]; then $docker login -u="fntlnz+travisci" -p="$QUAY_TOKEN" quay.io $make $makeopts image/push