0
votes

I have automated Jenkins master and slaves deployment and redeployment successfully.

I know how to manually create pipeline jobs and add github repos to use their Jenkinsfiles for the steps.

my issue is how can I automate the pipeline jobs addition to jenkins after its been destroyed and redeployed without having to manually create the pipeline jobs and point to Jenkinsfile each time.

I have seen this done before in a container environment with chef and docker when redeployed or updated it re-adds all the pipelines automatically again.

I want to not use the UI at all only to confirm job status progress and verify settings.

1
Likely the container was binding the volume mount for the jobs, so that when the container was re-created, the jobs were never destroyed, but rather "discovered". - Matt Schuchard

1 Answers

1
votes

I would recommend looking at the JobDSL Plugin to create jobs, using a seed job to create them on initial Jenkins startup. The Jenkins Configuration-as-Code plugin can be used to setup any other configuration outside the jobs.