@@ -22,14 +22,15 @@ jobs:
2222 - name : trigger orca pipeline
2323 id : trigger
2424 run : |
25- response=$(curl -X POST \
26- -F "token=${{ secrets.ORCA_TRIGGER_TOKEN }}" \
27- -F "ref=main" \
28- -F "variables[TRIGGERED_BY]=github" \
29- -F "variables[GITHUB_REPO]=${{ github.repository }}" \
30- -F "variables[GITHUB_SHA]=${{ github.sha }}" \
31- -F "variables[GITHUB_RUN_ID]=${{ github.run_id }}" \
32- -F "variables[REF_COATJAVA]=${{ github.head_ref || github.ref_name }}" \
25+ response=$(curl \
26+ --request POST \
27+ --form "token=${{ secrets.ORCA_TRIGGER_TOKEN }}" \
28+ --form "ref=main" \
29+ --form "variables[TRIGGERED_BY]=github" \
30+ --form "variables[GITHUB_REPO]=${{ github.repository }}" \
31+ --form "variables[GITHUB_SHA]=${{ github.sha }}" \
32+ --form "variables[GITHUB_RUN_ID]=${{ github.run_id }}" \
33+ --form "variables[REF_COATJAVA]=${{ github.head_ref || github.ref_name }}" \
3334 "https://code.jlab.org/api/v4/projects/${{ secrets.ORCA_PROJECT_ID }}/trigger/pipeline")
3435 echo "RESPONSE: $response"
3536 pipeline_id=$(echo $response | jq -r '.id')
4546 echo "Pipeline URL: <$web_url>" >> $GITHUB_STEP_SUMMARY
4647 - name : wait for orca pipeline
4748 env :
48- GITLAB_TOKEN : ${{ secrets.ORCA_READ_TOKEN }}
4949 PIPELINE_ID : ${{ steps.trigger.outputs.pipeline_id }}
5050 PIPELINE_URL : ${{ steps.trigger.outputs.web_url }}
5151 TIMEOUT : 3600
5454 elapsed=0
5555 sleep_interval=60
5656 while [ $elapsed -lt $TIMEOUT ]; do
57- status=$(curl -s -H "PRIVATE-TOKEN: $GITLAB_TOKEN" \
58- "https://gitlab.com/api/v4/projects/${{ secrets.ORCA_PROJECT_ID }}/pipelines/$PIPELINE_ID" \
59- | jq -r '.status')
57+ response=$(curl \
58+ --silent \
59+ --show-error \
60+ --fail \
61+ --header "PRIVATE-TOKEN: ${{ secrets.ORCA_READ_TOKEN }}" \
62+ "https://gitlab.com/api/v4/projects/${{ secrets.ORCA_PROJECT_ID }}/pipelines/$PIPELINE_ID")
63+ status=$(echo $response | jq -r '.status')
6064 echo "Current status: $status (elapsed: ${elapsed}s)"
6165 case $status in
6266 "success")
0 commit comments