Skip to content

Commit

Permalink
Push yorc docker image on bintray and tar.gz on gitub releases
Browse files Browse the repository at this point in the history
  • Loading branch information
stebenoist committed Mar 2, 2018
1 parent 90156df commit 3096090
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ deploy:
file:
- dist/yorc.tgz
- dist/yorc-server-*-distrib.zip
- pkg/docker-ystia-yorc-*.tgz
skip_cleanup: true
on:
tags: true
Expand Down
21 changes: 21 additions & 0 deletions docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,23 @@
# limitations under the License.


#set -x
#set -e

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

#### Bintray Variables
bintray_api_user="stebenoist"
bintray_docker_registry="ystia-docker-yorc-docker.bintray.io"
bintray_docker_repo="ystia/yorc"

#### Test variables
#TRAVIS=true
#TRAVIS_TAG="3.0.0-RC1"
#TRAVIS_PULL_REQUEST=false
#TRAVIS_BRANCH="develop"
#BINTRAY_API_KEY=AHAHHAHAAH

if [[ ! -e ${script_dir}/yorc ]]; then
cd ${script_dir}
make
Expand All @@ -34,6 +49,7 @@ if [[ "${TRAVIS}" == "true" ]]; then
DOCKER_TAG="latest";;
*)
# Do not build a container for other branches
echo "No container is built for other branches than develop."
exit 0;;
esac
fi
Expand All @@ -49,4 +65,9 @@ docker build ${BUILD_ARGS} --build-arg "TERRAFORM_VERSION=${tf_version}" --build
if [[ "${TRAVIS}" == "true" ]]; then
docker save "ystia/yorc:${DOCKER_TAG:-latest}" | gzip > docker-ystia-yorc-${DOCKER_TAG:-latest}.tgz
ls -lh docker-ystia-yorc-${DOCKER_TAG:-latest}.tgz

## Push Image on Bintray Docker Registry
docker login -u ${bintray_api_user} -p $BINTRAY_API_KEY ${bintray_docker_registry}
docker tag "ystia/yorc:${DOCKER_TAG:-latest}" ${bintray_docker_registry}/${bintray_docker_repo}:${DOCKER_TAG:-latest}
docker push ${bintray_docker_registry}/${bintray_docker_repo}:${DOCKER_TAG:-latest}
fi

0 comments on commit 3096090

Please sign in to comment.