Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java11 support experiments #6

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM jenkins/jenkins:2.107.3
FROM jenkins/jenkins-experimental:blueocean-jdk11
MAINTAINER Oleg Nenashev <[email protected]>
LABEL Description="This demo shows how to setup Jenkins Config-as-Code with Docker, Pipeline, and Groovy Hook Scripts" Vendor="Oleg Nenashev" Version="0.2"

USER root

ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
COPY download-and-check-updates.sh /usr/local/bin/download-and-check-updates.sh
RUN /usr/local/bin/download-and-check-updates.sh < /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt

COPY init_scripts/src/main/groovy/ /usr/share/jenkins/ref/init.groovy.d/

Expand All @@ -29,4 +30,6 @@ VOLUME /var/jenkins_home/pipeline-libs
EXPOSE 5005

COPY jenkins2.sh /usr/local/bin/jenkins2.sh
ENV CASC_JENKINS_CONFIG=/var/jenkins_home/jenkins.yaml
COPY jenkins.yaml /var/jenkins_home/jenkins.yaml
ENTRYPOINT ["tini", "--", "/usr/local/bin/jenkins2.sh"]
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DOCKER_TAG=latest-jdk11

build:
docker build -t onenashev/demo-jenkins-config-as-code:${DOCKER_TAG} .

run:
docker run --rm --name ci-jenkins-io-dev -v maven-repo:/root/.m2 -v ${MY_PIPELINE_LIBRARY_DIR}:/var/jenkins_home/pipeline-library -v ${MY_OTHER_PIPELINE_LIBS_DIRS}:/var/jenkins_home/pipeline-libs -e DEV_HOST=${CURRENT_HOST} -p 8080:8080 -p 50000:50000 onenashev/demo-jenkins-config-as-code:${DOCKER_TAG}

debug:
docker run --rm --name ci-jenkins-io-dev -e DEBUG=true -p 5005:5005 -v maven-repo:/root/.m2 -v ${MY_PIPELINE_LIBRARY_DIR}:/var/jenkins_home/pipeline-library -v ${MY_OTHER_PIPELINE_LIBS_DIRS}:/var/jenkins_home/pipeline-libs -e DEV_HOST=${CURRENT_HOST} -p 8080:8080 -p 50000:50000 onenashev/demo-jenkins-config-as-code:${DOCKER_TAG}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ for high-speed builds with Maven repository caching.
For this purpose there is a custom Dockerfile in the `/agent` folder.

```shell
cd agent && docker build -t onenashev/demo-jenkins-maven-builder .
cd agent-jdk8 && docker build -t onenashev/demo-jenkins-maven-builder:jdk8 .
cd agent-jdk10 && docker build -t onenashev/demo-jenkins-maven-builder:jdk10 .
cd agent-jdk11 && docker build -t onenashev/demo-jenkins-maven-builder:jdk11 .
```

#### Master
Expand Down
14 changes: 14 additions & 0 deletions agent-jdk10/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
###
# Custom agent build:
# Image name: onenashev/demo-jenkins-maven-builder
###
FROM maven:3.5.3-jdk-10
MAINTAINER Oleg Nenashev <[email protected]>

LABEL Description="This is an agent image for the configuration-as-code demo" Vendor="Oleg Nenashev" Version="0.1"

#TODO: Consider moving image to the "jenkins" user instead of root
RUN mkdir /root/.jenkins
VOLUME /root/.jenkins
VOLUME /root/.m2
WORKDIR /root
14 changes: 14 additions & 0 deletions agent-jdk11/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
###
# Custom agent build:
# Image name: onenashev/demo-jenkins-maven-builder
###
FROM maven:3.5.3-jdk-11
MAINTAINER Oleg Nenashev <[email protected]>

LABEL Description="This is an agent image for the configuration-as-code demo" Vendor="Oleg Nenashev" Version="0.1"

#TODO: Consider moving image to the "jenkins" user instead of root
RUN mkdir /root/.jenkins
VOLUME /root/.jenkins
VOLUME /root/.m2
WORKDIR /root
2 changes: 1 addition & 1 deletion agent/Dockerfile → agent-jdk8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Custom agent build:
# Image name: onenashev/demo-jenkins-maven-builder
###
FROM maven:3.5.0-jdk-8
FROM maven:3.5.3-jdk-8
MAINTAINER Oleg Nenashev <[email protected]>

LABEL Description="This is an agent image for the configuration-as-code demo" Vendor="Oleg Nenashev" Version="0.1"
Expand Down
304 changes: 0 additions & 304 deletions download-and-check-updates.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
buildPlugin(platforms: ['linux'],
buildPlugin(platforms: ['linux', 'linux-jdk10'],
repo: 'https://github.com/jenkinsci/job-restrictions-plugin.git',
findbugs: [archive: true, unstableTotalAll: '0'])
Loading