File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Trigger Jenkins Job
2+
3+ on :
4+ push :
5+ branches :
6+ - latest
7+ paths :
8+ - pyproject.toml
9+
10+ jobs :
11+ trigger-jenkins :
12+ runs-on : self-hosted
13+
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v3
17+
18+ - name : Trigger Jenkins Job
19+ env :
20+ JENKINS_TOKEN : ${{ secrets.JENKINS_TOKEN }}
21+ run : |
22+ HTTP_STATUS=$(curl -w "%{http_code}" -o /tmp/jenkins_response.txt -f -X POST \
23+ "https://jenkins.superstream.ai/job/DevOps/job/Superstream/job/SDK/job/superstream-clients-python/buildWithParameters?DEPLOYMENT_TYPE=production" \
24+ --user "[email protected] :$JENKINS_TOKEN") 25+
26+ if [ $? -ne 0 ] || [ "$HTTP_STATUS" -ne 201 ] && [ "$HTTP_STATUS" -ne 200 ]; then
27+ echo "Jenkins trigger failed with HTTP status: $HTTP_STATUS"
28+ cat /tmp/jenkins_response.txt
29+ exit 1
30+ fi
31+
32+ echo "Successfully triggered Jenkins build (HTTP $HTTP_STATUS)"
You can’t perform that action at this time.
0 commit comments