Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save satishgadhave/18df95ec799a7ef28a63c6c6c333e8f1 to your computer and use it in GitHub Desktop.
Save satishgadhave/18df95ec799a7ef28a63c6c6c333e8f1 to your computer and use it in GitHub Desktop.
This a test groovy code to create Jenkins pipeline
pipeline {
agent any
triggers {
cron('5 0 * * *')
}
stages {
stage('Process Price Feed') {
steps {
timeout(time: 10, unit: 'MINUTES') {
retry(3) {
echo 'Running shell commands to process feed'
// ... commands
}
}
}
}
stage('Update cache storage') {
steps {
retry(3) {
echo 'Running shell commands update cache'
// ... commands
}
}
}
stage('Calculate discounts') {
steps {
timeout(time:15, unit: 'MINUTES') {
retry(3) {
echo 'Running jenkins job to calculate discounts'
// ... commands
}
}
}
}
stage('Assign discounted products to SALE category') {
steps {
retry(3) {
echo 'Running jenkins job to assign products to SALE category'
// ... commands
}
}
}
}
post {
always {
// send email notification
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment