Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
Fix develop image deployment
Browse files Browse the repository at this point in the history
The $TRAVIS_TAG variable is available for tagged branches only. Separate
tag deployments and branch deployments with their own docker tag
commands in scripts/deploy.sh.
  • Loading branch information
darkowlzz committed Mar 25, 2019
1 parent 9e673ae commit d36068a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ jobs:
- make image/cluster-operator
before_deploy:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
- docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:latest"
- docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:${TRAVIS_TAG}"
deploy:
- provider: script
script: docker push "${IMAGE_NAME}:latest" && docker push "${IMAGE_NAME}:${TRAVIS_TAG}"
script: bash scripts/deploy.sh tagged
on:
tags: true
- provider: script
script: docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:develop" && docker push "${IMAGE_NAME}:develop"
script: bash scripts/deploy.sh develop
on:
branch: master
15 changes: 15 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

# This script is used for publishing latest(release) and develop(canary)
# container images of the operator. Script argument "tagged" must be passed to
# publish a new release and "develop" must be passed to publish a canary image.

if [ "$1" = "tagged" ]; then
docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:latest"
docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:${TRAVIS_TAG}"
docker push "${IMAGE_NAME}:latest" && docker push "${IMAGE_NAME}:${TRAVIS_TAG}"
elif [ "$1" = "develop" ]; then
docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:develop"
docker push "${IMAGE_NAME}:develop"
fi

0 comments on commit d36068a

Please sign in to comment.