Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reenable DockerHub release process with new functionality #280

Merged
merged 1 commit into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ test:
- rsync -av reports/ $CIRCLE_ARTIFACTS/reports/

deployment:
hub:
production:
branch: [develop, master, 240-270-docker-hub]
commands:
- git checkout -- .dockerignore && git checkout -- Dockerfile
- docker-compose build --pull
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- source docker/deployment/scripts/circle_deployment.sh
7 changes: 5 additions & 2 deletions docker/deployment/scripts/circle_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

IMAGETAG=skip
if [ "${CIRCLE_BRANCH}" == "develop" ]; then
IMAGETAG=develop
IMAGETAG=latest
elif [ "${CIRCLE_BRANCH}" == "240-270-docker-hub" ]; then
IMAGETAG=test
elif [ "${CIRCLE_BRANCH}" == "master" ]; then
# Retrieve the version number from rails
IMAGETAG="$(ruby -e "load 'server/lib/openstudio_server/version.rb'; print OpenstudioServer::VERSION+OpenstudioServer::VERSION_EXT")"
Expand All @@ -11,7 +13,8 @@ fi
if [ "${IMAGETAG}" != "skip" ] && [ -z ${CI_PULL_REQUEST} ]; then
# If CI_PULL_REQUEST is set, then the -z returns false (counter-intuitive)
docker-compose build --pull
docker login -u $DOCKER_USER -p $DOCKER_PASS
# Still need email with circleci, presumably because of the version of docker.
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS

echo "Tagging image as $IMAGETAG"
docker tag nrel/openstudio-server nrel/openstudio-server:$IMAGETAG
Expand Down