Last active
October 10, 2017 12:59
-
-
Save ssummer3/33d5b2cd0d00b552b4717d0729829617 to your computer and use it in GitHub Desktop.
Ansible Scratchpad
This file contains hidden or 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
--- | |
# valid buildspec phases | |
buildspec_phases: | |
- install | |
- pre_build | |
- build | |
- post_build | |
- poster_build | |
# set root of the git repo | |
repo_root: 'files/repo' | |
# set buildspec.yml | |
buildspec_file: '{{ repo_root }}/buildspec.yml' | |
# load buildspec.yml | |
buildspec: '{{ lookup("file", buildspec_file) | from_yaml }}' | |
# load environment variables | |
# TBD: parameter-store | |
buildspec_env: '{{ buildspec | json_query("env.variables") }}' | |
# create a dictionary for commands in each phase | |
buildspec_phases_commands: | | |
{ {% for phase in buildspec_phases %} | |
'{{ phase }}': {{ (buildspec.phases[phase] | default({'commands':[]}))['commands'] }}, | |
{% endfor %} } | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment