Skip to content

Commit

Permalink
Adding jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Apr 5, 2024
1 parent cc10681 commit 280ed97
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 0 deletions.
12 changes: 12 additions & 0 deletions jenkins/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM jenkins/jenkins:2.440.2-jdk17
USER root
RUN apt-get update && apt-get install -y lsb-release
RUN curl -fsSLo /usr/share/keyrings/docker-archive-keyring.asc \
https://download.docker.com/linux/debian/gpg
RUN echo "deb [arch=$(dpkg --print-architecture) \
signed-by=/usr/share/keyrings/docker-archive-keyring.asc] \
https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
RUN apt-get update && apt-get install -y docker-ce-cli
USER jenkins
RUN jenkins-plugin-cli --plugins "blueocean docker-workflow"
41 changes: 41 additions & 0 deletions jenkins/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: '3.1'
networks:
docker:
volumes:
jenkins-data:
jenkins-docker-certs:
services:
jenkins:
image: jenkinsci/blueocean
restart: always
networks:
- docker
ports:
- 8080:8080
- 50000:50000
tty: true
volumes:
- jenkins-data:/var/jenkins_home
- jenkins-docker-certs:/certs/client:ro
- $HOME:/home
environment:
- DOCKER_HOST=tcp:https://docker:2376
- DOCKER_CERT_PATH=/certs/client
- DOCKER_TLS_VERIFY=1
dind:
image: docker:dind
privileged: true
restart: always
networks:
docker:
aliases:
- docker
ports:
- 2376:2376
tty: true
volumes:
- jenkins-data:/var/jenkins_home
- jenkins-docker-certs:/certs/client
- $HOME:/home
environment:
- DOCKER_TLS_CERTDIR=/certs
17 changes: 17 additions & 0 deletions jenkins/prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -e

docker network create jenkins

docker run \
--name jenkins-docker \
--rm \
--detach \
--privileged \
--network jenkins \
--network-alias docker \
--env DOCKER_TLS_CERTDIR=/certs \
--volume jenkins-docker-certs:/certs/client \
--volume jenkins-data:/var/jenkins_home \
--publish 2376:2376 \
docker:dind \
--storage-driver overlay2
15 changes: 15 additions & 0 deletions jenkins/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

docker run \
--name jenkins-blueocean \(1)
--restart=on-failure \(2)
--detach \(3)
--network jenkins \(4)
--env DOCKER_HOST=tcp:https://docker:2376 \(5)
--env DOCKER_CERT_PATH=/certs/client \
--env DOCKER_TLS_VERIFY=1 \
--publish 8080:8080 \(6)
--publish 50000:50000 \(7)
--volume jenkins-data:/var/jenkins_home \(8)
--volume jenkins-docker-certs:/certs/client:ro \(9)
myjenkins-blueocean:2.440.2-1 (10)

3 changes: 3 additions & 0 deletions parent.pom
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<enableAssertions>true</enableAssertions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down

0 comments on commit 280ed97

Please sign in to comment.