diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 580c6a6..6082e5d 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -18,20 +18,22 @@ jobs: run: make build - name: Analisi Valgrind e Sandbox - # Eseguiamo il codice e Valgrind salva tutto in v_report.txt + # Usiamo 'tee' per vedere i log sia su Gitea che nel file run: | - valgrind --leak-check=full --log-file=v_report.txt ./lab_app > output.log 2>&1 || true + valgrind --leak-check=full --log-file=v_report.txt ./lab_app 2>&1 | tee output.log || true - name: Spedizione Report a n8n - if: always() # Spedisce anche se il programma crasha + if: always() run: | - # Creiamo il file di report unico 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 - # Codifica Base64 e invio all'URL di produzione + # 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" \ - -d "{\"log\":\"$(cat final.txt | base64 -w 0)\"}" \ + -d @payload.json \ https://n8n.thepunisher-lab.duckdns.org/webhook/punisher-logs \ No newline at end of file