Created
July 18, 2019 21:09
-
-
Save ipleten/49df66b9dba3cc87360c86e19b384e7c to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -e | |
env='prod' | |
team='common' | |
svc='adm' | |
declare -A IDS | |
IDS=( | |
# prod | |
['prod']='1' | |
['prod/auth/flow']='2' | |
['prod/auth/account']='2' | |
['prod/common/adm']='3' | |
# staging | |
['staging']='4' | |
) | |
# Magic is here. | |
ID=${IDS["${env}"]} | |
ID=${IDS["${env}/${team}"]:-${ID}} | |
ID=${IDS["${env}/${team}/${svc}"]:-${ID}} | |
echo "$ID" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment