Skip to content

Instantly share code, notes, and snippets.

@marcosborges
Last active April 26, 2020 03:34
Show Gist options
  • Save marcosborges/96f3859c4f19db9b7c72270df7a645fe to your computer and use it in GitHub Desktop.
Save marcosborges/96f3859c4f19db9b7c72270df7a645fe to your computer and use it in GitHub Desktop.
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