From 98acc1a402e53a8863089f43c699916909c5982d Mon Sep 17 00:00:00 2001 From: Nicholas Blair Date: Wed, 4 Sep 2024 08:28:45 -0500 Subject: [PATCH 1/3] release: trim problematic phases for 3.72.0 release --- Jenkinsfile-Release | 43 ++----------------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/Jenkinsfile-Release b/Jenkinsfile-Release index 44825b1..8bb011d 100644 --- a/Jenkinsfile-Release +++ b/Jenkinsfile-Release @@ -14,7 +14,6 @@ properties([ parameters([ string(defaultValue: '', description: 'New Nexus Repository Manager Version', name: 'nexus_repository_manager_version'), string(defaultValue: '', description: 'New Nexus Repository Manager Version Sha256', name: 'nexus_repository_manager_version_sha'), - string(defaultValue: '', description: 'New Nexus Repository Manager Cookbook Version', name: 'nexus_repository_manager_cookbook_version'), booleanParam(defaultValue: false, description: 'Skip Pushing of Docker Image and Tags', name: 'skip_push'), booleanParam(defaultValue: false, description: 'Only update the latest tag', name: 'update_latest_only') ]) @@ -67,12 +66,6 @@ node('ubuntu-zion') { version = getShortVersion(params.nexus_repository_manager_version) } } - if (params.nexus_repository_manager_cookbook_version) { - stage('Update Repository Manager Cookbook Version') { - OsTools.runSafe(this, "git checkout ${branch}") - dockerFileLocations.each { updateRepositoryCookbookVersion(it) } - } - } } stage('Build Images') { @@ -98,22 +91,6 @@ node('ubuntu-zion') { } } - stage('Test') { - gitHub.statusUpdate commitId, 'pending', 'test', 'Tests are running' - validateExpectations([ - new Expectation('Has user nexus in group nexus present', - 'id', '-ng nexus', 'nexus'), - new Expectation('Has nexus user java process present', - 'ps', '-e -o command,user | grep -q ^/usr/lib/jvm/java.*nexus$ | echo $?', '0') - ]) - if (currentBuild.result == 'FAILURE') { - gitHub.statusUpdate commitId, 'failure', 'test', 'Tests failed' - return - } else { - gitHub.statusUpdate commitId, 'success', 'test', 'Tests succeeded' - } - } - stage('Evaluate Policies') { def imagesToScan = [ [name: 'docker-nexus3', image: imageName], @@ -138,17 +115,11 @@ node('ubuntu-zion') { return } - if (params.nexus_repository_manager_version && params.nexus_repository_manager_version_sha - || params.nexus_repository_manager_cookbook_version) { + if (params.nexus_repository_manager_version && params.nexus_repository_manager_version_sha) { stage('Commit Automated Code Update') { withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'jenkins-github', usernameVariable: 'GITHUB_API_USERNAME', passwordVariable: 'GITHUB_API_PASSWORD']]) { - def commitMessage = [ - params.nexus_repository_manager_version && params.nexus_repository_manager_version_sha ? - "Update Repository Manager to ${params.nexus_repository_manager_version}." : "", - params.nexus_repository_manager_cookbook_version ? - "Update Repository Manager Cookbook to ${params.nexus_repository_manager_cookbook_version}." : "" - ].findAll({ it }).join(' ') + def commitMessage = "Update Repository Manager to ${params.nexus_repository_manager_version}." if (!params.update_latest_only) { OsTools.runSafe(this, """ @@ -293,16 +264,6 @@ def updateRepositoryManagerVersion(dockerFileLocation) { writeFile(file: dockerFileLocation, text: dockerFile) } -def updateRepositoryCookbookVersion(dockerFileLocation) { - def dockerFile = readFile(file: dockerFileLocation) - - def cookbookVersionRegex = /(ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION=")(release-\d\.\d\.\d{8}\-\d{6}\.[a-z0-9]{7})(")/ - - dockerFile = dockerFile.replaceAll(cookbookVersionRegex, "\$1${params.nexus_repository_manager_cookbook_version}\$3") - - writeFile(file: dockerFileLocation, text: dockerFile) -} - def extractBaseImage (dockerFileLocation) { def dockerFile = readFile(file: dockerFileLocation) def baseImageRegex = "FROM\\s+([^\\s]+)" From e9c8512fc9891c0afcf5fe4c3a734f65a48c3950 Mon Sep 17 00:00:00 2001 From: Sonatype Date: Wed, 4 Sep 2024 13:47:09 +0000 Subject: [PATCH 2/3] Update Repository Manager to 3.72.0-04. --- Dockerfile.alpine.java17 | 8 ++++---- Dockerfile.java17 | 8 ++++---- Dockerfile.rh.ubi.java17 | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile.alpine.java17 b/Dockerfile.alpine.java17 index 3e43c09..02668c4 100644 --- a/Dockerfile.alpine.java17 +++ b/Dockerfile.alpine.java17 @@ -17,8 +17,8 @@ FROM alpine LABEL name="Nexus Repository Manager" \ maintainer="Sonatype " \ vendor=Sonatype \ - version="3.71.0-06" \ - release="3.71.0" \ + version="3.72.0-04" \ + release="3.72.0" \ url="https://sonatype.com" \ summary="The Nexus Repository Manager server \ with universal support for popular component formats." \ @@ -36,9 +36,9 @@ LABEL name="Nexus Repository Manager" \ io.openshift.expose-services="8081:8081" \ io.openshift.tags="Sonatype,Nexus,Repository Manager" -ARG NEXUS_VERSION=3.71.0-06 +ARG NEXUS_VERSION=3.72.0-04 ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz -ARG NEXUS_DOWNLOAD_SHA256_HASH=b025287558184677fc231035c9f5e5e6cc4bc1cafd76d13a06233a4ed09d08f6 +ARG NEXUS_DOWNLOAD_SHA256_HASH=45148c0645ab0611f6881b782b83e9dab0dbfb1b848e9b95ebaeb274c708a1c0 # configure nexus runtime ENV SONATYPE_DIR=/opt/sonatype diff --git a/Dockerfile.java17 b/Dockerfile.java17 index 541b2da..a28593e 100644 --- a/Dockerfile.java17 +++ b/Dockerfile.java17 @@ -17,8 +17,8 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal LABEL name="Nexus Repository Manager" \ maintainer="Sonatype " \ vendor=Sonatype \ - version="3.71.0-06" \ - release="3.71.0" \ + version="3.72.0-04" \ + release="3.72.0" \ url="https://sonatype.com" \ summary="The Nexus Repository Manager server \ with universal support for popular component formats." \ @@ -36,9 +36,9 @@ LABEL name="Nexus Repository Manager" \ io.openshift.expose-services="8081:8081" \ io.openshift.tags="Sonatype,Nexus,Repository Manager" -ARG NEXUS_VERSION=3.71.0-06 +ARG NEXUS_VERSION=3.72.0-04 ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz -ARG NEXUS_DOWNLOAD_SHA256_HASH=b025287558184677fc231035c9f5e5e6cc4bc1cafd76d13a06233a4ed09d08f6 +ARG NEXUS_DOWNLOAD_SHA256_HASH=45148c0645ab0611f6881b782b83e9dab0dbfb1b848e9b95ebaeb274c708a1c0 # configure nexus runtime ENV SONATYPE_DIR=/opt/sonatype diff --git a/Dockerfile.rh.ubi.java17 b/Dockerfile.rh.ubi.java17 index d03c0f9..80d68d0 100644 --- a/Dockerfile.rh.ubi.java17 +++ b/Dockerfile.rh.ubi.java17 @@ -17,8 +17,8 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal LABEL name="Nexus Repository Manager" \ vendor=Sonatype \ maintainer="Sonatype " \ - version="3.71.0-06" \ - release="3.71.0" \ + version="3.72.0-04" \ + release="3.72.0" \ url="https://sonatype.com" \ summary="The Nexus Repository Manager server \ with universal support for popular component formats." \ @@ -36,9 +36,9 @@ LABEL name="Nexus Repository Manager" \ io.openshift.expose-services="8081:8081" \ io.openshift.tags="Sonatype,Nexus,Repository Manager" -ARG NEXUS_VERSION=3.71.0-06 +ARG NEXUS_VERSION=3.72.0-04 ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz -ARG NEXUS_DOWNLOAD_SHA256_HASH=b025287558184677fc231035c9f5e5e6cc4bc1cafd76d13a06233a4ed09d08f6 +ARG NEXUS_DOWNLOAD_SHA256_HASH=45148c0645ab0611f6881b782b83e9dab0dbfb1b848e9b95ebaeb274c708a1c0 # configure nexus runtime ENV SONATYPE_DIR=/opt/sonatype From d2c9bc91a41a32aa461b501d3c044805620fe182 Mon Sep 17 00:00:00 2001 From: Nicholas Blair Date: Wed, 4 Sep 2024 08:50:58 -0500 Subject: [PATCH 3/3] build: skip the prompt This removes the input prompt to "Proceed" or "Abort" with the pipeline job. --- Jenkinsfile-Release | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile-Release b/Jenkinsfile-Release index 8bb011d..c4068bb 100644 --- a/Jenkinsfile-Release +++ b/Jenkinsfile-Release @@ -138,7 +138,6 @@ node('ubuntu-zion') { } } if (branch == 'main' && !params.skip_push && !params.update_latest_only) { - input 'Push image and tags?' stage('Push image') { def dockerhubApiToken