Skip to content

Instantly share code, notes, and snippets.

@unixnut
Forked from dhgautam/Jenkinsfile
Created September 4, 2020 17:45
Show Gist options
  • Save unixnut/de500a60739f6ba05179e94b0841c64d to your computer and use it in GitHub Desktop.
Save unixnut/de500a60739f6ba05179e94b0841c64d to your computer and use it in GitHub Desktop.
Jenkinsfile for demo app-pipeline
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