- Installed plugin Jenkins Job-DSL
git clone https://github.com/spy86/CI_CD
cd jenkins-casc
docker-compose build && docker-compose up -d
After a while, the jenkins image will be built and run. We can enter it using the address http://<IP-ADDRESS>:8089
, when jenkins starts up, an empty jenkins dashboard will appear.
-
The plugin that we will need to support Configuration as a Code is already installed when building the image, we can verify it in:
Manage Jenkins
->Manage Plugins
->Installed
. In filter field we need to type job dsl and installed plugin should be on the list -
We don't have a job that will allow us to create more jobs with Job DSL, so we need to create one.
NOTE: If we use Jenkins as a Code, we can define such a job in the main Jenkins configuration
-
Click
Dashboard
-
Click
New Item
-
Enter an item name Seed_job_and_view choose
Freestyle project
and click OK -
In Source Code Management change to
git
and add repository https://github.com/spy86/CI_CD and change branch tomain
. -
Enable
This project is parameterized
next add choice and string parameter which will be used in DSL. -
In Build click
Add build step
next choose Process Job DSLs and setup step as below: -
We leave the rest of the settings as default and click Save