forked from jvanderhoof/Ansiblefest-2017
-
Notifications
You must be signed in to change notification settings - Fork 0
/
2_set_secrets.sh
executable file
·22 lines (15 loc) · 1.05 KB
/
2_set_secrets.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash -e
api_key=$(docker-compose exec conjur rails r "print Credentials['cucumber:user:admin'].api_key")
echo '--------- Set Secrets defined in Policy ------------'
docker-compose run --rm -e CONJUR_AUTHN_API_KEY=$api_key conjur_cli \
variable values add staging/myapp/database/username foo_staging_user
docker-compose run --rm -e CONJUR_AUTHN_API_KEY=$api_key conjur_cli \
variable values add staging/myapp/database/password "$(openssl rand -hex 12)"
docker-compose run --rm -e CONJUR_AUTHN_API_KEY=$api_key conjur_cli \
variable values add staging/myapp/stripe/private_key "$(openssl rand -hex 60)"
docker-compose run --rm -e CONJUR_AUTHN_API_KEY=$api_key conjur_cli \
variable values add production/myapp/database/username foo_production_user
docker-compose run --rm -e CONJUR_AUTHN_API_KEY=$api_key conjur_cli \
variable values add production/myapp/database/password "$(openssl rand -hex 12)"
docker-compose run --rm -e CONJUR_AUTHN_API_KEY=$api_key conjur_cli \
variable values add production/myapp/stripe/private_key "$(openssl rand -hex 60)"