force: kill cache and enforce local-k3s-platform network routing
Some checks failed
Django Helm GitOps Deploy / build-and-deploy (push) Failing after 10s
Some checks failed
Django Helm GitOps Deploy / build-and-deploy (push) Failing after 10s
This commit is contained in:
parent
dd91ccafd7
commit
29af7ab7c0
1 changed files with 12 additions and 20 deletions
32
.github/workflows/deploy.yml
vendored
32
.github/workflows/deploy.yml
vendored
|
|
@ -13,8 +13,8 @@ jobs:
|
|||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# DER INSTALLATIONS-/AKTIVIERUNGSSCHRITT IST ENTFERNT!
|
||||
# Terraform steht durch das Runner-Volume sofort global bereit.
|
||||
# HINWEIS: Das Terraform-Binary wird über das globale Runner-Volume (:ro)
|
||||
# vollautomatisch und manipulationssicher nach /usr/local/bin/terraform injiziert.
|
||||
|
||||
- name: Trust Local Nginx Certificate Inside Container
|
||||
run: |
|
||||
|
|
@ -22,12 +22,13 @@ jobs:
|
|||
cp nginx_ssl/nginx.crt /usr/local/share/ca-certificates/nginx-sandbox.crt 2>/dev/null || echo "Nutze Workspace-Zertifikat"
|
||||
update-ca-certificates
|
||||
|
||||
# Nutzt dein Personal Access Token (PAT) für den schnellen Push über den Socket-Port
|
||||
- name: Log in to Local Registry
|
||||
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login localhost:3005 -u ${{ github.actor }} --password-stdin
|
||||
|
||||
# Baut das Django-Image und taggt es mit dem eindeutigen Git-SHA
|
||||
- name: Build Django Image
|
||||
run: |
|
||||
# Wir nutzen wieder localhost für den unkomplizierten Push über den Socket!
|
||||
docker build -t localhost:3005/${{ github.repository }}:${{ github.sha }} .
|
||||
docker build -t localhost:3005/${{ github.repository }}:latest .
|
||||
|
||||
|
|
@ -36,47 +37,38 @@ jobs:
|
|||
docker push localhost:3005/${{ github.repository }}:${{ github.sha }}
|
||||
docker push localhost:3005/${{ github.repository }}:latest
|
||||
|
||||
# Holt die echten K3s-Schlüssel aus dem automatischen Host-Synchronisations-Secret
|
||||
- name: Prepare Kubernetes Access
|
||||
run: |
|
||||
echo "${{ secrets.KUBECONFIG_DATA }}" > ./kind_kubeconfig
|
||||
chmod 600 ./kind_kubeconfig
|
||||
|
||||
# Führt direkt das installierte, performante Zentral-Binary aus
|
||||
- name: Terraform Deploy
|
||||
run: |
|
||||
# Führt direkt das installierte Zentral-Binary aus!
|
||||
terraform --version
|
||||
terraform init
|
||||
terraform apply -auto-approve -var="app_version=${{ github.sha }}"
|
||||
|
||||
# Überprüft das Deployment im internen Container-Netzwerk und folgt dem Django-Redirect (-L)
|
||||
- name: Verify App Health
|
||||
run: |
|
||||
echo "Warte 15 Sekunden auf die Django-Zertifikate und Migrationen..."
|
||||
echo "DEBUG: Sende Request an local-k3s-platform..."
|
||||
sleep 15
|
||||
|
||||
# -L folgt der automatischen Sprachweiterleitung (/en/) fehlerfrei ins Ziel!
|
||||
# Wir zielen auf die feste Gateway-IP 172.17.0.1 auf Port 8080 deines Host-Systems
|
||||
curl --fail -L --connect-timeout 5 -H "Host: boday-it.ch" http://172.17.0 || exit 1
|
||||
|
||||
curl --fail -L --connect-timeout 5 -H "Host: boday-it.ch" http://local-k3s-platform:80/ || exit 1
|
||||
echo "Erfolg: Die Boday-IT Django-Webseite läuft perfekt via Helm im GitOps-Standard!"
|
||||
|
||||
# DAS FINALE DEINES PRODUKTS: Generiert das anonyme JSON und pusht es mit dem cloudmon-Host-Header
|
||||
- name: Publish Map to cloudmon Dashboard
|
||||
run: |
|
||||
terraform show -json > plan.json
|
||||
|
||||
# EXAKT SO EINSETZEN (Achte auf den Port 8080 und die Slashes!):
|
||||
curl -X POST \
|
||||
-H "Authorization: Bearer boday-cloudmon-super-token-2026" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Host: cloudmon.local" \
|
||||
--data-binary @plan.json \
|
||||
"http://172.17.0{{ github.repository }}"
|
||||
"http://local-k3s-platform:80/api/v1/push/?repo=${{ github.repository }}"
|
||||
|
||||
echo "Infrastruktur-Map erfolgreich an cloudmon übermittelt!"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue