Skip to content

Commit

Permalink
fix: gitlab script cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
omri2001 committed Dec 1, 2024
1 parent 48a770a commit 955313d
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions scripts/init-gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,8 @@ if [ -z "$(helm list -n gitlab | grep gitlab)" ]; then
helm repo add gitlab https://charts.gitlab.io/
helm upgrade --install gitlab -n gitlab gitlab/gitlab -f gitlab.values.yaml

timeout 5m bash -c '
while true; do
# Get the pod status using kubectl
POD_STATUS=$(kubectl get pods -n gitlab -l app=webservice -o jsonpath='{.items[0].status.phase}')
# Check if the pod is in 'Running' state
if [ "${POD_STATUS}" = "Running" ]; then
echo "Pod is ready, continuing with next steps..."
sleep 10
break # Exit the loop
else
echo "Pod is not ready yet. Current status: $POD_STATUS"
sleep 5 # Wait for 5 seconds before checking again
fi
done
'

GITLAB_TOOLBOX_POD=$(kubectl get pods --namespace gitlab -l app=toolbox -o name | sed 's|pod/||')
kubectl wait --namespace gitlab --for=condition=ready pod -l app=toolbox --timeout=360s
GITLAB_TOOLBOX_POD=$(kubectl get pods --namespace gitlab -l app=toolbox -o name)
TOKENS_OUTPUT=$(kubectl exec -it -c toolbox ${GITLAB_TOOLBOX_POD} -n gitlab -- gitlab-rails runner /tmp/scripts/piper-setup.rb)
echo $TOKENS_OUTPUT
else
Expand Down

0 comments on commit 955313d

Please sign in to comment.