Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Improve travis build - skip redundant jobs (#2731)
Browse files Browse the repository at this point in the history
* Fix travis configuration

* Set deploy type in .travis.yaml

* Unify publish-svc-cat scripts
  • Loading branch information
Adam Wałach authored and k8s-ci-robot committed Oct 17, 2019
1 parent 9a09646 commit dda1fc0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 12 deletions.
47 changes: 40 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ before_install:
[[ -z "$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -vE $DOCS_REGEX)" ]]
DOCS_ONLY=$?
fi
if [[ $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+[a-z]*((-beta.[0-9]+)|(-(r|R)(c|C)[0-9]+))?$ ]]; then
export DEPLOY_TYPE=release
elif [[ $TRAVIS_BRANCH == "master" ]]; then
export DEPLOY_TYPE=master
else
export DEPLOY_TYPE=none-$TRAVIS_TAG-$TRAVIS_BRANCH
fi
jobs:
fast_finish: true
include:
# CI Build
- stage: test
name: verify
script:
- |
if (( $DOCS_ONLY == 0 )); then
Expand All @@ -48,62 +56,87 @@ jobs:
env: GO_VERSION=1.12
# Doc Site svc-cat.io
- stage: test
name: docs
script:
- |
make docs
env: DOCS=true
# Deploy
# Deploy service-catalog on release
- stage: deploy
name: SC release - amd64
script: skip
deploy:
skip_cleanup: true
provider: script
script: contrib/hack/ci/publish-svc-cat.sh --arch amd64
on:
repo: kubernetes-sigs/service-catalog
all_branches: true
condition: $DEPLOY_TYPE == release
- stage: deploy
name: SC release - arm
script: skip
deploy:
skip_cleanup: true
provider: script
script: contrib/hack/ci/publish-svc-cat-release.sh --arch amd64
script: contrib/hack/ci/publish-svc-cat.sh --arch arm
on:
repo: kubernetes-sigs/service-catalog
all_branches: true
condition: $DEPLOY_TYPE == release
- stage: deploy
name: SC release - arm64
script: skip
deploy:
skip_cleanup: true
provider: script
script: contrib/hack/ci/publish-svc-cat-release.sh --arch arm
script: contrib/hack/ci/publish-svc-cat.sh --arch arm64
on:
repo: kubernetes-sigs/service-catalog
all_branches: true
condition: $DEPLOY_TYPE == release
- stage: deploy
name: SC release - ppc64le
script: skip
deploy:
skip_cleanup: true
provider: script
script: contrib/hack/ci/publish-svc-cat-release.sh --arch arm64
script: contrib/hack/ci/publish-svc-cat.sh --arch ppc64le
on:
repo: kubernetes-sigs/service-catalog
all_branches: true
condition: $DEPLOY_TYPE == release
- stage: deploy
name: SC release - s390x
script: skip
deploy:
skip_cleanup: true
provider: script
script: contrib/hack/ci/publish-svc-cat-release.sh --arch ppc64le
script: contrib/hack/ci/publish-svc-cat.sh --arch s390x
on:
repo: kubernetes-sigs/service-catalog
all_branches: true
condition: $DEPLOY_TYPE == release
# Deploy service-catalog after merge to master
- stage: deploy
name: SC master - amd64
script: skip
deploy:
skip_cleanup: true
provider: script
script: contrib/hack/ci/publish-svc-cat-release.sh --arch s390x
script: contrib/hack/ci/publish-svc-cat.sh
on:
repo: kubernetes-sigs/service-catalog
all_branches: true
condition: $DEPLOY_TYPE == master
# Deploy svcat on release
- stage: deploy
name: SVCAT
script: skip
deploy:
skip_cleanup: true
provider: script
script: contrib/hack/ci/publish-svcat-cli-release.sh
script: contrib/hack/ci/publish-svcat-cli.sh
on:
repo: kubernetes-sigs/service-catalog
all_branches: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ set -o errexit
set -o nounset
set -o pipefail

echo "DEPLOY_TYPE ${DEPLOY_TYPE}"

readonly CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
readonly REPO_ROOT_DIR=${CURRENT_DIR}/../../../

Expand Down Expand Up @@ -59,13 +61,12 @@ if [[ "$#" -ne 0 ]]; then
set -- ${POSITIONAL[@]+"${POSITIONAL[@]}"}
fi


pushd ${REPO_ROOT_DIR}
echo ${RELEASE_ARCH}
if [[ "${TRAVIS_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+[a-z]*((-beta.[0-9]+)|(-(r|R)(c|C)[0-9]+))?$ ]]; then
if [[ "${DEPLOY_TYPE}" == "release" ]]; then
shout "Pushing Service Catalog ${RELEASE_ARCH} images with tags '${TRAVIS_TAG}' and 'latest'."
TAG_VERSION="${TRAVIS_TAG}" VERSION="${TRAVIS_TAG}" MUTABLE_TAG="latest" make release-push${RELEASE_ARCH}
elif [[ "${TRAVIS_BRANCH}" == "master" ]]; then
elif [[ "${DEPLOY_TYPE}" == "master" ]]; then
shout "Pushing Service Catalog ${RELEASE_ARCH} images with default tags (git sha and 'canary')."
make push
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ set -o errexit
set -o nounset
set -o pipefail

echo "DEPLOY_TYPE ${DEPLOY_TYPE}"

readonly CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
readonly REPO_ROOT_DIR=${CURRENT_DIR}/../../../

Expand All @@ -29,10 +31,10 @@ docker login -u "${QUAY_USERNAME}" -p "${QUAY_PASSWORD}" quay.io

pushd ${REPO_ROOT_DIR}

if [[ "${TRAVIS_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+[a-z]*((-beta.[0-9]+)|(-(r|R)(c|C)[0-9]+))?$ ]]; then
if [[ "${DEPLOY_TYPE}" == "release" ]]; then
shout "Pushing svcat CLI images with tags '${TRAVIS_TAG}' and 'latest'."
TAG_VERSION="${TRAVIS_TAG}" VERSION="${TRAVIS_TAG}" MUTABLE_TAG="latest" make svcat-publish
elif [[ "${TRAVIS_BRANCH}" == "master" ]]; then
elif [[ "${DEPLOY_TYPE}" == "master" ]]; then
shout "Pushing svcat CLI images with default tags (git sha and 'canary')."
make svcat-publish
else
Expand Down

0 comments on commit dda1fc0

Please sign in to comment.