Last active
April 26, 2020 03:34
-
-
Save marcosborges/96f3859c4f19db9b7c72270df7a645fe to your computer and use it in GitHub Desktop.
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
pipeline { | |
agent any | |
options { | |
preserveStashes(buildCount: 10) | |
buildDiscarder(logRotator(numToKeepStr:'10')) | |
} | |
stages { | |
stage('JMeter') { | |
steps { | |
build( job: './jmeter-job-freestyle', wait: true, parameters: [] ) | |
} | |
} | |
} | |
post { | |
success { | |
echo 'The Pipeline success :)' | |
sh """ Curl--request PUT \ | |
--url http://cachet/api/v1/components/15 \ | |
--header 'content-type: application/json' \ | |
--header 'x-cachet-token: XXXXXXXXXXXXXXXXXX ' \ | |
--data '{"status":1}' | |
""" | |
} | |
failure { | |
echo 'The Pipeline failed :(' | |
sh """ Curl--request PUT \ | |
--url http://cachet/api/v1/components/15 \ | |
--header 'content-type: application/json' \ | |
--header 'x-cachet-token: XXXXXXXXXXXXXXXXXX ' \ | |
--data '{"status":4}' | |
""" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment