Skip to content

Commit

Permalink
Dependabot/docker/master/jenkins/jenkins 2.267 (#64)
Browse files Browse the repository at this point in the history
* fix(deps): bump jenkins/jenkins from 2.263 to 2.267

Bumps jenkins/jenkins from 2.263 to 2.267.

Signed-off-by: dependabot-preview[bot] <[email protected]>

* update versions

* test arm

* remove git-lfs

* Fehlersuche

* Fehlersuche - next

* next test on rasp

* change to ubuntu

* fix

* add gpg

* copy from url

* run container with root

* use tini as package

* next steps and tests

* next steps and tests

* next steps and tests

* next steps and tests

* next steps and tests

* without entrypoint

* fix

* fix

* refactoring -> new jenkins version

* weniger output

* fix

* fix

* refactor Hookscripts

* refactor Hookscripts

* run local with x86_64-ubuntu

* refactoring

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
  • Loading branch information
WolverMinion and dependabot-preview[bot] authored Jan 24, 2021
1 parent 8002386 commit b5eed31
Show file tree
Hide file tree
Showing 26 changed files with 579 additions and 1,022 deletions.
66 changes: 49 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
FROM jenkins/jenkins:2.267
FROM adoptopenjdk/openjdk11:x86_64-ubuntu-jdk-11.0.9.1_1

ARG user=jenkins
ARG group=jenkins
ARG uid=1000
ARG gid=1000
ARG http_port=8080
ARG agent_port=50000
ARG JENKINS_HOME=/var/jenkins_home
ARG REF=/usr/share/jenkins/ref
ARG DEV_HOST=localhost
ARG CREATE_ADMIN=true
ARG GITHUB_API_TOKEN='default'
Expand All @@ -9,23 +17,37 @@ ARG LOCAL_PIPELINE_LIBRARY_PATH="${JENKINS_HOME}/pipeline-library"
ARG VERSION="0.1"
ARG JENKINS_CONFIG_REPO="https://github.com/Continuous-X/jenkins-cx-config-demo-project.git"
ARG JENKINS_CONFIG_CASC="master/jenkins.yaml"
ARG RUNTIME_USER="jenkins"
ARG RUNTIME_GROUP="jenkins"
ARG INFLUXDB_HOSTNAME="localhost"
ARG INFLUXDB_PORT="8086"
ARG TINI_VERSION="v0.19.0"
ARG JENKINS_VERSION="2.276"
ARG JENKINS_SHA=d3892390eda022bbee648f226d5b9b2806a11016d0bdf691200855361fe185a0
ARG PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION="2.5.0"

ENV CREATE_ADMIN="${CREATE_ADMIN}" \
GITHUB_API_TOKEN="${GITHUB_API_TOKEN}" \
INFLUXDB_HOSTNAME="${INFLUXDB_HOSTNAME}" \
INFLUXDB_PORT="${INFLUXDB_PORT}" \
ALLOW_RUNS_ON_MASTER="${ALLOW_RUNS_ON_MASTER}" \
CREATE_MAINSEED="${CREATE_MAINSEED}" \
ENV JENKINS_VERSION="${JENKINS_VERSION}" \
JENKINS_HOME="${JENKINS_HOME}" \
JENKINS_SLAVE_AGENT_PORT="${agent_port}" \
#JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war \
JENKINS_URL=https://updates.jenkins-ci.org/download/war/${JENKINS_VERSION}/jenkins.war \
JENKINS_UC="https://updates.jenkins.io" \
JENKINS_UC_EXPERIMENTAL="https://updates.jenkins.io/experimental" \
JENKINS_INCREMENTALS_REPO_MIRROR="https://repo.jenkins-ci.org/incrementals" \
JENKINS_CONFIG_REPO="${JENKINS_CONFIG_REPO}" \
JENKINS_CONFIG_CASC="${JENKINS_CONFIG_CASC}" \
REF="${REF}" \
CREATE_ADMIN="${CREATE_ADMIN}" \
ALLOW_RUNS_ON_MASTER="${ALLOW_RUNS_ON_MASTER}" \
CASC_JENKINS_CONFIG="${JENKINS_HOME}/casc_configs/jenkins.yaml" \
LOCAL_PIPELINE_LIBRARY_PATH="${LOCAL_PIPELINE_LIBRARY_PATH}" \
RUNTIME_USER="${RUNTIME_USER}" \
RUNTIME_GROUP="${RUNTIME_GROUP}"
CREATE_MAINSEED="${CREATE_MAINSEED}" \
PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION="${PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION}" \
PLUGIN_CLI_URL="https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION}/jenkins-plugin-manager-${PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION}.jar" \
GITHUB_API_TOKEN="${GITHUB_API_TOKEN}" \
INFLUXDB_HOSTNAME="${INFLUXDB_HOSTNAME}" \
INFLUXDB_PORT="${INFLUXDB_PORT}" \
RUNTIME_USER="${user}" \
RUNTIME_GROUP="${group}" \
COPY_REFERENCE_FILE_LOG="${JENKINS_HOME}/copy_reference_file.log"

LABEL maintainer="wolver.minion" \
Description="Setup Jenkins Config-as-Code with Docker, Pipeline, and Groovy Hook Scripts. thx Oleg" \
Expand All @@ -34,16 +56,26 @@ LABEL maintainer="wolver.minion" \

USER root

COPY master/install/apt-get.sh /install/apt-get.sh
COPY master/install/jenkins.sh /install/jenkins.sh
COPY master/install/tini.sh /install/tini.sh
COPY master/plugins.txt ${REF}/plugins.txt
COPY master/logging.properties ${REF}/logging.properties
COPY init_scripts/src/main/groovy/ ${REF}/init.groovy.d/
COPY master/jenkins-cx.sh /usr/local/bin/jenkins-cx.sh
COPY ${JENKINS_CONFIG_CASC} ${CASC_JENKINS_CONFIG}
ADD ${JENKINS_CONFIG_CASC} ${CASC_JENKINS_CONFIG}

RUN /install/apt-get.sh \
&& /install/tini.sh tini \
&& /install/jenkins.sh

VOLUME ${JENKINS_HOME}

RUN apk add --no-cache --update openssl && \
rm -rf /var/cache/apk/*
RUN /usr/local/bin/install-plugins.sh < ${REF}/plugins.txt; \
mkdir -p ${LOCAL_PIPELINE_LIBRARY_PATH}
# for main web interface:
EXPOSE ${http_port}
# will be used by attached slave agents:
EXPOSE ${agent_port}

USER ${RUNTIME_USER}

ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins-cx.sh"]
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins-cx.sh"]
49 changes: 0 additions & 49 deletions Dockerfile-alpine.dockerfile

This file was deleted.

81 changes: 81 additions & 0 deletions Dockerfile-arm.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
FROM adoptopenjdk/openjdk11:armv7l-ubuntu-jdk-11.0.8_10-slim

ARG user=jenkins
ARG group=jenkins
ARG uid=1000
ARG gid=1000
ARG http_port=8080
ARG agent_port=50000
ARG JENKINS_HOME=/var/jenkins_home
ARG REF=/usr/share/jenkins/ref
ARG DEV_HOST=localhost
ARG CREATE_ADMIN=true
ARG GITHUB_API_TOKEN='default'
ARG CREATE_MAINSEED=true
ARG ALLOW_RUNS_ON_MASTER=false
ARG LOCAL_PIPELINE_LIBRARY_PATH="${JENKINS_HOME}/pipeline-library"
ARG VERSION="0.1"
ARG JENKINS_CONFIG_REPO="https://github.com/Continuous-X/jenkins-cx-config-demo-project.git"
ARG JENKINS_CONFIG_CASC="master/jenkins.yaml"
ARG INFLUXDB_HOSTNAME="localhost"
ARG INFLUXDB_PORT="8086"
ARG TINI_VERSION="v0.19.0"
ARG JENKINS_VERSION="2.276"
ARG JENKINS_SHA=d3892390eda022bbee648f226d5b9b2806a11016d0bdf691200855361fe185a0
ARG PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION="2.5.0"

ENV JENKINS_VERSION="${JENKINS_VERSION}" \
JENKINS_HOME="${JENKINS_HOME}" \
JENKINS_SLAVE_AGENT_PORT="${agent_port}" \
#JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war \
JENKINS_URL=https://updates.jenkins-ci.org/download/war/${JENKINS_VERSION}/jenkins.war \
JENKINS_UC="https://updates.jenkins.io" \
JENKINS_UC_EXPERIMENTAL="https://updates.jenkins.io/experimental" \
JENKINS_INCREMENTALS_REPO_MIRROR="https://repo.jenkins-ci.org/incrementals" \
JENKINS_CONFIG_REPO="${JENKINS_CONFIG_REPO}" \
JENKINS_CONFIG_CASC="${JENKINS_CONFIG_CASC}" \
REF="${REF}" \
CREATE_ADMIN="${CREATE_ADMIN}" \
ALLOW_RUNS_ON_MASTER="${ALLOW_RUNS_ON_MASTER}" \
CASC_JENKINS_CONFIG="${JENKINS_HOME}/casc_configs/jenkins.yaml" \
LOCAL_PIPELINE_LIBRARY_PATH="${LOCAL_PIPELINE_LIBRARY_PATH}" \
CREATE_MAINSEED="${CREATE_MAINSEED}" \
PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION="${PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION}" \
PLUGIN_CLI_URL="https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION}/jenkins-plugin-manager-${PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION}.jar" \
GITHUB_API_TOKEN="${GITHUB_API_TOKEN}" \
INFLUXDB_HOSTNAME="${INFLUXDB_HOSTNAME}" \
INFLUXDB_PORT="${INFLUXDB_PORT}" \
RUNTIME_USER="${user}" \
RUNTIME_GROUP="${group}" \
COPY_REFERENCE_FILE_LOG="${JENKINS_HOME}/copy_reference_file.log"

LABEL maintainer="wolver.minion" \
Description="Setup Jenkins Config-as-Code with Docker, Pipeline, and Groovy Hook Scripts. thx Oleg" \
Vendor="Wolver" \
Version="${VERSION}"

USER root

COPY master/install/apt-get.sh /install/apt-get.sh
COPY master/install/jenkins.sh /install/jenkins.sh
COPY master/install/tini.sh /install/tini.sh
COPY master/plugins.txt ${REF}/plugins.txt
COPY master/logging.properties ${REF}/logging.properties
COPY init_scripts/src/main/groovy/ ${REF}/init.groovy.d/
COPY master/jenkins-cx.sh /usr/local/bin/jenkins-cx.sh
ADD ${JENKINS_CONFIG_CASC} ${CASC_JENKINS_CONFIG}

RUN /install/apt-get.sh \
&& /install/tini.sh tini \
&& /install/jenkins.sh

VOLUME ${JENKINS_HOME}

# for main web interface:
EXPOSE ${http_port}
# will be used by attached slave agents:
EXPOSE ${agent_port}

USER ${RUNTIME_USER}

ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins-cx.sh"]
81 changes: 81 additions & 0 deletions Dockerfile-x86_64-ubuntu-slim.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
FROM adoptopenjdk/openjdk11:x86_64-ubuntu-jdk-11.0.9.1_1-slim

ARG user=jenkins
ARG group=jenkins
ARG uid=1000
ARG gid=1000
ARG http_port=8080
ARG agent_port=50000
ARG JENKINS_HOME=/var/jenkins_home
ARG REF=/usr/share/jenkins/ref
ARG DEV_HOST=localhost
ARG CREATE_ADMIN=true
ARG GITHUB_API_TOKEN='default'
ARG CREATE_MAINSEED=true
ARG ALLOW_RUNS_ON_MASTER=false
ARG LOCAL_PIPELINE_LIBRARY_PATH="${JENKINS_HOME}/pipeline-library"
ARG VERSION="0.1"
ARG JENKINS_CONFIG_REPO="https://github.com/Continuous-X/jenkins-cx-config-demo-project.git"
ARG JENKINS_CONFIG_CASC="master/jenkins.yaml"
ARG INFLUXDB_HOSTNAME="localhost"
ARG INFLUXDB_PORT="8086"
ARG TINI_VERSION="v0.19.0"
ARG JENKINS_VERSION="2.276"
ARG JENKINS_SHA=d3892390eda022bbee648f226d5b9b2806a11016d0bdf691200855361fe185a0
ARG PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION="2.5.0"

ENV JENKINS_VERSION="${JENKINS_VERSION}" \
JENKINS_HOME="${JENKINS_HOME}" \
JENKINS_SLAVE_AGENT_PORT="${agent_port}" \
#JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war \
JENKINS_URL=https://updates.jenkins-ci.org/download/war/${JENKINS_VERSION}/jenkins.war \
JENKINS_UC="https://updates.jenkins.io" \
JENKINS_UC_EXPERIMENTAL="https://updates.jenkins.io/experimental" \
JENKINS_INCREMENTALS_REPO_MIRROR="https://repo.jenkins-ci.org/incrementals" \
JENKINS_CONFIG_REPO="${JENKINS_CONFIG_REPO}" \
JENKINS_CONFIG_CASC="${JENKINS_CONFIG_CASC}" \
REF="${REF}" \
CREATE_ADMIN="${CREATE_ADMIN}" \
ALLOW_RUNS_ON_MASTER="${ALLOW_RUNS_ON_MASTER}" \
CASC_JENKINS_CONFIG="${JENKINS_HOME}/casc_configs/jenkins.yaml" \
LOCAL_PIPELINE_LIBRARY_PATH="${LOCAL_PIPELINE_LIBRARY_PATH}" \
CREATE_MAINSEED="${CREATE_MAINSEED}" \
PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION="${PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION}" \
PLUGIN_CLI_URL="https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION}/jenkins-plugin-manager-${PLUGIN_INSTALLATION_MANAGER_TOOL_VERSION}.jar" \
GITHUB_API_TOKEN="${GITHUB_API_TOKEN}" \
INFLUXDB_HOSTNAME="${INFLUXDB_HOSTNAME}" \
INFLUXDB_PORT="${INFLUXDB_PORT}" \
RUNTIME_USER="${user}" \
RUNTIME_GROUP="${group}" \
COPY_REFERENCE_FILE_LOG="${JENKINS_HOME}/copy_reference_file.log"

LABEL maintainer="wolver.minion" \
Description="Setup Jenkins Config-as-Code with Docker, Pipeline, and Groovy Hook Scripts. thx Oleg" \
Vendor="Wolver" \
Version="${VERSION}"

USER root

COPY master/install/apt-get.sh /install/apt-get.sh
COPY master/install/jenkins.sh /install/jenkins.sh
COPY master/install/tini.sh /install/tini.sh
COPY master/plugins.txt ${REF}/plugins.txt
COPY master/logging.properties ${REF}/logging.properties
COPY init_scripts/src/main/groovy/ ${REF}/init.groovy.d/
COPY master/jenkins-cx.sh /usr/local/bin/jenkins-cx.sh
ADD ${JENKINS_CONFIG_CASC} ${CASC_JENKINS_CONFIG}

RUN /install/apt-get.sh \
&& /install/tini.sh tini \
&& /install/jenkins.sh

VOLUME ${JENKINS_HOME}

# for main web interface:
EXPOSE ${http_port}
# will be used by attached slave agents:
EXPOSE ${agent_port}

USER ${RUNTIME_USER}

ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins-cx.sh"]
1 change: 1 addition & 0 deletions init_scripts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>authorize-project</artifactId>
<version>1.3.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package scripts

import com.continuousx.jenkins.image.hook.HookScriptHelper
import jenkins.model.Jenkins
import jenkins.model.JenkinsLocationConfiguration

HookScriptHelper.printHookStart(this)
println """
###############################
# boot - ${this.getClass().getName()} (start) #
###############################
"""

def jenkins = Jenkins.getInstanceOrNull()
assert jenkins != null : "Jenkins instance is null"
Expand All @@ -16,11 +17,14 @@ if (!jenkins.isQuietingDown()){

if (host == null) {
host = "localhost"
} else {
JenkinsLocationConfiguration.get().setUrl("http://${host}:8080")
}
JenkinsLocationConfiguration.get().setUrl("http://${host}:8080")
} else {
println '*** Shutdown mode enabled. Configure Jenkins is SKIPPED!'
}

HookScriptHelper.printHookEnd(this)
println """
###############################
# boot - ${this.getClass().getName()} (end) #
###############################
"""
Loading

0 comments on commit b5eed31

Please sign in to comment.