Skip to content

Commit b4ba130

Browse files
committed
JKNS-637: Remove deprecated references
- Remove CentOS references - Remove OpenShift V3 references - Use UBI base image for local development Dockerfile Signed-off-by: Vinu Kochukuttan <vkochuku@redhat.com> Signed-off-by: Vinu K <kevy.vinu@gmail.com>
1 parent 54ac219 commit b4ba130

25 files changed

+92
-528
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
2/Dockerfile.localdev.version
2+
2/Dockerfile.rhel8.version
3+
2/Dockerfile.rhel9.version
24
agent-maven-3.5/Dockerfile.rhel7.version
35
agent-maven-3.5/Dockerfile.localdev.version
46
slave-base/Dockerfile.localdev.version
57
slave-base/Dockerfile.rhel7.version
68
slave-base/Dockerfile.rhel8.version
9+
slave-base/Dockerfile.rhel9.version
710
out
811
logs
912
kubeconfig

2/Dockerfile.localdev

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
##############################################
22
# Stage 1 : Build go-init
33
##############################################
4-
FROM openshift/origin-release:golang-1.12 AS go-init-builder
4+
FROM registry.access.redhat.com/ubi9/go-toolset:1.21 AS go-init-builder
55
ARG jenkins_version=latest
66
WORKDIR /go/src/github.com/openshift/jenkins
77
COPY . .
88
WORKDIR /go/src/github.com/openshift/jenkins/go-init
9-
RUN go build . && cp go-init /usr/bin
9+
RUN GO111MODULE=off go build -o /usr/bin/go-init .
1010

1111
##############################################
1212
# Stage 2 : Build slave-base with go-init
1313
##############################################
14-
FROM quay.io/openshift/origin-cli:4.16
14+
FROM registry.access.redhat.com/ubi9:latest
1515
ARG jenkins_version=latest
16-
MAINTAINER Akram Ben Aissi <abenaiss@redhat.com>
1716
COPY --from=go-init-builder /usr/bin/go-init /usr/bin/go-init
1817
# Jenkins image for OpenShift
1918
#
2019
# This image provides a Jenkins server, primarily intended for integration with
21-
# OpenShift v3.
20+
# OpenShift v4.
2221
#
2322
# Volumes:
2423
# * /var/jenkins_home
@@ -31,31 +30,29 @@ ENV JENKINS_VERSION=2 \
3130
HOME=/var/lib/jenkins \
3231
JENKINS_HOME=/var/lib/jenkins \
3332
JENKINS_UC=https://updates.jenkins.io \
34-
OPENSHIFT_JENKINS_IMAGE_VERSION=4.10 \
33+
OPENSHIFT_JENKINS_IMAGE_VERSION=4.17 \
3534
LANG=en_US.UTF-8 \
3635
LC_ALL=en_US.UTF-8 \
3736
INSTALL_JENKINS_VIA_RPMS=false
3837

39-
LABEL k8s.io.description="Jenkins is a continuous integration server" \
40-
k8s.io.display-name="Jenkins 2" \
41-
openshift.io.expose-services="8080:http" \
42-
openshift.io.tags="jenkins,jenkins2,ci" \
38+
LABEL io.k8s.description="Jenkins is a continuous integration server" \
39+
io.k8s.display-name="Jenkins 2" \
40+
maintainer="Prashant Dhamdhere <prdhamdh@redhat.com>, Vinu Kochukuttan <vkochuku@redhat.com>" \
41+
io.openshift.expose-services="8080:http" \
42+
io.openshift.tags="jenkins,jenkins2,ci" \
4343
io.jenkins.version="${jenkins_version}" \
44-
io.openshift.s2i.scripts-url=image:///usr/libexec/s2i
44+
io.openshift.s2i.scripts-url="image:///usr/libexec/s2i"
4545

4646
# 8080 for main web interface, 50000 for slave agents
4747
EXPOSE 8080 50000
4848

