Skip to content

Commit

Permalink
Env dir (#5)
Browse files Browse the repository at this point in the history
* env directory

* fix
  • Loading branch information
pli01 authored Mar 10, 2024
1 parent d952f5e commit 9d99ce3
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 13 deletions.
94 changes: 86 additions & 8 deletions ci/tests/test-local-url.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<title>Grafana</title>"
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 "<title>Prometheus Time Series Collection and Processing Server</title>"
until [ "$timeout" -le 0 -o "$test_result" -eq "0" ] ; do
( curl -Lsv https://prometheus.127.0.0.1.nip.io 2>&1 |grep "<title>Prometheus Time Series Collection and Processing Server</title>" )
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 "<title>Alertmanager</title>"
until [ "$timeout" -le 0 -o "$test_result" -eq "0" ] ; do
( curl -Lsv https://alertmanager.127.0.0.1.nip.io 2>&1 |grep "<title>Alertmanager</title>" )
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 "<title>Grafana</title>" )
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 "<title>Argo CD</title>"
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 "<title>Argo CD</title>" )
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
1 change: 1 addition & 0 deletions helmfile.d/releases/01-core/argocd-values.yaml.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
3 changes: 3 additions & 0 deletions helmfile.d/releases/01-core/env/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# override values per environment-release

env/${ENV}/${RELEASE}-values.yaml
env/${ENV}/${RELEASE}-values.yaml.gotmpl
9 changes: 4 additions & 5 deletions helmfile.d/releases/01-core/helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"

0 comments on commit 9d99ce3

Please sign in to comment.