Skip to content

trigger_jenkins: fix typo for enterprise releases #2

trigger_jenkins: fix typo for enterprise releases

trigger_jenkins: fix typo for enterprise releases #2

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

Check failure on line 18 in .github/workflows/trigger_jenkins.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/trigger_jenkins.yaml

Invalid workflow file

You have an error in your yaml syntax on line 18
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