From c571f7e3a72c16fe90b12e4a4746a9ca6a814f61 Mon Sep 17 00:00:00 2001 From: Prashant Dhamdhere Date: Wed, 9 Oct 2024 16:21:22 +0530 Subject: [PATCH 1/3] JKNS-573: Update jenkins baseline version from 2.426.2 to 2.440.3 --- pom.xml | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index c7d380154..69b205780 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 1.1.0 999999-SNAPSHOT - 2.426.2 + 2.440.3 INFO @@ -114,11 +114,11 @@ - + io.jenkins.tools.bom - bom-2.426.x - 2705.vf5c48c31285b_ + bom-2.440.x + 3387.v0f2773fa_3200 import pom @@ -136,6 +136,21 @@ org.jenkins-ci.plugins.workflow workflow-support 865.v43e78cc44e0d + + + org.jenkins-ci.plugins.workflow + workflow-cps + 3832.vc43e04d6d68c + + + org.jenkins-ci.plugins.workflow + workflow-durable-task-step + 1289.v4d3e7b_01546b_ + + + org.jenkins-ci.plugins.workflow + workflow-api + 1283.v99c10937efcb_ org.jenkins-ci.plugins.pipeline-stage-view @@ -147,6 +162,11 @@ git 5.2.1 + + org.jenkins-ci.plugins + branch-api + 2.1128.v717130d4f816 + io.jenkins.blueocean blueocean-rest @@ -157,6 +177,11 @@ kubernetes 4174.v4230d0ccd951 + + org.jenkins-ci.plugins + scm-api + 676.v886669a_199a_a_ + From da3ec7e53841e583684808195d8cb8018ddeba54 Mon Sep 17 00:00:00 2001 From: Prashant Dhamdhere Date: Tue, 29 Oct 2024 11:58:14 +0530 Subject: [PATCH 2/3] update dependencies and fix error with CredentialsUtils.java --- pom.xml | 63 +++++-------------- .../openshiftsync/BuildConfigToJobMapper.java | 8 ++- .../openshiftsync/CredentialsUtils.java | 10 ++- 3 files changed, 32 insertions(+), 49 deletions(-) diff --git a/pom.xml b/pom.xml index 69b205780..cd88ec321 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ io.jenkins.tools.bom bom-2.440.x - 3387.v0f2773fa_3200 + 3435.v238d66a_043fb_ import pom @@ -127,60 +127,31 @@ joda-time 2.12.5 - - org.jenkins-ci.plugins.workflow - workflow-multibranch - 773.vc4fe1378f1d5 - - - org.jenkins-ci.plugins.workflow - workflow-support - 865.v43e78cc44e0d - - - org.jenkins-ci.plugins.workflow - workflow-cps - 3832.vc43e04d6d68c - - - org.jenkins-ci.plugins.workflow - workflow-durable-task-step - 1289.v4d3e7b_01546b_ - - - org.jenkins-ci.plugins.workflow - workflow-api - 1283.v99c10937efcb_ - - - org.jenkins-ci.plugins.pipeline-stage-view - pipeline-rest-api - 2.34 - - - org.jenkins-ci.plugins - git - 5.2.1 - - - org.jenkins-ci.plugins - branch-api - 2.1128.v717130d4f816 - io.jenkins.blueocean blueocean-rest - 1.27.9 + 1.27.16 org.csanchez.jenkins.plugins kubernetes - 4174.v4230d0ccd951 + 4290.v93ea_4b_b_26a_61 + + + + io.jenkins.plugins + asm-api + 9.6-3.v2e1fa_b_338cd7 + + + commons-io + commons-io + 2.16.1 - org.jenkins-ci.plugins - scm-api - 676.v886669a_199a_a_ + io.jenkins.plugins.mina-sshd-api + mina-sshd-api-common + 2.14.0-131.v04e9b_6b_e0362 diff --git a/src/main/java/io/fabric8/jenkins/openshiftsync/BuildConfigToJobMapper.java b/src/main/java/io/fabric8/jenkins/openshiftsync/BuildConfigToJobMapper.java index 7f40cf2fd..7b750900f 100644 --- a/src/main/java/io/fabric8/jenkins/openshiftsync/BuildConfigToJobMapper.java +++ b/src/main/java/io/fabric8/jenkins/openshiftsync/BuildConfigToJobMapper.java @@ -35,6 +35,7 @@ import org.jenkinsci.plugins.workflow.job.WorkflowJob; import org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty; +import hudson.model.Descriptor.FormException; import hudson.plugins.git.BranchSpec; import hudson.plugins.git.GitSCM; import hudson.plugins.git.SubmoduleConfig; @@ -108,7 +109,12 @@ public static FlowDefinition mapBuildConfigToFlow(BuildConfig bc) throws IOExcep return null; } } else { - return new CpsFlowDefinition(jenkinsfile, true); + try { + return new CpsFlowDefinition(jenkinsfile, true); + } catch (FormException e) { + // TODO Auto-generated catch block + throw new RuntimeException(e); + } } } diff --git a/src/main/java/io/fabric8/jenkins/openshiftsync/CredentialsUtils.java b/src/main/java/io/fabric8/jenkins/openshiftsync/CredentialsUtils.java index 3e68d07ab..1a072c94f 100644 --- a/src/main/java/io/fabric8/jenkins/openshiftsync/CredentialsUtils.java +++ b/src/main/java/io/fabric8/jenkins/openshiftsync/CredentialsUtils.java @@ -51,6 +51,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import hudson.model.Fingerprint; +import hudson.model.Descriptor.FormException; import hudson.security.ACL; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.ObjectMeta; @@ -485,8 +486,13 @@ private static Credentials newUsernamePasswordCredentials(String secretName, Str return null; } - return new UsernamePasswordCredentialsImpl(GLOBAL, secretName, secretName, - new String(DECODER.decode(usernameData), UTF_8), new String(DECODER.decode(passwordData), UTF_8)); + try { + return new UsernamePasswordCredentialsImpl(GLOBAL, secretName, secretName, + new String(DECODER.decode(usernameData), UTF_8), new String(DECODER.decode(passwordData), UTF_8)); + } catch (FormException e) { + // TODO Auto-generated catch block + throw new RuntimeException(e); + } } /** From e15c709c446103f2a537f5700a513bb6a687873a Mon Sep 17 00:00:00 2001 From: Prashant Dhamdhere Date: Tue, 26 Nov 2024 19:00:53 +0530 Subject: [PATCH 3/3] testing plugin and image changes --- Dockerfile | 3 ++- pom.xml | 10 ---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 899db7d90..d6b28bf22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,8 @@ RUN curl -L -o maven.tar.gz https://dlcdn.apache.org/maven/maven-3/3.8.8/binarie RUN ./maven/bin/mvn --version && \ ./maven/bin/mvn clean package -FROM registry.ci.openshift.org/origin/4.16:jenkins +# FROM registry.ci.openshift.org/origin/4.16:jenkins +FROM registry.redhat.io/ocp-tools-4/jenkins-rhel8:v4.14.0 RUN rm /opt/openshift/plugins/openshift-sync.jpi COPY --from=builder /java/src/github.com/openshift/jenkins-sync-plugin/target/openshift-sync.hpi /opt/openshift/plugins RUN mv /opt/openshift/plugins/openshift-sync.hpi /opt/openshift/plugins/openshift-sync.jpi diff --git a/pom.xml b/pom.xml index cd88ec321..b09002a55 100644 --- a/pom.xml +++ b/pom.xml @@ -127,16 +127,6 @@ joda-time 2.12.5 - - io.jenkins.blueocean - blueocean-rest - 1.27.16 - - - org.csanchez.jenkins.plugins - kubernetes - 4290.v93ea_4b_b_26a_61 - io.jenkins.plugins