Last active
July 3, 2022 12:04
-
-
Save dhgautam/634aa9f16559b40791a28953da6494d3 to your computer and use it in GitHub Desktop.
Jenkinsfile for demo app-pipeline
This file contains 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 | |
stages { | |
stage('Build') { | |
steps { | |
echo 'Build demo-app' | |
sh 'sh run_build_script.sh' | |
} | |
} | |
stage('Linux Tests') { | |
parallel { | |
stage('Linux Tests') { | |
steps { | |
echo 'Run Linux tests' | |
sh 'sh run_linux_tests.sh' | |
} | |
} | |
stage('Windows Tests') { | |
steps { | |
echo 'Run Windows tests' | |
} | |
} | |
} | |
} | |
stage('Deploy Staging') { | |
steps { | |
echo 'Deploy to staging environment' | |
input 'Ok to deploy to production?' | |
} | |
} | |
stage('Deploy Production') { | |
post { | |
always { | |
archiveArtifacts(artifacts: 'target/demoapp.jar', fingerprint: true) | |
} | |
failure { | |
emailext(subject: 'Demoapp build failure', to: 'ci-team@example.com', body: 'Build failure for demoapp Build ${env.JOB_NAME} ') | |
} | |
} | |
steps { | |
echo 'Deploy to Prod' | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prefer declarative way (over Groovy) to define the pipelines