Configure jenkins pipeline job

Configure bitbucket pipeline job using jenkins config as code

In one of my previous posts, I have discussed configuring multibranch pipeline seed jobs using Jenkins configuration as code plugin

This is an example of configuring a declarative pipeline job from bitbucket repo, running at midnight every day

- script: >
    pipelineJob('sample-job') {
      definition {
          cpsScm {
            scriptPath 'job1/Jenkinsfile' ## If jenkins job is in a nested folder
            scm {
              git {
                  remote {
                    url 'https://github.com/Vikaspogu/sample-repo'
                    credentials 'sample-creds'
                  }
                  branch '*/master'
                  extensions {}
              }
            }
            triggers {
              cron('@midnight')
            }
          }
      }
    }    
Built with Hugo
Theme Stack designed by Jimmy