-
Notifications
You must be signed in to change notification settings - Fork 0
/
create.sh
executable file
·60 lines (48 loc) · 1.71 KB
/
create.sh
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
#!/bin/bash
set -euo pipefail
# destroy the existing environment.
docker compose --profile test down --remove-orphans --volumes
docker compose --profile client down --remove-orphans --volumes
docker compose down --remove-orphans --volumes
rm -f terraform.{log,tfstate,tfstate.backup} tfplan
# build the environment.
docker compose --profile client build --progress plain
docker compose --profile test build --progress plain
docker compose build --progress plain
# start the environment in background.
docker compose up --detach
# wait for the services to exit.
function wait-for-service {
echo "Waiting for the $1 service to complete..."
while true; do
result="$(docker compose ps --status exited --format json $1)"
if [ -n "$result" ] && [ "$result" != 'null' ]; then
exit_code="$(jq -r '.ExitCode' <<<"$result")"
break
fi
sleep 3
done
docker compose logs $1
return $exit_code
}
wait-for-service init
# start the client services.
docker compose --profile client up --detach
# execute the automatic tests.
cat <<'EOF'
#### Automated tests results
EOF
echo 'example-go-confidential client test:'
docker compose run example-go-confidential-test | sed -E 's,^(.*), \1,g'
echo
# show how to use the system.
cat <<'EOF'
#### Manual tests
example-go-confidential client:
Start the login dance at http://example-go-confidential.test:8081 as admin:admin
wso2is:
https://wso2is.test:9443/console/ (WSO2IS Console; login as `admin`:`admin`)
https://wso2is.test:9443/carbon/ (Deprecated; WSO2IS Carbon Management Console; login as `admin`:`admin`)
https://wso2is.test:9443/myaccount/ (WSO2IS My Account; login as `admin`:`admin`)
https://wso2is.test:9443/oauth2/token/.well-known/openid-configuration
EOF