You've already forked devops-exercises
Modify the structure of README.md
Instead of having exercises in their own separate section, they are now part of the main topics sections. This should make the learning process easier to follow where users have both exercises and questions in the same place. In addition, added a couple of new questions & exercises and modified existing scripts accordingly.
This commit is contained in:
14
exercises/jenkins/remove_builds.md
Normal file
14
exercises/jenkins/remove_builds.md
Normal file
@@ -0,0 +1,14 @@
|
||||
### Jenkins - Remove Jobs
|
||||
|
||||
#### Objective
|
||||
|
||||
Learn how to write a Jenkins script that interacts with builds by removing builds older than X days.
|
||||
|
||||
#### Instructions
|
||||
|
||||
1. Pick up (or create) a job which has builds older than X days
|
||||
2. Write a script to remove only the builds that are older than X days
|
||||
|
||||
#### Hints
|
||||
|
||||
X can be anything. For example, remove builds that are older than 3 days. Just make sure that you don't simply remove all the builds (since that's different from the objective).
|
||||
10
exercises/jenkins/remove_jobs.md
Normal file
10
exercises/jenkins/remove_jobs.md
Normal file
@@ -0,0 +1,10 @@
|
||||
### Jenkins - Remove Jobs
|
||||
|
||||
#### Objective
|
||||
|
||||
Learn how to write a Jenkins script to remove Jenkins jobs
|
||||
|
||||
#### Instructions
|
||||
|
||||
1. Create three jobs called: test-job, test2-job and prod-job
|
||||
2. Write a script to remove all the jobs that include the string "test"
|
||||
@@ -1,4 +1,4 @@
|
||||
def jobs = Jenkins.instance.items.findAll { job -> job.name =~ /"REMOVE_ME"/ }
|
||||
def jobs = Jenkins.instance.items.findAll { job -> job.name =~ /"test"/ }
|
||||
|
||||
jobs.each { job ->
|
||||
println job.name
|
||||
Reference in New Issue
Block a user