This repository has been archived by the owner on Mar 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 149
/
run-docker-compose-dev
executable file
·44 lines (39 loc) · 1.83 KB
/
run-docker-compose-dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
echo "------------- yarn install -------------"
yarn install
echo "------------- docker-compose up -d -------------"
docker-compose up -d
echo
echo "------------- docker-compose ps -------------"
docker-compose ps
echo
exec_in_vault() {
echo "------------- $@ -------------"
docker-compose exec -T vault "$@"
echo
}
exec_in_vault vault login "$(docker-compose logs vault | awk '/Root Token:/ {print $NF;}' | tail -n 1 | sed 's/\x1b\[[0-9;]*m//g')"
exec_in_vault vault status
exec_in_vault vault auth enable userpass
exec_in_vault vault auth enable -path=userpass2 userpass
exec_in_vault vault auth enable github
exec_in_vault vault auth enable radius
exec_in_vault vault auth enable -path=awsaccount1 aws-ec2
exec_in_vault vault auth enable okta
exec_in_vault vault auth enable approle
exec_in_vault vault auth enable kubernetes
exec_in_vault vault policy write admin /misc/admin.hcl
exec_in_vault vault write auth/userpass/users/test password=test policies=admin
exec_in_vault vault write auth/userpass2/users/john password=doe policies=admin
exec_in_vault vault write auth/userpass/users/lame password=lame policies=default
exec_in_vault vault write auth/radius/users/test password=test policies=admin
exec_in_vault vault write secret/test somekey=somedata
exec_in_vault vault secrets enable -path=ultrasecret generic
exec_in_vault vault write ultrasecret/moretest somekey=somedata
exec_in_vault vault write ultrasecret/dir1/secret somekey=somedata
exec_in_vault vault write ultrasecret/dir2/secret somekey=somedata
exec_in_vault vault write ultrasecret/dir2/secret2 somekey=somedata
exec_in_vault vault write ultrasecret/admincantlistthis/butcanreadthis somekey=somedata
exec_in_vault vault write ultrasecret/admincantreadthis somekey=somedata
echo "------------- Vault Root Token -------------"
docker-compose logs vault | grep 'Root Token:' | tail -n 1