From 28e4391c852eb5ecc80638c1ba260c2d008282bc Mon Sep 17 00:00:00 2001 From: mafyuh Date: Tue, 30 Jul 2024 20:37:04 -0400 Subject: [PATCH] Update .forgejo/workflows/CD.yml --- .forgejo/workflows/CD.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.forgejo/workflows/CD.yml b/.forgejo/workflows/CD.yml index cfebdd5..ebde206 100644 --- a/.forgejo/workflows/CD.yml +++ b/.forgejo/workflows/CD.yml @@ -6,7 +6,7 @@ on: jobs: deploy: if: github.event.pull_request.merged == true - runs-on: docker + runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 @@ -85,13 +85,10 @@ jobs: sleep 45 # Delay for 45 seconds before fetching logs - job_id=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" https://awx.mafyuh.xyz/api/v2/job_templates/13/jobs/?order_by=-id | jq -r '.results[0].id') - logs=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" https://awx.mafyuh.xyz/api/v2/jobs/$job_id/stdout/?format=json) + job_id=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" "https://awx.mafyuh.xyz/api/v2/job_templates/13/jobs/?order_by=-id" | grep -oP '"id":\s*\K[0-9]+') + logs=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" "https://awx.mafyuh.xyz/api/v2/jobs/$job_id/stdout/?format=json") + echo "AWX Job Logs for folder: $folder" - echo "Range:" - echo "Start: $(echo "$logs" | jq -r '.range.start')" - echo "End: $(echo "$logs" | jq -r '.range.end')" - echo "Absolute End: $(echo "$logs" | jq -r '.range.absolute_end')" echo "Content:" - echo "$(echo "$logs" | jq -r '.content')" - done + echo "$logs" | grep -oP '"content":\s*"\K[^"]+' | sed 's/\\n/\n/g' + done