This commit is contained in:
parent
b196ee833a
commit
6930700625
1 changed files with 8 additions and 23 deletions
31
.github/workflows/docker-publish.yml
vendored
31
.github/workflows/docker-publish.yml
vendored
|
|
@ -57,12 +57,18 @@ jobs:
|
|||
chmod 600 ./kind_kubeconfig
|
||||
|
||||
# Erster Rollout kann bis 15 Min dauern (Wine + MT5 Installation nach /config)
|
||||
# init mit Retry, weil der DNS-Resolver sporadisch "server misbehaving" liefert
|
||||
- name: Terraform Deploy
|
||||
env:
|
||||
TF_VAR_vnc_password: ${{ secrets.MT5_VNC_PASSWORD }}
|
||||
run: |
|
||||
terraform --version
|
||||
terraform init
|
||||
for i in 1 2 3; do
|
||||
terraform init && break
|
||||
if [ "$i" = "3" ]; then echo "terraform init nach 3 Versuchen fehlgeschlagen"; exit 1; fi
|
||||
echo "init fehlgeschlagen, Versuch $i – neuer Anlauf in 10s"
|
||||
sleep 10
|
||||
done
|
||||
terraform apply -auto-approve \
|
||||
-var="image_repository=${IMAGE}" \
|
||||
-var="app_version=${{ github.sha }}" \
|
||||
|
|
@ -90,27 +96,6 @@ jobs:
|
|||
echo "MT5 Web-UI nach 10 Minuten nicht erreichbar"
|
||||
exit 1
|
||||
|
||||
# Sensible Werte (VNC-Passwort) vor dem Upload aus dem State-JSON entfernen
|
||||
- name: Publish Map to cloudmon Dashboard
|
||||
run: |
|
||||
terraform show -json \
|
||||
| jq 'del(.. | .set_sensitive?) | del(.. | .metadata? | select(type == "array") | .[]?.values?)' \
|
||||
> plan.json
|
||||
|
||||
if grep -q "${{ secrets.MT5_VNC_PASSWORD }}" plan.json; then
|
||||
echo "Abbruch: Passwort ist noch im JSON enthalten"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl --fail -X POST \
|
||||
-H "Authorization: Bearer ${{ secrets.CLOUDMON_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Host: cloudmon.local" \
|
||||
--data-binary @plan.json \
|
||||
"http://local-k3s-platform:80/api/v1/push/?repo=${{ github.repository }}"
|
||||
|
||||
echo "Infrastruktur-Map erfolgreich an cloudmon übermittelt!"
|
||||
|
||||
- name: Cleanup Kubeconfig
|
||||
if: always()
|
||||
run: rm -f ./kind_kubeconfig plan.json
|
||||
run: rm -f ./kind_kubeconfig
|
||||
|
|
|
|||
Loading…
Reference in a new issue