Created
April 22, 2019 12:26
-
-
Save KondaReddyR/d2494534fd95a62427113acd508117de to your computer and use it in GitHub Desktop.
Groovy Script to create Pipeline jobs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jenkins.model.Jenkins | |
import org.jenkinsci.plugins.workflow.job.WorkflowJob | |
import org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition | |
import hudson.plugins.git.GitSCM | |
WorkflowJob job = Jenkins.instance.createProject(WorkflowJob, 'KondaReddyR/java-project') | |
def definition = new CpsScmFlowDefinition(new GitSCM('[email protected]:KondaReddyR/java-project.git'), 'resources/housekeeping/install_python_packages.groovy') | |
definition.scm.userRemoteConfigs[0].credentialsId = 'GITHUB_SSH_KEY' | |
job.definition = definition |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment