diff --git a/ci/tests/test-local-url.sh b/ci/tests/test-local-url.sh index 603fc4e..0415c8a 100755 --- a/ci/tests/test-local-url.sh +++ b/ci/tests/test-local-url.sh @@ -3,16 +3,94 @@ set -e -o pipefail echo "Test local urls" +curl_args="--connect-timeout 30 --retry 300 --retry-delay 5" -echo "# https://whoami.127.0.0.1.nip.io" -curl -Lsv https://whoami.127.0.0.1.nip.io 2>&1 |grep "^Hostname" - -echo "# https://grafana.127.0.0.1.nip.io" -curl -Lsv https://grafana.127.0.0.1.nip.io 2>&1 |grep "Grafana" +timeout=180 +test_result=1 echo "# https://prometheus.127.0.0.1.nip.io" -curl -Lsv https://prometheus.127.0.0.1.nip.io 2>&1 |grep "Prometheus Time Series Collection and Processing Server" +until [ "$timeout" -le 0 -o "$test_result" -eq "0" ] ; do + ( curl -Lsv https://prometheus.127.0.0.1.nip.io 2>&1 |grep "Prometheus Time Series Collection and Processing Server" ) + test_result=$? + if [ "$test_result" -gt 0 ] ;then + echo "Retry $timeout seconds: $test_result"; + (( timeout-- )) + sleep 1 + fi +done +if [ "$test_result" -gt 0 ] ;then + test_status=ERROR + echo "$test_status: curl result: $test_result" + exit $test_result +fi + +timeout=180 +test_result=1 echo "# https://alertmanager.127.0.0.1.nip.io" -curl -Lsv https://alertmanager.127.0.0.1.nip.io 2>&1 |grep "Alertmanager" +until [ "$timeout" -le 0 -o "$test_result" -eq "0" ] ; do + ( curl -Lsv https://alertmanager.127.0.0.1.nip.io 2>&1 |grep "Alertmanager" ) + test_result=$? + if [ "$test_result" -gt 0 ] ;then + echo "Retry $timeout seconds: $test_result"; + (( timeout-- )) + sleep 1 + fi +done +if [ "$test_result" -gt 0 ] ;then + test_status=ERROR + echo "$test_status: curl result: $test_result" + exit $test_result +fi +timeout=180 +test_result=1 +echo "# https://grafana.127.0.0.1.nip.io" +until [ "$timeout" -le 0 -o "$test_result" -eq "0" ] ; do + ( curl -Lsv https://grafana.127.0.0.1.nip.io 2>&1 |grep "Grafana" ) + test_result=$? + if [ "$test_result" -gt 0 ] ;then + echo "Retry $timeout seconds: $test_result"; + (( timeout-- )) + sleep 1 + fi +done +if [ "$test_result" -gt 0 ] ;then + test_status=ERROR + echo "$test_status: curl result: $test_result" + exit $test_result +fi + +timeout=180 +test_result=1 echo "# https://argocd.127.0.0.1.nip.io" -curl -Lsv https://argocd.127.0.0.1.nip.io 2>&1 |grep "Argo CD" +until [ "$timeout" -le 0 -o "$test_result" -eq "0" ] ; do + ( curl $curl_args -Lsv https://argocd.127.0.0.1.nip.io 2>&1 |grep "Argo CD" ) + test_result=$? + if [ "$test_result" -gt 0 ] ;then + echo "Retry $timeout seconds: $test_result"; + (( timeout-- )) + sleep 1 + fi +done +if [ "$test_result" -gt 0 ] ;then + test_status=ERROR + echo "$test_status: curl result: $test_result" + exit $test_result +fi + +timeout=180 +test_result=1 +echo "# https://whoami.127.0.0.1.nip.io" +until [ "$timeout" -le 0 -o "$test_result" -eq "0" ] ; do + ( curl -Lsv https://whoami.127.0.0.1.nip.io 2>&1 |grep "^Hostname" ) + test_result=$? + if [ "$test_result" -gt 0 ] ;then + echo "Retry $timeout seconds: $test_result"; + (( timeout-- )) + sleep 1 + fi +done +if [ "$test_result" -gt 0 ] ;then + test_status=ERROR + echo "$test_status: curl result: $test_result" + exit $test_result +fi diff --git a/helmfile.d/releases/01-core/argocd-values.yaml.gotmpl b/helmfile.d/releases/01-core/argocd-values.yaml.gotmpl new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/helmfile.d/releases/01-core/argocd-values.yaml.gotmpl @@ -0,0 +1 @@ +--- diff --git a/helmfile.d/releases/01-core/env/README.md b/helmfile.d/releases/01-core/env/README.md index b0a8a65..840595d 100644 --- a/helmfile.d/releases/01-core/env/README.md +++ b/helmfile.d/releases/01-core/env/README.md @@ -1 +1,4 @@ # override values per environment-release + +env/${ENV}/${RELEASE}-values.yaml +env/${ENV}/${RELEASE}-values.yaml.gotmpl diff --git a/helmfile.d/releases/01-core/env/local-argocd-values.yaml.gotmpl b/helmfile.d/releases/01-core/env/local/argocd-values.yaml.gotmpl similarity index 100% rename from helmfile.d/releases/01-core/env/local-argocd-values.yaml.gotmpl rename to helmfile.d/releases/01-core/env/local/argocd-values.yaml.gotmpl diff --git a/helmfile.d/releases/01-core/env/local-cert-manager-issuers-values.yaml.gotmpl b/helmfile.d/releases/01-core/env/local/cert-manager-issuers-values.yaml.gotmpl similarity index 100% rename from helmfile.d/releases/01-core/env/local-cert-manager-issuers-values.yaml.gotmpl rename to helmfile.d/releases/01-core/env/local/cert-manager-issuers-values.yaml.gotmpl diff --git a/helmfile.d/releases/01-core/env/local-ingress-nginx-values.yaml.gotmpl b/helmfile.d/releases/01-core/env/local/ingress-nginx-values.yaml.gotmpl similarity index 100% rename from helmfile.d/releases/01-core/env/local-ingress-nginx-values.yaml.gotmpl rename to helmfile.d/releases/01-core/env/local/ingress-nginx-values.yaml.gotmpl diff --git a/helmfile.d/releases/01-core/helmfile.yaml b/helmfile.d/releases/01-core/helmfile.yaml index e19c43b..15a6612 100644 --- a/helmfile.d/releases/01-core/helmfile.yaml +++ b/helmfile.d/releases/01-core/helmfile.yaml @@ -30,7 +30,7 @@ releases: installed: {{ .Values.ingress_nginx.installed }} values: - ingress-nginx-values.yaml.gotmpl - - "env/{{ .Environment.Name }}-ingress-nginx-values.yaml.gotmpl" + - "env/{{ .Environment.Name }}/ingress-nginx-values.yaml.gotmpl" # # ingress-nginx-admin for private apps # @@ -54,7 +54,7 @@ releases: - "{{ .Values.cert_manager.ingress_namespace }}/{{ .Values.cert_manager.ingress_name }}" values: - cert-manager-values.yaml.gotmpl - - "env/{{ .Environment.Name }}-cert-manager-values.yaml.gotmpl" + - "env/{{ .Environment.Name }}/cert-manager-values.yaml.gotmpl" - name: cert-manager-issuers chart: ../../../charts/cert-manager-issuers @@ -67,8 +67,7 @@ releases: - "{{ .Values.cert_manager.namespace }}/cert-manager" values: - cert-manager-issuers-values.yaml.gotmpl - - "env/{{ .Environment.Name }}-cert-manager-issuers-values.yaml.gotmpl" - + - "env/{{ .Environment.Name }}/cert-manager-issuers-values.yaml.gotmpl" - name: loki chart: grafana/loki @@ -122,6 +121,6 @@ releases: - "{{ .Values.cert_manager.namespace }}/cert-manager" values: - argocd-values.yaml.gotmpl - - "env/{{ .Environment.Name }}-argocd-values.yaml.gotmpl" + - "env/{{ .Environment.Name }}/argocd-values.yaml.gotmpl" secrets: - "../../../secrets/env/{{ .Environment.Name }}/argocd-secrets.yaml.enc"