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
- How to track the changes done in Jenkins build configuration?
-
Jenkinsfile:
- This file represents the pipeline definition.
- This file can be version controlled
-
Lets create a pipeline job in jenkins

-
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

-
Now Lets build

-
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

-
Project Types in Jenkins (Apart from free style)

