Jenkins Pipelines contd..
- Jenkins Job Build Triggers:
- Scripted Pipeline:
- Use the properties section to create a build trigger
- In the below example we will be using build periodically for every 1 Hour from Monday to Friday Refer Here
- In the below example we will be using build periodically for every 1 Hour from Monday to Friday Refer Here
- In scripted for pollSCM
properties(pollSCM('* * * * 1-5'))
- Use the properties section to create a build trigger
- Declarative Pipeline
- For basic Declarative Pipeline Refer Here
- Lets add build periodically just like the scripted pipeline Refer Here
- For Poll scm
pipeline { agent { label 'HRMS&&QA' } triggers { pollSCM('* * * * 1-5') } stages { stage('git'){ steps { git branch: 'DeclarativePipeline', url: 'https://github.com/dummyrepos/game-of-life.git' } } stage('compile') { steps { sh 'mvn clean package' } } } }
- If you want to ask for user input while the job is execution we have step called as input Refer Here
- Scripted Pipeline:
- Parameters:
- Refer Here
- Refer Here for the changes made in the scripts
- Sleep & WaitUntil:
- Sleep add delay to execution Refer Here
- waitUntil something happens Refer Here