/
deploy.sh
executable file
·30 lines (24 loc) · 952 Bytes
/
deploy.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
#!/bin/bash
echo "Create Gitlab"
IP_ADDR=$(bx cs workers "$CLUSTER_NAME" | grep Ready | awk '{ print $2 }')
if [[ -z "$IP_ADDR" ]]; then
echo "$CLUSTER_NAME not created or workers not ready"
exit 1
fi
echo -e "Configuring vars"
if ! exp=$(bx cs cluster-config "$CLUSTER_NAME" | grep export); then
echo "Cluster $CLUSTER_NAME not created or not ready."
exit 1
fi
eval "$exp"
echo -e "Deleting previous version of Gitlab if it exists"
kubectl delete --ignore-not-found=true svc,pvc,deployment -l app=gitlab
kubectl delete --ignore-not-found=true -f kubernetes/local-volumes.yaml
echo -e "Creating pods"
kubectl create -f kubernetes/local-volumes.yaml
kubectl create -f kubernetes/postgres.yaml
kubectl create -f kubernetes/redis.yaml
kubectl create -f kubernetes/gitlab.yaml
kubectl get svc gitlab
echo "" && echo "View your Gitlab website at http://$IP_ADDR:30080"
echo "Note: Your Gitlab may take up to 5 minutes to be fully functioning"