-
Notifications
You must be signed in to change notification settings - Fork 35
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
Support tagged releases in Travis, Ansible #656
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,35 +5,7 @@ set -x | |
|
||
for image in app editor web gradle analysis; | ||
do | ||
docker push "quay.io/azavea/driver-${image}:${TRAVIS_COMMIT:0:7}" | ||
docker tag "quay.io/azavea/driver-${image}:${TRAVIS_COMMIT:0:7}" "quay.io/azavea/driver-${image}:latest" | ||
docker push "quay.io/azavea/driver-${image}:latest" | ||
docker push "quay.io/azavea/driver-${image}:${TRAVIS_TAG}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that if we remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above; my understanding from the docs is that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this seems to back that up too:
|
||
docker tag "quay.io/azavea/driver-${image}:${TRAVIS_TAG}" "quay.io/azavea/driver-${image}:${TRAVIS_TAG}" | ||
docker push "quay.io/azavea/driver-${image}:${TRAVIS_TAG}" | ||
done | ||
|
||
# TODO: The below was for deploying to our staging environment, which we no longer have. | ||
# If staging is ever resurrected, we can re-enable this. | ||
# Set up group vars | ||
#echo "setting up group vars..." | ||
#set +x | ||
#grep -v nominatim_key deployment/ansible/group_vars/all.example \ | ||
# > deployment/ansible/group_vars/all | ||
#echo "web_js_nominatim_key: \"${NOMINATIM_API_KEY}\"" \ | ||
# >> deployment/ansible/group_vars/all | ||
#echo "oauth_client_id: \"${OAUTH_CLIENT_ID}\"" \ | ||
# >> deployment/ansible/group_vars/all | ||
#echo "oauth_client_secret: \"${OAUTH_CLIENT_SECRET}\"" \ | ||
# >> deployment/ansible/group_vars/all | ||
#echo "forecast_io_api_key: \"${FORECAST_IO_API_KEY}\"" \ | ||
# >> deployment/ansible/group_vars/all | ||
#echo "keystore_password: \"${DRIVER_KEYSTORE_PASSWORD}\"" \ | ||
# >> deployment/ansible/group_vars/all | ||
#set -x | ||
|
||
#ansible-galaxy install -f -r deployment/ansible/roles.yml -p deployment/ansible/roles | ||
|
||
#chmod 0600 deployment/driver.pem | ||
|
||
#ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook \ | ||
# -i deployment/ansible/inventory/staging \ | ||
# --private-key="${TRAVIS_BUILD_DIR}/deployment/driver.pem" \ | ||
# deployment/ansible/database.yml deployment/ansible/app.yml deployment/ansible/celery.yml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -x | ||
|
||
for image in app editor web gradle analysis; | ||
do | ||
docker push "quay.io/azavea/driver-${image}:${TRAVIS_COMMIT:0:7}" | ||
docker tag "quay.io/azavea/driver-${image}:${TRAVIS_COMMIT:0:7}" "quay.io/azavea/driver-${image}:latest" | ||
docker push "quay.io/azavea/driver-${image}:latest" | ||
done | ||
|
||
# TODO: The below was for deploying to our staging environment, which we no longer have. | ||
# If staging is ever resurrected, we can re-enable this. | ||
# Set up group vars | ||
#echo "setting up group vars..." | ||
#set +x | ||
#grep -v nominatim_key deployment/ansible/group_vars/all.example \ | ||
# > deployment/ansible/group_vars/all | ||
#echo "web_js_nominatim_key: \"${NOMINATIM_API_KEY}\"" \ | ||
# >> deployment/ansible/group_vars/all | ||
#echo "oauth_client_id: \"${OAUTH_CLIENT_ID}\"" \ | ||
# >> deployment/ansible/group_vars/all | ||
#echo "oauth_client_secret: \"${OAUTH_CLIENT_SECRET}\"" \ | ||
# >> deployment/ansible/group_vars/all | ||
#echo "forecast_io_api_key: \"${FORECAST_IO_API_KEY}\"" \ | ||
# >> deployment/ansible/group_vars/all | ||
#echo "keystore_password: \"${DRIVER_KEYSTORE_PASSWORD}\"" \ | ||
# >> deployment/ansible/group_vars/all | ||
#set -x | ||
|
||
#ansible-galaxy install -f -r deployment/ansible/roles.yml -p deployment/ansible/roles | ||
|
||
#chmod 0600 deployment/driver.pem | ||
|
||
#ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook \ | ||
# -i deployment/ansible/inventory/staging \ | ||
# --private-key="${TRAVIS_BUILD_DIR}/deployment/driver.pem" \ | ||
# deployment/ansible/database.yml deployment/ansible/app.yml deployment/ansible/celery.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may lead to two deployments that race, at least if we use
git-flow
. I think that the completion of a release branch will trigger a build for the merge intomaster
, but also a build for the tagged commit.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding from the docs is that
branch
andtags
are AND-ed together such that a build is only kicked off if it satisfies both conditions:https://docs.travis-ci.com/user/deployment#Conditional-Releases-with-on%3A
But I have no experience with this aspect of travis so it's definitely possible that that's not quite how it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. This may be true then. I was basing my understanding off of visually seeing builds get triggered for
master
and tagged commits whenever a release gets finalized (merges intomaster
,develop
, and tagged commit). It is possible that at the end of a build it ANDs these conditions together to make a decision.