trigger_jenkins: fix typo for enterprise releases #2
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: | ||
| - next** | ||
| jobs: | ||
| trigger-jenkins: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Determine Jenkins Job Name | ||
| run: | | ||
| if [[ "${{ github.ref_name }}" == "next" ]]; then | ||
| echo "JOB_NAME=scylla-master/job/next-machine-image" >> $GITHUB_ENV | ||
| else | ||
| VERSION=$(echo "${{ github.ref_name }}" | awk -F'-' '{print $2}') | ||
| <<<<<<< HEAD | ||
| echo "JOB_NAME=scylla-${VERSION}/job/next-machine-image" >> $GITHUB_ENV | ||
| ||||||| parent of b24a75b (trigger_jenkins: fix typo for enterprise releases) | ||
| if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+$ ]]; then | ||
| FOLDER_NAME="scylla-$VERSION" | ||
| elif [[ "$VERSION" =~ ^202[0-4]\.[0-9]+$ ]]; then | ||
| VERSION="enterprise-$VERSION" | ||
| fi | ||
| ======= | ||
| if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+$ ]]; then | ||
| FOLDER_NAME="scylla-$VERSION" | ||
| elif [[ "$VERSION" =~ ^202[0-4]\.[0-9]+$ ]]; then | ||
| FOLDER_NAME="enterprise-$VERSION" | ||
| fi | ||
| >>>>>>> b24a75b (trigger_jenkins: fix typo for enterprise releases) | ||
| fi | ||
| - name: Trigger Jenkins Job | ||
| env: | ||
| JENKINS_USER: ${{ secrets.JENKINS_USERNAME }} | ||
| JENKINS_API_TOKEN: ${{ secrets.JENKINS_TOKEN }} | ||
| JENKINS_URL: "https://jenkins.scylladb.com" | ||
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
| run: | | ||
| echo "Triggering Jenkins Job: $JOB_NAME" | ||
| if ! curl -X POST "$JENKINS_URL/job/$JOB_NAME/buildWithParameters" --fail --user "$JENKINS_USER:$JENKINS_API_TOKEN" -i -v; then | ||
| echo "Error: Jenkins job trigger failed" | ||
| # Send Slack message | ||
| curl -X POST -H 'Content-type: application/json' \ | ||
| -H "Authorization: Bearer $SLACK_BOT_TOKEN" \ | ||
| --data '{ | ||
| "channel": "#jenkins-notifications", | ||
| "text": "🚨 Jenkins job *'$JOB_NAME'* failed!", | ||
| "icon_emoji": ":warning:" | ||
| }' \ | ||
| https://slack.com/api/chat.postMessage | ||
| exit 1 | ||
| fi | ||