Skip to content

Instantly share code, notes, and snippets.

@waynegemmell
Created May 7, 2018 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waynegemmell/f438fc28a51da3841b0b2de5d001e441 to your computer and use it in GitHub Desktop.
Save waynegemmell/f438fc28a51da3841b0b2de5d001e441 to your computer and use it in GitHub Desktop.
{% set parts = grains['host'].split('-') %}
{% if parts[1] == 'live' %}
config: live
{% elif parts[1] == 'dev' %}
config: dev
{% else %}
config: dev
{% endif %}
{% if parts|length < 4 %}
branch: 'master'
{% else %}
branch: {{ parts[2] }}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment