Skip to content

Commit 4abef4d

Browse files
committed
test(dir): add logs
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
1 parent 90a8079 commit 4abef4d

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

Taskfile.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,18 @@ tasks:
637637
638638
{{ .HELM_BIN }} dependency build {{ .HELM_CHART_PATH }}
639639
640+
echo "PRINT DIR CHART TEMPLATE"
641+
{{ .HELM_BIN }} template dir \
642+
{{ .HELM_CHART_PATH }} \
643+
-f {{ .HELM_VALUES_PATH }} \
644+
--debug
645+
646+
echo "PRINT APISERVER CHART TEMPLATE"
647+
{{ .HELM_BIN }} template apiserver \
648+
{{ .HELM_CHART_PATH }}/apiserver \
649+
-f "{{ .ROOT_DIR }}/install/charts/dir/apiserver/values.yaml" \
650+
--debug
651+
640652
{{ .HELM_BIN }} upgrade dir \
641653
{{ .HELM_CHART_PATH }} \
642654
-f {{ .HELM_VALUES_PATH }} \
@@ -663,9 +675,27 @@ tasks:
663675
--namespace {{ .HELM_NAMESPACE }} \
664676
--create-namespace \
665677
--install \
666-
--wait \
667-
--wait-for-jobs \
668-
--timeout "15m"
678+
--debug
679+
680+
NS='{{ .HELM_NAMESPACE }}'
681+
timeout_sec=900
682+
start=$(date +%s)
683+
while true; do
684+
{{ .KUBECTL_BIN }} logs deployment/dir-apiserver -n "$NS" --tail=15 2>/dev/null | sed 's/^/[apiserver] /'
685+
{{ .KUBECTL_BIN }} logs deployment/dir-reconciler -n "$NS" --tail=15 2>/dev/null | sed 's/^/[reconciler] /'
686+
now=$(date +%s)
687+
if [ $((now - start)) -ge $timeout_sec ]; then
688+
echo "Timeout waiting for deployments (15m)"
689+
exit 1
690+
fi
691+
apiserver=$({{ .KUBECTL_BIN }} get deployment dir-apiserver -n "$NS" -o jsonpath='{.status.conditions[?(@.type=="Available")].status}' 2>/dev/null)
692+
reconciler=$({{ .KUBECTL_BIN }} get deployment dir-reconciler -n "$NS" -o jsonpath='{.status.conditions[?(@.type=="Available")].status}' 2>/dev/null)
693+
if [ "$apiserver" = "True" ] && [ "$reconciler" = "True" ]; then
694+
echo "Deployments ready."
695+
exit 0
696+
fi
697+
sleep 1
698+
done
669699
670700
deploy:kubernetes:local:ghcr:
671701
aliases: [deploy:local:ghcr]

0 commit comments

Comments
 (0)