-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Jenkins controller setup lab (#21)
- Loading branch information
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Jenkins setup lab | ||
|
||
## 1. Labs stack | ||
|
||
- 1 Jenkins controller | ||
- 1 Jenkins agent | ||
|
||
## 2. Setup | ||
|
||
### Prerequisites | ||
|
||
- Docker + Docker Compose | ||
|
||
### Build and run the containers | ||
|
||
```bash | ||
cd labs/jenkins-setup | ||
docker-compose up --build -d | ||
|
||
# To stop and remove contaienr, run: | ||
docker compose down | ||
``` | ||
|
||
## 3. Explore the Jenkins | ||
|
||
- Visit http://localhost:8080/ to explore and use Jenkins | ||
- Get the init password to login (Login admin/initialAdminPassword): | ||
|
||
```bash | ||
docker exec jenkins-controller cat /var/jenkins_home/secrets/initialAdminPassword | ||
|
||
# 1d86cf0e5fe14608970274adb54ec3ac | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: '3.8' | ||
|
||
services: | ||
jenkins-controller: | ||
build: | ||
context: ../../pools/jenkins/jenkins-controller | ||
container_name: jenkins-controller | ||
ports: | ||
- '8080:8080' | ||
- '50000:50000' | ||
volumes: | ||
- jenkins_data:/var/jenkins_home | ||
networks: | ||
- jenkins-network | ||
|
||
volumes: | ||
jenkins_data: | ||
|
||
networks: | ||
jenkins-network: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM jenkins/jenkins:lts | ||
|
||
# Install plugins | ||
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt | ||
RUN jenkins-plugin-cli --plugin-file /usr/share/jenkins/ref/plugins.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
git:5.2.2 | ||
blueocean:1.27.14 |