-
Notifications
You must be signed in to change notification settings - Fork 440
JKNS-637: Remove deprecated references #1899
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
Open
k37y
wants to merge
1
commit into
openshift:master
Choose a base branch
from
k37y:clean-up
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,24 +1,23 @@ | ||
| ############################################## | ||
| # Stage 1 : Build go-init | ||
| ############################################## | ||
| FROM openshift/origin-release:golang-1.12 AS go-init-builder | ||
| FROM registry.access.redhat.com/ubi9/go-toolset:1.21 AS go-init-builder | ||
| ARG jenkins_version=latest | ||
| WORKDIR /go/src/github.com/openshift/jenkins | ||
| COPY . . | ||
| WORKDIR /go/src/github.com/openshift/jenkins/go-init | ||
| RUN go build . && cp go-init /usr/bin | ||
| RUN GO111MODULE=off go build -o /usr/bin/go-init . | ||
|
|
||
| ############################################## | ||
| # Stage 2 : Build slave-base with go-init | ||
| ############################################## | ||
| FROM quay.io/openshift/origin-cli:4.16 | ||
| FROM registry.access.redhat.com/ubi9:latest | ||
| ARG jenkins_version=latest | ||
| MAINTAINER Akram Ben Aissi <abenaiss@redhat.com> | ||
| COPY --from=go-init-builder /usr/bin/go-init /usr/bin/go-init | ||
| # Jenkins image for OpenShift | ||
| # | ||
| # This image provides a Jenkins server, primarily intended for integration with | ||
| # OpenShift v3. | ||
| # OpenShift v4. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should remove/update |
||
| # | ||
| # Volumes: | ||
| # * /var/jenkins_home | ||
|
|
@@ -31,31 +30,35 @@ ENV JENKINS_VERSION=2 \ | |
| HOME=/var/lib/jenkins \ | ||
| JENKINS_HOME=/var/lib/jenkins \ | ||
| JENKINS_UC=https://updates.jenkins.io \ | ||
| OPENSHIFT_JENKINS_IMAGE_VERSION=4.10 \ | ||
| OPENSHIFT_JENKINS_IMAGE_VERSION=4.17 \ | ||
| LANG=en_US.UTF-8 \ | ||
| LC_ALL=en_US.UTF-8 \ | ||
| INSTALL_JENKINS_VIA_RPMS=false | ||
|
|
||
| LABEL k8s.io.description="Jenkins is a continuous integration server" \ | ||
| k8s.io.display-name="Jenkins 2" \ | ||
| openshift.io.expose-services="8080:http" \ | ||
| openshift.io.tags="jenkins,jenkins2,ci" \ | ||
| LABEL io.k8s.description="Jenkins is a continuous integration server" \ | ||
| io.k8s.display-name="Jenkins 2" \ | ||
| maintainer="Prashant Dhamdhere <prdhamdh@redhat.com>, Vinu Kochukuttan <vkochuku@redhat.com>" \ | ||
| io.openshift.expose-services="8080:http" \ | ||
| io.openshift.tags="jenkins,jenkins2,ci" \ | ||
| io.jenkins.version="${jenkins_version}" \ | ||
| io.openshift.s2i.scripts-url=image:///usr/libexec/s2i | ||
| io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" | ||
|
|
||
| # 8080 for main web interface, 50000 for slave agents | ||
| EXPOSE 8080 50000 | ||
|
|
||
| RUN rm /etc/yum.repos.d/* | ||
| COPY contrib/openshift/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo | ||
| RUN curl http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-Official -o /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS && \ | ||
| 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" && \ | ||
| DISABLES="" && \ | ||
| yum $DISABLES -y --setopt=tsflags=nodocs --disableplugin=subscription-manager install epel-release && \ | ||
| yum $DISABLES -y --setopt=tsflags=nodocs --disableplugin=subscription-manager install $INSTALL_PKGS && \ | ||
| yum update --excludepkgs redhat-release -y && \ | ||
| 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" && \ | ||
| yum install -y $INSTALL_PKGS && \ | ||
| yum update -y && \ | ||
| rpm -V $INSTALL_PKGS && \ | ||
| yum clean all && \ | ||
| mkdir -p /usr/share/openshift/bin/oc-41{2..7} && \ | ||
| curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.12/openshift-client-linux.tar.gz | tar zxf - -C /usr/share/openshift/bin/oc-412/ oc && \ | ||
| curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.13/openshift-client-linux.tar.gz | tar zxf - -C /usr/share/openshift/bin/oc-413/ oc && \ | ||
| curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.14/openshift-client-linux.tar.gz | tar zxf - -C /usr/share/openshift/bin/oc-414/ oc && \ | ||
| curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.15/openshift-client-linux.tar.gz | tar zxf - -C /usr/share/openshift/bin/oc-415/ oc && \ | ||
| curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.16/openshift-client-linux.tar.gz | tar zxf - -C /usr/share/openshift/bin/oc-416/ oc && \ | ||
| curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.17/openshift-client-linux.tar.gz | tar zxf - -C /usr/share/openshift/bin/oc-417/ oc && \ | ||
| localedef -f UTF-8 -i en_US en_US.UTF-8 && \ | ||
| alternatives --set java $(alternatives --display java | grep 'family java-21-openjdk' | cut -d ' ' -f 1) && \ | ||
| alternatives --set javac $(alternatives --display javac | grep 'family java-21-openjdk' | cut -d ' ' -f 1) && \ | ||
| 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 +70,7 @@ ADD ./contrib/s2i /usr/libexec/s2i | |
| ADD release.version /tmp/release.version | ||
|
|
||
| RUN /usr/local/bin/install-jenkins-core-plugins.sh /opt/openshift/bundle-plugins.txt && \ | ||
| rmdir /var/log/jenkins && \ | ||
| rm -rf /var/log/jenkins && \ | ||
| chmod -R 775 /etc/alternatives && \ | ||
| chmod -R 775 /var/lib/alternatives && \ | ||
| chmod -R 775 /usr/lib/jvm && \ | ||
|
|
@@ -81,6 +84,7 @@ RUN /usr/local/bin/install-jenkins-core-plugins.sh /opt/openshift/bundle-plugins | |
| /usr/local/bin/fix-permissions /var/lib/jenkins && \ | ||
| /usr/local/bin/fix-permissions /var/log | ||
|
|
||
|
|
||
| VOLUME ["/var/lib/jenkins"] | ||
|
|
||
| USER 1001 | ||
|
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
2/contrib/openshift/configuration/init.groovy.d/oc-tools.groovy
This file contains hidden or 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,56 @@ | ||
| import jenkins.model.Jenkins | ||
| import hudson.slaves.EnvironmentVariablesNodeProperty | ||
| import hudson.slaves.EnvironmentVariablesNodeProperty.Entry | ||
| import com.openshift.jenkins.plugins.OpenShiftClientTools | ||
| import jenkins.model.Jenkins | ||
|
|
||
| println "Configuring node property ..." | ||
|
|
||
| def instance = Jenkins.instance | ||
|
|
||
| def nodeProps = instance.nodeProperties | ||
| def envProp = nodeProps.get(EnvironmentVariablesNodeProperty) | ||
|
|
||
| if (envProp == null) { | ||
| def newEnv = new EnvironmentVariablesNodeProperty( | ||
| new Entry("PATH+OC", "/usr/share/openshift/bin/oc-417"), | ||
| ) | ||
| nodeProps.add(newEnv) | ||
| } else { | ||
| def envVars = envProp.envVars | ||
|
|
||
| envVars.put("PATH+OC", "/usr/share/openshift/bin/oc-417") | ||
| } | ||
|
|
||
| instance.save() | ||
|
|
||
| println "Environment variables updated." | ||
|
|
||
| println "Configuring oc tools ..." | ||
|
|
||
| def descriptor = Jenkins.instance.getDescriptor(OpenShiftClientTools) | ||
|
|
||
| def toolsToAdd = [ | ||
| "oc-412": "/usr/share/openshift/bin/oc-412", | ||
| "oc-413": "/usr/share/openshift/bin/oc-413", | ||
| "oc-414": "/usr/share/openshift/bin/oc-414", | ||
| "oc-415": "/usr/share/openshift/bin/oc-415", | ||
| "oc-416": "/usr/share/openshift/bin/oc-416", | ||
| "oc-417": "/usr/share/openshift/bin/oc-417" | ||
| ] | ||
|
|
||
| def existing = descriptor.getInstallations() as List | ||
|
|
||
| toolsToAdd.each { name, path -> | ||
| if (!existing.any { it.name == name }) { | ||
| existing << new OpenShiftClientTools(name, path, []) | ||
| println "Added: $name -> $path" | ||
| } else { | ||
| println "Skipped (already exists): $name" | ||
| } | ||
| } | ||
|
|
||
| descriptor.setInstallations(existing.toArray(new OpenShiftClientTools[0])) | ||
| descriptor.save() | ||
|
|
||
| println "All done!" |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use
ose-cli-rhel9image instead ubi ?