Step 5 - Riverside-Software/pugchallenge2019 GitHub Wiki

Jenkins pipeline

Jenkins Pipeline (or simply "Pipeline" with a capital "P") is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins.

A continuous delivery (CD) pipeline is an automated expression of your process for getting software from version control right through to your users and customers. Every change to your software (committed in source control) goes through a complex process on its way to being released. This process involves building the software in a reliable and repeatable manner, as well as progressing the built software (called a "build") through multiple stages of testing and deployment.

The definition of a Jenkins Pipeline is written into a text file (called a Jenkinsfile) which in turn can be committed to a project’s source control repository. This is the foundation of "Pipeline-as-code"; treating the CD pipeline a part of the application to be versioned and reviewed like any other code.

  • Create a new file Jenkinsfile (with a capital J) in the root directory of the application:

img/Step05Img01.png

  • Copy / paste this content:
pipeline {
  agent { label 'Node01' }  <=== Use the node matching your team number !!
  options {
    buildDiscarder(logRotator(numToKeepStr:'10'))
    timeout(time: 10, unit: 'MINUTES')
    skipDefaultCheckout()
  }
  stages {
    stage ('Build') {
      steps {
        checkout([$class: 'GitSCM', branches: scm.branches, extensions: scm.extensions + [$class: 'CleanCheckout'](/Riverside-Software/pugchallenge2019/wiki/$class:-'CleanCheckout'), userRemoteConfigs: scm.userRemoteConfigs])
        withEnv(["DLC=${tool name: 'OpenEdge-12.1', type: 'openedge'}", "JAVA_HOME=${tool name: 'JDK8', type: 'jdk'}"]) {
          bat "%DLC%\\ant\\bin\\ant -DDLC=%DLC% -lib %DLC%\\pct\\pct.jar init build dist"
        }
        archiveArtifacts artifacts: 'target/DataDigger.zip'
      }
    }
  }
}
  • Validate the syntax with this command line:
curl -X POST -u pugchallenge01:pugchallenge01 -F "jenkinsfile=<Jenkinsfile" https://emeapugchallenge.rssw.eu/pipeline-model-converter/validate

You should receive this message:

Jenkinsfile successfully validated.

πŸš€πŸš€πŸš€ Jump to Step 6 !!! πŸš€πŸš€πŸš€