Last active
August 26, 2024 22:57
-
-
Save sfgov-mikela/fc0948c943ce36c2aa783582143fdc19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set this environment variable using the Circle CI admin | |
# TOWER_OAUTH_TOKEN="<access token value>" | |
version: 2.1 | |
jobs: | |
deploy_to_aws: | |
docker: | |
- image: continuumio/miniconda3 | |
steps: | |
- run: | |
command: | | |
export TOWER_HOST="awx.api.sf.gov" | |
declare -A branch_to_job=( ["production"]="111" ["staging"]="222" ["dev"]="333") | |
export JOB_ID = ${branch_to_job[${CIRCLE_BRANCH}]} | |
pip install ansible-tower-cli | |
tower-cli job launch --job-template=$JOB_ID --extra-vars="" --wait --monitor | |
workflows: | |
on_commit: | |
jobs: | |
- deploy_to_aws: | |
filters: | |
branches: | |
only: | |
- production | |
- staging | |
- dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Folks
Here is a video on how to:
https://www.loom.com/share/eb82f71ab86d4d75b438af960c63cf55?sid=4af7eb48-fa86-4414-975c-85235a63937b
Here is a link to my changes to the original gist that sets the Tower environment variable and docker authentication