Skip to content

Commit

Permalink
Fix travis/ci release process
Browse files Browse the repository at this point in the history
  • Loading branch information
mangelajo committed Feb 17, 2020
1 parent c184b75 commit 06ca5f3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ language: go
branches:
only:
- master
- /^v\d+\.\d+\.\d+.*$/

git:
depth: 1
Expand All @@ -13,7 +14,12 @@ services:
script:
- make ci e2e status=keep
deploy:
provider: script
script: bash scripts/release
on:
branch: master
- provider: script
script: bash scripts/release
on:
branch: master
- provider: script
script: bash scripts/release $TRAVIS_TAG
skip_cleanup: true
on:
tags: true
2 changes: 2 additions & 0 deletions scripts/e2e
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
set -e

source $(dirname $0)/lib/debug_functions
source $(dirname $0)/lib/version


cd $(dirname $0)

Expand Down
2 changes: 1 addition & 1 deletion scripts/kind-e2e/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function kind_import_images() {
docker tag quay.io/submariner/submariner:latest submariner:local
docker pull quay.io/submariner/submariner-route-agent:latest
docker tag quay.io/submariner/submariner-route-agent:latest submariner-route-agent:local
docker tag quay.io/submariner/submariner-operator:dev submariner-operator:local
docker tag quay.io/submariner/submariner-operator:$VERSION submariner-operator:local
if [[ $lighthouse = true ]]; then
docker pull quay.io/openshift/kubefed-operator:v0.1.0-rc3
docker pull quay.io/kubernetes-multicluster/kubefed:v0.1.0-rc6
Expand Down
8 changes: 4 additions & 4 deletions scripts/lib/version
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi

COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=$(git tag -l --contains HEAD | head -n 1)
export COMMIT=$(git rev-parse --short HEAD)
export GIT_TAG=$(git tag -l --contains HEAD | head -n 1)

if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
VERSION=$GIT_TAG
export VERSION=$GIT_TAG
else
VERSION="dev"
export VERSION="dev"
fi
8 changes: 6 additions & 2 deletions scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
set -e

source $(dirname $0)/lib/debug_functions
source $(dirname $0)/lib/version


DOCKER_TAG=${1:-latest}

echo "$QUAY_PASSWORD" | docker login quay.io -u "$QUAY_USERNAME" --password-stdin
docker tag quay.io/submariner/submariner-operator:dev quay.io/submariner/submariner-operator:latest
docker tag quay.io/submariner/submariner-operator:dev quay.io/submariner/submariner-operator:"${TRAVIS_COMMIT:0:7}"
docker tag quay.io/submariner/submariner-operator:$VERSION quay.io/submariner/submariner-operator:${DOCKER_TAG#"v"}
docker tag quay.io/submariner/submariner-operator:$VERSION quay.io/submariner/submariner-operator:"${TRAVIS_COMMIT:0:7}"
for i in $(docker images --format "{{.Repository}}:{{.Tag}}" | grep "quay.io/submariner"); do docker push $i; done

0 comments on commit 06ca5f3

Please sign in to comment.