fix(build): fix ansible trigger
Some checks failed
Build BAB Application Deployment Artifact / build (push) Has been cancelled
Some checks failed
Build BAB Application Deployment Artifact / build (push) Has been cancelled
This commit is contained in:
@@ -57,8 +57,14 @@ jobs:
|
||||
- name: Trigger Ansible Deploy Playbook
|
||||
if: steps.build.outputs.VERSION != ''
|
||||
run: |
|
||||
curl --fail-with-body -sS \
|
||||
response=$(curl -sS \
|
||||
-H "Authorization: Bearer ${{ secrets.WEBHOOK_SECRET }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"artifact_url":"${{ gitea.server_url }}/${{ gitea.repository }}/releases/download/v${{ steps.build.outputs.VERSION }}/release-${{ steps.build.outputs.VERSION }}.tar.gz"}' \
|
||||
"${{ vars.WEBHOOK_URL }}"
|
||||
-w "\n%{http_code}" \
|
||||
"${{ vars.WEBHOOK_URL }}")
|
||||
http_code=$(echo "$response" | tail -1)
|
||||
body=$(echo "$response" | head -n -1)
|
||||
echo "Response: $body"
|
||||
echo "HTTP status: $http_code"
|
||||
[ "$http_code" -ge 200 ] && [ "$http_code" -lt 300 ]
|
||||
|
||||
Reference in New Issue
Block a user