test push #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Trigger Jenkins Job | |
| on: | |
| push: | |
| branches: | |
| - remove-jenkinsfile | |
| # paths: | |
| # - superstream-clients/pom.xml | |
| jobs: | |
| trigger-jenkins: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Trigger Jenkins Job | |
| env: | |
| JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }} | |
| run: | | |
| HTTP_STATUS=$(curl -w "%{http_code}" -o /tmp/jenkins_response.txt -f -X POST \ | |
| "https://jenkins.superstream.ai/job/DevOps/jobi/Superstream/job/SDK/job/superstream-clients-java/buildWithParameters?DEPLOYMENT_TYPE=production" \ | |
| --user "[email protected]:$JENKINS_TOKEN") | |
| if [ $? -ne 0 ] || [ "$HTTP_STATUS" -ne 201 ] && [ "$HTTP_STATUS" -ne 200 ]; then | |
| echo "Jenkins trigger failed with HTTP status: $HTTP_STATUS" | |
| cat /tmp/jenkins_response.txt | |
| exit 1 | |
| fi | |
| echo "Successfully triggered Jenkins build (HTTP $HTTP_STATUS)" |