diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 6082e5d..6e9b8d4 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -18,22 +18,27 @@ jobs: run: make build - name: Analisi Valgrind e Sandbox - # Usiamo 'tee' per vedere i log sia su Gitea che nel file run: | + # Usiamo 'tee' per vedere i log sia su Gitea che nel file valgrind --leak-check=full --log-file=v_report.txt ./lab_app 2>&1 | tee output.log || true - name: Spedizione Report a n8n if: always() + continue-on-error: true # Se n8n non risponde, il job Gitea risulterà comunque VERDE se il codice è OK run: | echo "--- LOG PROGRAMMA ---" > final.txt cat output.log >> final.txt echo -e "\n\n--- ANALISI MEMORIA VALGRIND ---" >> final.txt cat v_report.txt >> final.txt - # Creiamo un file JSON temporaneo per evitare errori di caratteri speciali JOBS_LOG=$(cat final.txt | base64 -w 0) echo "{\"log\":\"$JOBS_LOG\"}" > payload.json - curl -X POST -H "Content-Type: application/json" \ + # TENTATIVO 1: URL Pubblico (DuckDNS) + # TENTATIVO 2: IP Locale del Docker Bridge (se il primo fallisce) + curl -sS -X POST -H "Content-Type: application/json" \ -d @payload.json \ - https://n8n.thepunisher-lab.duckdns.org/webhook/punisher-logs \ No newline at end of file + https://n8n.thepunisher-lab.duckdns.org/webhook/punisher-logs || \ + curl -sS -X POST -H "Content-Type: application/json" \ + -d @payload.json \ + http://172.17.0.1:5678/webhook/punisher-logs \ No newline at end of file