How to Create Pipeline Job on Jenkins

Create new jobs/Items on Jenkins

  • First we need to install the Jenkins on system so click on link Here
  • Once Jenkins is installed on system.
  • Login to Jenkins server.
  • Provide username & password.

 

Fig 1

 

  • Click on Create a jobs option.

 

Fig 2

 

  • Provide item/job name.
  • Select Pipeline.
  • Click on Ok.

 

Fig. 3

 

  • Provide project description.

 

Fig. 4

 

  • Select Build triggers. Its automatically start a build when we make any changes on source code.

Fig. 5

 

  • Provide Pipeline script code.
  • Click Save.

 

Fig. 6

For example:

pipeline {
    agent { docker { image 'php' } }
    stages {
        stage('build') {
            steps {
                sh 'php --version'
            }
        }
    }
}

 

  • Click on Build Now.

 

Fig. 6

 

  • Check Build history.
  • #1 indicate, Build has been done.

 

Fig. 7

 

Leave a Reply

Your email address will not be published.