November 2017
Intermediate to advanced
388 pages
8h 46m
English
Jenkins pipeline supports two syntaxes, one is declarative and another is scripted. In this chapter, we will be following declarative syntax, because it's easy to understand. The following is the sample of Jenkinsfile, which covers basic stages such as Build, Test, and Deploy:
pipeline { // agent indicates that Jenkins should allocate an executor and workspace for this part of the Pipeline agent any stages { //describing stage of the Pipeline stage('Build') { //describes the steps to be run in this stage. steps { //executes the given shell command sh 'make' } } stage('Test') { steps { sh 'make check' junit 'reports/**/*.xml' } } stage('Deploy') { steps { echo 'Deploying....' } } } }
Read now
Unlock full access