Be sure you have the following plugins in Jenkins:
Check out our example files in Bitbucket.
For Jenkins pipeline projects see "How to Receive Jenkins Build Notifications in Stride"
STRIDE_TOKEN_GOES_HERE
and STRIDE_CONVERSATION_URL_GOES_HERE
with the access token and conversation URL you saved (see the previous section).
set +x -u curl -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer STRIDE_TOKEN_GOES_HERE' \ -d "{\"content\":[{\"attrs\":{\"collapsible\":true,\"context\":{\"icon\":{\"label\":\"Jenkins Build Server\",\"url\":\"https://jenkins.io/sites/default/files/jenkins_favicon.ico\"},\"text\":\"Jenkins Build Server - ${JOB_NAME} ${BUILD_DISPLAY_NAME} - BUILD STARTED\"},\"description\":{\"text\":\"Tag: ${BUILD_TAG} Commit:${GIT_COMMIT}\"},\"details\":[{\"lozenge\":{\"appearance\":\"inprogress\",\"text\":\"BUILD STARTED\"}},{\"lozenge\":{\"appearance\":\"inprogress\",\"text\":\"${BUILD_DISPLAY_NAME}\"},\"title\":\"Build Number\"}],\"link\":{\"url\":\"${RUN_DISPLAY_URL}\"},\"text\":\"${JOB_NAME} - BUILD STARTED\",\"title\":{\"text\":\"${JOB_NAME} - BUILD STARTED\",\"user\":{\"icon\":{\"url\":\"https://jenkins.io/sites/default/files/jenkins_favicon.ico\",\"label\":\"Build Started\"}}}},\"type\":\"applicationCard\"}],\"type\":\"doc\",\"version\":1}" \ --url STRIDE_CONVERSATION_URL_GOES_HERE
set +x -u curl -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer STRIDE_TOKEN_GOES_HERE' \ -d "{\"content\":[{\"attrs\":{\"collapsible\":true,\"context\":{\"icon\":{\"label\":\"Jenkins Build Server\",\"url\":\"https://jenkins.io/sites/default/files/jenkins_favicon.ico\"},\"text\":\"Jenkins Build Server - ${JOB_NAME} ${BUILD_DISPLAY_NAME} - BUILD SUCCEEDED\"},\"description\":{\"text\":\"Tag: ${BUILD_TAG} Commit:${GIT_COMMIT}\"},\"details\":[{\"lozenge\":{\"appearance\":\"success\",\"text\":\"BUILD SUCCEEDED\"}},{\"lozenge\":{\"appearance\":\"success\",\"text\":\"${BUILD_DISPLAY_NAME}\"},\"title\":\"Build Number\"}],\"link\":{\"url\":\"${RUN_DISPLAY_URL}\"},\"text\":\"${JOB_NAME} - BUILD SUCCEEDED\",\"title\":{\"text\":\"${JOB_NAME} - BUILD SUCCEEDED\",\"user\":{\"icon\":{\"url\":\"https://jenkins.io/sites/default/files/jenkins_favicon.ico\",\"label\":\"BUILD SUCCEEDED\"}}}},\"type\":\"applicationCard\"}],\"type\":\"doc\",\"version\":1}" \ --url STRIDE_CONVERSATION_URL_GOES_HERE
set +x -u
curl -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer STRIDE_TOKEN_GOES_HERE' \
-d "{\"content\":[{\"attrs\":{\"collapsible\":true,\"context\":{\"icon\":{\"label\":\"Jenkins Build Server\",\"url\":\"https://jenkins.io/sites/default/files/jenkins_favicon.ico\"},\"text\":\"Jenkins Build Server - ${JOB_NAME} ${BUILD_DISPLAY_NAME} - BUILD FAILED\"},\"description\":{\"text\":\"Tag: ${BUILD_TAG} Commit:${GIT_COMMIT}\"},\"details\":[{\"lozenge\":{\"appearance\":\"removed\",\"text\":\"BUILD FAILED\"}},{\"lozenge\":{\"appearance\":\"removed\",\"text\":\"${BUILD_DISPLAY_NAME}\"},\"title\":\"Build Number\"}],\"link\":{\"url\":\"${RUN_DISPLAY_URL}\"},\"text\":\"${JOB_NAME} - BUILD FAILED\",\"title\":{\"text\":\"${JOB_NAME} - BUILD FAILED\",\"user\":{\"icon\":{\"url\":\"https://jenkins.io/images/angry-jenkins_128.png\",\"label\":\"BUILD FAILED\"}}}},\"type\":\"applicationCard\"}],\"type\":\"doc\",\"version\":1}" \
--url STRIDE_CONVERSATION_URL_GOES_HERE
notify_stride.started.sh
and select itSUCCESS
in the list (Ctrl+click
on windows, Cmd+click
on Mac)notify_stride.faliure.sh
and select itSUCCESS
in the listnotify_stride.success.sh
and select it
???ℜ???
3 comments