49-
RUN rm /etc/yum.repos.d/*
50-
COPY contrib/openshift/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo
51-
RUN curl http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-Official -o /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS && \
52-
INSTALL_PKGS="dejavu-sans-fonts rsync gettext git git-lfs tar zip unzip openssl bzip2 java-21-openjdk java-21-openjdk-devel java-17-openjdk java-17-openjdk-devel jq xmlstarlet" && \
53-
DISABLES="" && \
54-
yum $DISABLES -y --setopt=tsflags=nodocs --disableplugin=subscription-manager install epel-release && \
55-
yum $DISABLES -y --setopt=tsflags=nodocs --disableplugin=subscription-manager install $INSTALL_PKGS && \
56-
yum update --excludepkgs redhat-release -y && \
49+
RUN INSTALL_PKGS="dejavu-sans-fonts wget rsync gettext git git-lfs tar zip unzip openssl bzip2 java-21-openjdk java-21-openjdk-devel java-17-openjdk java-17-openjdk-devel jq glibc-locale-source xmlstarlet glibc-langpack-en" && \
50+
yum install -y $INSTALL_PKGS && \
51+
yum update -y && \
5752
rpm -V $INSTALL_PKGS && \
5853
yum clean all && \
54+
curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz | tar zxf - -C /usr/bin/ oc \
55+
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
5956
alternatives --set java $(alternatives --display java | grep 'family java-21-openjdk' | cut -d ' ' -f 1) && \
6057
alternatives --set javac $(alternatives --display javac | grep 'family java-21-openjdk' | cut -d ' ' -f 1) && \
6158
alternatives --family $(alternatives --display java | grep 'family java-21-openjdk' | cut -d ' ' -f 4) --install /usr/bin/jar jar $(alternatives --display java | grep 'family java-21-openjdk' | cut -d' ' -f1 | sed 's,/[^/]*$,/jar,') 1 && \
@@ -67,7 +64,7 @@ ADD ./contrib/s2i /usr/libexec/s2i
6764
ADD release.version /tmp/release.version
6865

6966
RUN /usr/local/bin/install-jenkins-core-plugins.sh /opt/openshift/bundle-plugins.txt && \
70-
rmdir /var/log/jenkins && \
67+
rm -rf /var/log/jenkins && \
7168
chmod -R 775 /etc/alternatives && \
7269
chmod -R 775 /var/lib/alternatives && \
7370
chmod -R 775 /usr/lib/jvm && \
@@ -81,6 +78,7 @@ RUN /usr/local/bin/install-jenkins-core-plugins.sh /opt/openshift/bundle-plugins
8178
/usr/local/bin/fix-permissions /var/lib/jenkins && \
8279
/usr/local/bin/fix-permissions /var/log
8380

81+
8482
VOLUME ["/var/lib/jenkins"]
8583

8684
USER 1001

2/cccp.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

2/contrib/jenkins/install-jenkins-core-plugins.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ if [[ "${INSTALL_JENKINS_VIA_RPMS}" == false ]]; then
1818
echo "jenkins.war already exists, skipping upstream RPM installation"
1919
else
2020
echo "Installing jenkins.war from upstream RPM"
21-
curl https://pkg.jenkins.io/redhat-stable/jenkins.repo -o /etc/yum.repos.art/ci/jenkins.repo
21+
mkdir -p /etc/yum.repos.art/ci
22+
curl https://pkg.jenkins.io/redhat-stable/jenkins.repo -o - | tee /etc/yum.repos.d/jenkins.repo /etc/yum.repos.art/ci/jenkins.repo
2223
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins-ci.org.key
2324
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
2425
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key

2/contrib/jenkins/install-plugins.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Usage:
77
#
8-
# FROM openshift/jenkins-2-centos7
8+
# FROM registry.redhat.io/ocp-tools-4/jenkins-rhel9:v4.17.0
99
# COPY plugins.txt /plugins.txt
1010
# RUN /usr/local/bin/install-plugins.sh /plugins.txt
1111
#

2/contrib/openshift/CentOS-Base.repo

Lines changed: 0 additions & 38 deletions
This file was deleted.

2/test/jenkins_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var _ = BeforeSuite(func() {
3333

3434
imageName = os.Getenv("IMAGE_NAME")
3535
if imageName == "" {
36-
imageName = "openshift/jenkins-2-centos7-candidate"
36+
imageName = "openshift/jenkins-2-rhel9-candidate"
3737
}
3838
})
3939

ADVANCED_USAGE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A quick recipe of how to do that via layering would be:
1212
* create a Dockerfile with (adjusting the image ref as you see fit)
1313

1414
```
15-
FROM registry.access.redhat.com/ocp-tools-4/jenkins-rhel8:latest
15+
FROM registry.redhat.io/ocp-tools-4/jenkins-rhel9:v4.17.0
1616
COPY ./contrib/openshift /opt/openshift
1717
```
1818

@@ -23,13 +23,13 @@ the existing run script your new image inherits from this repositories Jenkins i
2323
Usage
2424
---------------------------------
2525

26-
For this, we will assume that you are using an `quay.io/openshift/origin-jenkins` for v4.x.
26+
For this, we will assume that you are using an `registry.redhat.io/ocp-tools-4/jenkins-rhel9` for v4.x.
2727

2828
If you want to set only the mandatory environment variables and store the database
2929
in the `/tmp/jenkins` directory on the host filesystem, execute the following command:
3030

3131
```
32-
$ docker run -d -e JENKINS_PASSWORD=<password> -v /tmp/jenkins:/var/lib/jenkins openshift/jenkins-2-centos7
32+
$ docker run -d -e JENKINS_PASSWORD=<password> -v /tmp/jenkins:/var/lib/jenkins ocp-tools-4/jenkins-rhel9:v4.17.0
3333
```
3434

3535

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The master images follow the normal numbering scheme in which the
22
# major version is used as the directory name and incorporated into
3-
# the image name (jenkins-2-centos7 in this case). For the slave
3+
# the image name (jenkins-2-rhel9 in this case). For the slave
44
# images we are not versioning them (they actually pull their
55
# jars from the jenkins master, so they don't have a jenkins version,
66
# so the only thing we'd version is the maven/nodejs version).
@@ -13,10 +13,12 @@ VERSIONS="2 slave-base"
1313
BUNDLE_PLUGINS="$(shell pwd)/2/contrib/openshift/bundle-plugins.txt"
1414
REF=$(shell mktemp -d)
1515
JENKINS_WAR="$(shell mktemp -d)/jenkins.war"
16-
ifeq ($(TARGET),rhel8)
16+
ifeq ($(TARGET),rhel9)
17+
OS := rhel9
18+
else ifeq ($(TARGET),rhel8)
1719
OS := rhel8
18-
else
19-
OS := centos8
20+
else
21+
OS := ubi
2022
endif
2123

2224
.PHONY: build

PLUGINS.md

Lines changed: 9 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,22 @@
33
### Base set of plugins
44

55
An initial set of Jenkins plugins are included in the OpenShift Jenkins images. The general methodology
6-
is that the CentOS7 image if first updated with any changes to the list of plugins. After some level
7-
of verification with that image, the RHEL7 image is updated.
8-
```
6+
is that the UBI image if first updated with any changes to the list of plugins. After some level
7+
of verification with that image, the RHEL9 image is updated.
98

10-
#### Plugin installation for CentOS7 V4
9+
#### Plugin installation for V4
1110
In v4, that call has been moved to [this script](2/contrib/jenkins/install-jenkins-core-plugins.sh), which is called from
12-
both `Dockerfile.localdev`, `Dockerfile.rhel7` and `Dockerfile.rhel8`.
11+
`Dockerfile.localdev`, `Dockerfile.rhel8` and `Dockerfile.rhel9`.
1312

1413
Where both [base-plugins.txt](2/contrib/openshift/base-plugins.txt) and [install-plugins.sh](2/contrib/jenkins/install-plugins.sh)
1514
are copied into the image prior to that invocation.
1615

1716
The running of `install-plugins.sh` will download the files listed in `base-plugins.txt`, and then open each plugin's manifest
1817
and download any needed dependencies listed, including upgrading any previously installed dependencies as needed.
1918

20-
#### Plugin installation for CentOS7 V4.10+
21-
Starting from `release-4.10`, the `base-plugins.txt` file is instead used to generate `bundle-plugins.txt` which is the comprehensive
22-
list of plugins used by the Jenkins image. To generate this list, developers must run `make plugins-list` prior to commit `base-plugins.txt`.
23-
A git hook is provided to enforce that `bundle-plugins.txt` is always newer than `base-plugins.txt` on every commit attempt. And `openshift-ci`
24-
also runs the `make plugins-list` to be sure that the locally generated list of plugins does not change between the developer commit and the
25-
ci run.
26-
The `bundle-plugins.txt` becomes then the source of truth for the ran, tested and verified plugins list. This file is intended to be used by
27-
anyone who wants to build a Jenkins Image with the exact same set of plugins. Hence, this file is used by the Red Hat internal release
28-
team (ART) and does not alter the existing release process, except that instead of getting the list of plugins from a succesful build, we now get it
29-
from a predefined, pre-test and historized file written to the code repository.
30-
31-
32-
33-
To update the version of a plugin or add a new plugin, construct a PR for this repository that updates `base-plugins.txt` appropriately.
34-
Administrators for this repository will make sure necessary tests are run and merge the PR when things are ready.
35-
36-
When PRs for this repository's `openshift-3*` branches are merged, they kick off associated builds in the [`push_jenkins_images` job on OpenShift's public
37-
Jenkins CI/CD server](https://ci.openshift.redhat.com/jenkins/view/All/job/push_jenkins_images/). When those builds complete,
38-
new versions of the CentOS7 based versions of the images produced by this repository are pushed to Docker Hub. See the top of the README for the precise list.
39-
40-
For v4.0, the job definitions for this repository in https://github.com/openshif/release result in our Prow based infrastructure to eventually
41-
mirror the image content on quay.io.
42-
43-
#### Plugin installation for RHEL7 V3 and V4
44-
45-
Only OpenShift developers working for Red Hat can update the list of plugins for the RHEL7 image. For those developers, visit this
46-
[internal Jenkins server](https://buildvm.openshift.eng.bos.redhat.com:8443/job/devex/job/devex%252Fjenkins-plugins/) and log in (contact our CD team for permissions to this job). Click the `Build with parameters` link, update the `PLUGIN_LIST` field, and submit the build. The format of the data for the `PLUGIN_LIST` field is the same as `base-plugins.txt`.
47-
48-
The complete list of plugins (i.e. including dependencies) needs to be provided though. The most straight forward approach is to mine the output of the CentOS7 build which passed verification for the complete list. Just search for `Installed plugins:` and leverage copy/paste to compile what is needed.
49-
50-
Although this document will refrain on detailing the precise details, once the build on the internal Jenkins server is complete,
51-
the processes will be set in motion to build the `jenkins-2-plugins` RPM that is installed by the [RHEL7 Dockerfile](2/Dockerfile.rhel7) when the next version of the RHEL7 based OpenShift Jenkins image is built. When new versions of OpenShift are released, associated versions of the RHEL7 based versions of the images produced by this repository are pushed to the Docker registry provided to RHEL7 subscribers.
19+
#### Plugin installation for V4.11+
5220

53-
Some reference links for the OpenShift Jenkins developers and where things cross over with the CD/CL/Atomic/RHEL teams:
54-
* http://pkgs.devel.redhat.com/cgit/rpms/?q=jenkins
55-
* https://brewweb.engineering.redhat.com/brew/search?match=glob&type=package&terms=*jenkins*
21+
Starting from `release-4.11`, manually update `base-plugins.txt` and `bundle-plugins.txt` to be the same.
5622

5723
### Adding plugins or updating existing plugins
5824

@@ -64,15 +30,14 @@ The specifics for each approach are detailed below.
6430

6531
#### Installing using layering
6632

67-
In order to install additional Jenkins plugins, the OpenShift Jenkins image provides a way similar to how
68-
the [initial set of plugins are added](#plugin-installation-for-centos7-v3-only) to this image that will allow one
33+
In order to install additional Jenkins plugins, the OpenShift Jenkins image provides a way that will allow one
6934
to add or update by layering on top of this image. The derived image will provide the same functionality
7035
as described in this documentation, in addition it will also include all plugins you list in the `plugins.txt` file.
7136

7237
To create a derived image in this fashion, create the following `Dockerfile`:
7338

7439
```
75-
FROM openshift/jenkins-2-centos7
40+
FROM registry.redhat.io/ocp-tools-4/jenkins-rhel9
7641
COPY plugins.txt /opt/openshift/configuration/plugins.txt
7742
RUN /usr/local/bin/install-plugins.sh /opt/openshift/configuration/plugins.txt
7843
```
@@ -114,7 +79,7 @@ folder, so you can also include additional files (like `credentials.xml`, etc.).
11479
To build your customized Jenkins image, you can then execute following command:
11580

11681
```console
117-
$ s2i build https://github.com/your/repository openshift/jenkins-2-centos7 your_image_name
82+
$ s2i build https://github.com/your/repository registry.redhat.io/ocp-tools-4/jenkins-rhel9 your_image_name
11883
```
11984
NOTE: if instead of adding a plugin you want to replace an existing plugin via dropping the binary plugin in the `./plugins` directory,
12085
make sure the filename ends in `.jpi`.

0 commit comments

Comments
 (0)