Files
cinderlib/travis-scripts/push
Gorka Eguileor de1ee38d4d Add LVM CI job
This patch adds several CI jobs:

- PEP8
- Unit tests
- LVM

It also changes how we build our images. Now we only push a new image to
Docker Hub if the tests pass successfully.  And we only bother to build
the images if PEP8, Unit tests, and LVM jobs run successfully.
2018-09-06 08:43:28 +02:00

28 lines
979 B
Bash
Executable File

#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
. "$DIR/set-tags"
set -ev
# Only push when tagging a release or making changes to master branch
if [[ "$TRAVIS_BRANCH" == "$TRAVIS_TAG" || ("$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false") ]]; then
for tag_info_string in $TAGS; do
IFS=';' read -a tag_info <<< "$tag_info_string"
echo "Pulling ${tag_info[3]} ..."
docker pull ${tag_info[3]}
echo "Retagging and pushing ${tag_info[4]} ..."
docker tag ${tag_info[3]} ${tag_info[4]}
docker push ${tag_info[4]}
if [ "${tag_info[5]}" == "stable" ]; then
echo "Setting stable tag ${tag_info[2]}"
docker tag ${tag_info[4]} ${FINAL_REPO}:${tag_info[2]}
docker push ${FINAL_REPO}:${tag_info[2]}
fi
done
# TODO: Trigger Ember-CSI jobs https://docs.travis-ci.com/user/triggering-builds/
else
echo "This is not a tag or a merge to master, skipping pushing to ember-csi"
fi