Skip to content

Instantly share code, notes, and snippets.

@dhgautam
Last active July 3, 2022 12:04
Show Gist options
  • Select an option

  • Save dhgautam/634aa9f16559b40791a28953da6494d3 to your computer and use it in GitHub Desktop.

Select an option

Save dhgautam/634aa9f16559b40791a28953da6494d3 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'
}
}
}
}
@aleon1220

Copy link
Copy Markdown

It seems a bit painful to use Groovy to define the pipelines.

@quangthe

Copy link
Copy Markdown

Prefer declarative way (over Groovy) to define the pipelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment