-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart_enterprise
executable file
·76 lines (64 loc) · 2.4 KB
/
start_enterprise
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
set -x
set -e
# Script to run SpringBootExample against Conjur Enterprise (appliance)
# Ensure conjur-intro submodule is checked out
git submodule update --init --recursive
pushd ./conjur-intro
pwd
# Provision master and follower
./bin/dap --provision-master
./bin/dap --provision-follower
# Load policy required by SpringBootExample
# conjur.yml must be in the conjur-intro folder for access
# via docker-compose exec
cp ../conjur.yml .
# ./bin/cli conjur policy load --replace root conjur.yml
./bin/cli conjur policy load -b root --file conjur.yml > demo_api.txt
awk '/api_key/ {print}' demo_api.txt | awk '{print $2}' | sed 's/^"//' | sed 's/"$//'
# # # Set variable values
# ./bin/cli conjur variable set -i db/password -v "secret"
# ./bin/cli conjur variable set -i db/dbuserName -v 123456
# ./bin/cli conjur variable set -i db/dbpassWord -v 7890123
# ./bin/cli conjur variable set -i db/key -v 456789
# # # Set variable values
./bin/cli conjur variable values add db/password "secret"
./bin/cli conjur variable values add db/dbuserName 123456
./bin/cli conjur variable values add db/dbpassWord 7890123
./bin/cli conjur variable values add db/key 456789
./bin/cli conjur list
docker compose version
# Retrieve pem
docker compose \
run \
--rm \
-w /src/cli \
--entrypoint sh \
client \
-c "cp /root/conjur-server.pem conjur-enterprise.pem"
cp conjur-enterprise.pem ../
# Retrieve Admin API Key conjur user rotate-api-key
# admin_api_key="$(./bin/cli conjur user rotate_api_key|tail -n 1| tr -d '\r')"
admin_api_key="$(./bin/cli conjur user rotate-api-key|tail -n 1| tr -d '\r')"
echo "admin api key: ${admin_api_key}"
echo "${admin_api_key}" > api_key
cp api_key ../
popd
pwd
docker run \
--volume "$(git rev-parse --show-toplevel):/repo" \
--volume "${PWD}/maven_cache":/root/.m2 \
--volume "${PWD}/api_key:/api_key" \
--volume "${PWD}/conjur-enterprise.pem:/conjur-enterprise.pem" \
--network dap_net \
-e "CONJUR_APPLIANCE_URL=https://conjur-master.mycompany.local" \
-e "CONJUR_ACCOUNT=demo" \
-e "CONJUR_AUTHN_LOGIN=admin" \
-e "CONJUR_AUTHN_API_KEY=${admin_api_key}" \
-e "CONJUR_SSL_CERT_FILE=/conjur-enterprise.pem" \
-e "CONJUR_AUTHN_TOKEN_FILE=/api_key" \
--workdir "/repo" \
--rm \
--entrypoint sh \
conjur-mule-image \
-ec 'mvn --batch-mode -f pom.xml jacoco:prepare-agent test jacoco:report'