forked from konflux-ci/konflux-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-konflux.sh
executable file
·55 lines (39 loc) · 1.29 KB
/
deploy-konflux.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
#!/bin/bash -e
script_path="$(dirname -- "${BASH_SOURCE[0]}")"
main() {
echo "Deploying Konflux" >&2
deploy
echo "Waiting for Konflux to be ready" >&2
local ret=0
"${script_path}/wait-for-all.sh" || ret="$?"
kubectl describe deployment proxy -n konflux-ui
kubectl logs deployment/proxy -n konflux-ui --all-containers=true --tail=10
exit "$ret"
}
deploy() {
# The order is important
# This will deploy the commos CRDs used in Konflux
kubectl apply -k "${script_path}/konflux-ci/application-api"
kubectl apply -k "${script_path}/konflux-ci/rbac"
retry kubectl apply -k "${script_path}/konflux-ci/enterprise-contract"
retry kubectl apply -k "${script_path}/konflux-ci/release"
# The build-service depends on CRDs from the release-service
retry kubectl apply -k "${script_path}/konflux-ci/build-service"
# The integration-service depends on CRDs from the release-service
retry kubectl apply -k "${script_path}/konflux-ci/integration"
kubectl apply -k "${script_path}/konflux-ci/ui"
}
retry() {
for _ in {1..3}; do
local ret=0
"$@" || ret="$?"
if [[ "$ret" -eq 0 ]]; then
return 0
fi
sleep 3
done
return "$ret"
}
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
main "$@"
fi