Update .forgejo/workflows/CD.yml
This commit is contained in:
parent
7bca24ef86
commit
28e4391c85
1 changed files with 6 additions and 9 deletions
|
@ -6,7 +6,7 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
if: github.event.pull_request.merged == true
|
if: github.event.pull_request.merged == true
|
||||||
runs-on: docker
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
@ -85,13 +85,10 @@ jobs:
|
||||||
|
|
||||||
sleep 45 # Delay for 45 seconds before fetching logs
|
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')
|
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)
|
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 "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 "Content:"
|
||||||
echo "$(echo "$logs" | jq -r '.content')"
|
echo "$logs" | grep -oP '"content":\s*"\K[^"]+' | sed 's/\\n/\n/g'
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue