DevOps Classroom Series – 30/Sept/2020

Jenkins 2 Pipelines

  • Jenkins supported the Domain Specific Language (DSL) based on groovy.

  • This DSL is core feature of Jenkins 2

  • Lets look at Jenkins freestyle project and ask the following questions

    • How to track the changes done in Jenkins build configuration?
      • Search for suitable plugin => Jobconfighistory plugin
    • How to use the Jenkins Build configuration created in One Jenkins Master to be used in Some Other Jenkins Server?
      • Search for a suitable Plugin => Import/Export Jenkins Jobs
    • Build steps might change with changes in development project, So how can we handle this?
      • Change manually on the UI for all the jobs created.
    • How to handle changes in build steps for each branch in version controlled?
      • Create different jobs
  • Jenkinsfile:

    • This file represents the pipeline definition.
    • This file can be version controlled
  • Lets create a pipeline job in jenkins Preview Preview Preview Preview Preview Preview

  • This can create a pipeline project. But lets see the actual pipeline project in action

  • Now fork a gameoflife into your account. Clone the code into your folder and create a Jenkinsfile with the content as present over here

  • Now lets create a Jenkins job Preview Preview Preview

  • Now Lets build Preview Preview Preview Preview

  • In this way of creating jenkins projects, build steps are taken away from jenkins and they are version controlled and present near to the code.

    • When the build steps are changed, Developers can edit the build configuration as part of commit.
    • Branch wise build configurations are easier to handle.
  • Pipleines in Jenkins Preview

  • Project Types in Jenkins (Apart from free style) Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin