Search code examples
jenkinsgroovyjenkins-blueocean

Setup Jenkins Blue Ocean plugin via groovy script


I'm playing with the Blue Ocean plugin and my goal is create a Jenkins installation from the scratch fully configured with a job linked to a Github repository, all that done in an set of init scripts written in Groovy. I have all the information needed beforehand to configure the pipeline:

  • Github Token
  • Github Orgs
  • Github Repository (contains a Jenkinsfile on the root directory)

I already found some pieces but the full picture is not complete/working. Here is where the magic seems to start validateAndCreate.

My setup is:

  • Jenkins 2.121.2
  • Blue Ocean 1.7.2

Am I in the right path? Can someone shed light here?


Solution

  • After few days trying here is the final solution https://github.com/tmoreira2020/jenkins-blue-ocean, it meets my requirement completely.