Retry -s
This commit is contained in:
parent
54cb49dd8a
commit
2658991dd7
1 changed files with 6 additions and 25 deletions
31
.github/workflows/api-deploy-nonprod.yml
vendored
31
.github/workflows/api-deploy-nonprod.yml
vendored
|
|
@ -102,31 +102,12 @@ jobs:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger TeamCity Build
|
- name: Deploy to Team City
|
||||||
id: trigger
|
|
||||||
run: |
|
run: |
|
||||||
echo "Triggering TeamCity build..."
|
curl -s -u ${{ secrets.TEAMCITY_USERNAME }}:${{ secrets.TEAMCITY_PASSWORD }} \
|
||||||
|
-X POST \
|
||||||
# Trigger build and get the build ID
|
-H "Content-Type: application/json" \
|
||||||
BUILD_ID=$(curl -s -u "$TEAMCITY_USER:$TEAMCITY_TOKEN" \
|
-d '{"buildType": {"id": "${{ secrets.TEAMCITY_API_ID }}"}}' \
|
||||||
-X POST \
|
"${{ secrets.TEAMCITY_URL }}/httpAuth/app/rest/buildQueue?fields=build(state)"
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "{\"buildType\": {\"id\": \"$TEAMCITY_BUILD_ID\"}}" \
|
|
||||||
"$TEAMCITY_URL/httpAuth/app/rest/buildQueue" \
|
|
||||||
| grep -oP 'id="\K[0-9]+')
|
|
||||||
|
|
||||||
echo "Build queued with ID: $BUILD_ID"
|
|
||||||
|
|
||||||
# Query only the build state
|
|
||||||
BUILD_STATE=$(curl -s -u "$TEAMCITY_USER:$TEAMCITY_TOKEN" \
|
|
||||||
"$TEAMCITY_URL/httpAuth/app/rest/buildQueue/id:$BUILD_ID?fields=build(state)" \
|
|
||||||
| grep -oP 'state="\K[^"]+')
|
|
||||||
|
|
||||||
echo "Build state: $BUILD_STATE"
|
|
||||||
|
|
||||||
# Set GitHub Actions output
|
|
||||||
echo "build_state=$BUILD_STATE" >> $GITHUB_OUTPUT
|
|
||||||
- name: Show Build State
|
|
||||||
run: echo "TeamCity build is ${{ steps.trigger.outputs.build_state }}"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue