Chapter 10: Jenkins Introduction
10.12 Lab — Jenkins in Docker + Pipeline job
Lab
Run Jenkins and execute a Pipeline for badge API tests.
- Start Jenkins LTS with a named volume; complete unlock + admin user.
- Confirm UI loads on your published host counter (local laptop preferred).
- Add a
Jenkinsfileto your badge API repo with at leastCheckoutandTeststages (pytestornpm test). - Create a Pipeline job → Pipeline script from SCM pointing at that repo.
- Run a build; save a note of Console Output lines from a green Test stage.
- Intentionally break a test, push, rebuild — confirm the stage goes red and the log shows the assertion.
- Fix the test; rebuild green.
- When done:
docker stop jenkins(and remove if you want); keep or deletejenkins_homevolume intentionally.
Practice task
Write a short table (five rows) mapping your Chapter 9 Actions workflow pieces to Jenkinsfile equivalents (on, job, run, secrets, SHA tag build).
Thodkyaat sangaycha tar
- Jenkins remains common in enterprises; learn controller/agent and Pipeline-as-code.
- Prefer Declarative
Jenkinsfilein Git over only Freestyle clicks. - Credentials store holds secrets — not the repo.
- Same CI stages as Actions; different YAML/Groovy syntax and hosting model.
- Harden lab Jenkins (auth, SG, no open UI); stop idle containers.
- Debug with Console Output the same way you read Actions logs.
Samajla ka? Nasel tar lab (10.12) green→red→green Test stage prove kara – Jenkinsfile Git madhe. Aata pudhe jaauya Ansible intro kade.