Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Commit

Permalink
try to get tag & push docker images working
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsdave committed Feb 14, 2018
1 parent 2e4ca95 commit e01e3dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ sudo: required
services:
- docker
env:
- DOCKER_TEMP_TAG=bindle
global:
- DOCKER_TEMP_TAG=bindle
install:
- source cfg4dev
# installing ndg-httpsclient eliminates a TLS warning
Expand All @@ -23,15 +24,15 @@ script:
- python setup.py bdist_wheel sdist --formats=gztar
- travis_fold end "build.python.packages"
- travis_fold start "build.docker.image"
- ./dockerfiles/build-docker-images.sh $DOCKERHUB_USERNAME $DOCKER_TEMP_TAG ./dist/clair-cicd-*.*.*.tar.gz
- ./dockerfiles/build-docker-images.sh ${DOCKERHUB_USERNAME} ${DOCKER_TEMP_TAG} ./dist/clair-cicd-*.*.*.tar.gz
- travis_fold start "build.docker.image"
# :TODO: add integration/sanity tests on the docker images we just built
deploy:
- provider: script
script: ./dockerfiles/tag-and-push-docker-images.sh $DOCKER_USERNAME $DOCKER_PASSWORD $DOCKER_TEMP_TAG latest
script: ./dockerfiles/tag-and-push-docker-images.sh ${DOCKER_USERNAME} ${DOCKER_PASSWORD} ${DOCKER_TEMP_TAG} latest
on:
branch: master
- provider: script
script: ./dockerfiles/tag-and-push-docker-images.sh $DOCKER_USERNAME $DOCKER_PASSWORD $DOCKER_TEMP_TAG $TRAVIS_TAG
script: ./dockerfiles/tag-and-push-docker-images.sh ${DOCKER_USERNAME} ${DOCKER_PASSWORD} ${DOCKER_TEMP_TAG} ${TRAVIS_TAG}
on:
tags: true
19 changes: 11 additions & 8 deletions dockerfiles/tag-and-push-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -e

SCRIPT_DIR_NAME="$( cd "$( dirname "$0" )" && pwd )"

echo "$#"
echo "$@"

if [ $# != 4 ]; then
echo "usage: $(basename "$0") <username> <password> <current tag> <new tag>" >&2
exit 1
Expand All @@ -15,15 +18,15 @@ CURRENT_TAG=${3:-}
NEW_TAG=${4:-}

"$SCRIPT_DIR_NAME/cicd-tools/tag-and-push-docker-image.sh" \
"$USERNAME" \
"$PASSWORD" \
"$CURRENT_TAG" \
"$NEW_TAG"
"${USERNAME}" \
"${PASSWORD}" \
"${CURRENT_TAG}" \
"${NEW_TAG}"

"$SCRIPT_DIR_NAME/database/tag-and-push-docker-image.sh" \
"$USERNAME" \
"$PASSWORD" \
"$CURRENT_TAG" \
"$NEW_TAG"
"${USERNAME}" \
"${PASSWORD}" \
"${CURRENT_TAG}" \
"${NEW_TAG}"

exit 0

0 comments on commit e01e3dd

Please sign in to comment.