Skip to content
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

[pull] main from sonatype:main #16

Merged
merged 4 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal
LABEL name="Nexus Repository Manager" \
maintainer="Sonatype <[email protected]>" \
vendor=Sonatype \
version="3.68.0-04" \
release="3.68.0" \
version="3.68.1-02" \
release="3.68.1" \
url="https://sonatype.com" \
summary="The Nexus Repository Manager server \
with universal support for popular component formats." \
Expand All @@ -36,10 +36,10 @@ LABEL name="Nexus Repository Manager" \
io.openshift.expose-services="8081:8081" \
io.openshift.tags="Sonatype,Nexus,Repository Manager"

ARG NEXUS_VERSION=3.68.0-04
ARG NEXUS_VERSION=3.68.1-02
ARG JAVA_VERSION=java8
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-${JAVA_VERSION}-unix.tar.gz
ARG NEXUS_DOWNLOAD_SHA256_HASH=230e73725063d694e09154b7602685593d15e74de2b6cc8dd227beb4d27093db
ARG NEXUS_DOWNLOAD_SHA256_HASH=b713c786fd5ff6fe5c62ce3ace4ea4918b5178b1004971a210df6c38fcac84a0

# configure nexus runtime
ENV SONATYPE_DIR=/opt/sonatype
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.java11
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal
LABEL name="Nexus Repository Manager" \
maintainer="Sonatype <[email protected]>" \
vendor=Sonatype \
version="3.68.0-04" \
release="3.68.0" \
version="3.68.1-02" \
release="3.68.1" \
url="https://sonatype.com" \
summary="The Nexus Repository Manager server \
with universal support for popular component formats." \
Expand All @@ -36,10 +36,10 @@ LABEL name="Nexus Repository Manager" \
io.openshift.expose-services="8081:8081" \
io.openshift.tags="Sonatype,Nexus,Repository Manager"

ARG NEXUS_VERSION=3.68.0-04
ARG NEXUS_VERSION=3.68.1-02
ARG JAVA_VERSION=java11
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-${JAVA_VERSION}-unix.tar.gz
ARG NEXUS_DOWNLOAD_SHA256_HASH=aa03f3c5511579f42b6bdacdfe9f1e1634aea41ff31a9a8a02cc47ab53cc8739
ARG NEXUS_DOWNLOAD_SHA256_HASH=6a04eb770e0c4415d3033de757b07ddfdfd15beadbf839d4b33438246e4325a7

# configure nexus runtime
ENV SONATYPE_DIR=/opt/sonatype
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.rh.centos
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ FROM centos:centos7
LABEL name="Nexus Repository Manager" \
maintainer="Sonatype <[email protected]>" \
vendor=Sonatype \
version="3.68.0-04" \
release="3.68.0" \
version="3.68.1-02" \
release="3.68.1" \
url="https://sonatype.com" \
summary="The Nexus Repository Manager server \
with universal support for popular component formats." \
Expand All @@ -36,10 +36,10 @@ LABEL name="Nexus Repository Manager" \
io.openshift.expose-services="8081:8081" \
io.openshift.tags="Sonatype,Nexus,Repository Manager"

ARG NEXUS_VERSION=3.68.0-04
ARG NEXUS_VERSION=3.68.1-02
ARG JAVA_VERSION=java8
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-${JAVA_VERSION}-unix.tar.gz
ARG NEXUS_DOWNLOAD_SHA256_HASH=230e73725063d694e09154b7602685593d15e74de2b6cc8dd227beb4d27093db
ARG NEXUS_DOWNLOAD_SHA256_HASH=b713c786fd5ff6fe5c62ce3ace4ea4918b5178b1004971a210df6c38fcac84a0

# configure nexus runtime
ENV SONATYPE_DIR=/opt/sonatype
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.rh.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ FROM registry.access.redhat.com/rhel7/rhel
LABEL name="Nexus Repository Manager" \
maintainer="Sonatype <[email protected]>" \
vendor=Sonatype \
version="3.68.0-04" \
release="3.68.0" \
version="3.68.1-02" \
release="3.68.1" \
url="https://sonatype.com" \
summary="The Nexus Repository Manager server \
with universal support for popular component formats." \
Expand All @@ -36,10 +36,10 @@ LABEL name="Nexus Repository Manager" \
io.openshift.expose-services="8081:8081" \
io.openshift.tags="Sonatype,Nexus,Repository Manager"

ARG NEXUS_VERSION=3.68.0-04
ARG NEXUS_VERSION=3.68.1-02
ARG JAVA_VERSION=java8
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-${JAVA_VERSION}-unix.tar.gz
ARG NEXUS_DOWNLOAD_SHA256_HASH=230e73725063d694e09154b7602685593d15e74de2b6cc8dd227beb4d27093db
ARG NEXUS_DOWNLOAD_SHA256_HASH=b713c786fd5ff6fe5c62ce3ace4ea4918b5178b1004971a210df6c38fcac84a0

# configure nexus runtime
ENV SONATYPE_DIR=/opt/sonatype
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.rh.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal
LABEL name="Nexus Repository Manager" \
vendor=Sonatype \
maintainer="Sonatype <[email protected]>" \
version="3.68.0-04" \
release="3.68.0" \
version="3.68.1-02" \
release="3.68.1" \
url="https://sonatype.com" \
summary="The Nexus Repository Manager server \
with universal support for popular component formats." \
Expand All @@ -36,10 +36,10 @@ LABEL name="Nexus Repository Manager" \
io.openshift.expose-services="8081:8081" \
io.openshift.tags="Sonatype,Nexus,Repository Manager"

ARG NEXUS_VERSION=3.68.0-04
ARG NEXUS_VERSION=3.68.1-02
ARG JAVA_VERSION=java8
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-${JAVA_VERSION}-unix.tar.gz
ARG NEXUS_DOWNLOAD_SHA256_HASH=230e73725063d694e09154b7602685593d15e74de2b6cc8dd227beb4d27093db
ARG NEXUS_DOWNLOAD_SHA256_HASH=b713c786fd5ff6fe5c62ce3ace4ea4918b5178b1004971a210df6c38fcac84a0

# configure nexus runtime
ENV SONATYPE_DIR=/opt/sonatype
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.rh.ubi.java11
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal
LABEL name="Nexus Repository Manager" \
vendor=Sonatype \
maintainer="Sonatype <[email protected]>" \
version="3.68.0-04" \
release="3.68.0" \
version="3.68.1-02" \
release="3.68.1" \
url="https://sonatype.com" \
summary="The Nexus Repository Manager server \
with universal support for popular component formats." \
Expand All @@ -36,10 +36,10 @@ LABEL name="Nexus Repository Manager" \
io.openshift.expose-services="8081:8081" \
io.openshift.tags="Sonatype,Nexus,Repository Manager"

ARG NEXUS_VERSION=3.68.0-04
ARG NEXUS_VERSION=3.68.1-02
ARG JAVA_VERSION=java11
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-${JAVA_VERSION}-unix.tar.gz
ARG NEXUS_DOWNLOAD_SHA256_HASH=aa03f3c5511579f42b6bdacdfe9f1e1634aea41ff31a9a8a02cc47ab53cc8739
ARG NEXUS_DOWNLOAD_SHA256_HASH=6a04eb770e0c4415d3033de757b07ddfdfd15beadbf839d4b33438246e4325a7

# configure nexus runtime
ENV SONATYPE_DIR=/opt/sonatype
Expand Down
50 changes: 32 additions & 18 deletions Jenkinsfile-Internal-Release
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ node('ubuntu-zion') {
def imageName = 'sonatype/nexus3',
archiveName = 'docker-nexus3'

def JAVA_8 = 'java8'
def JAVA_11 = 'java11'
def JAVA_17 = 'java17'

def DOCKERFILE_JAVA_8 = 'Dockerfile'
def DOCKERFILE_JAVA_11 = 'Dockerfile.java11'
def DOCKERFILE_JAVA_17 = 'Dockerfile.java17'

try {
stage('Preparation') {
deleteDir()
Expand All @@ -44,20 +52,25 @@ node('ubuntu-zion') {
if (params.nexus_repository_manager_version) {
stage('Update Repository Manager Version') {
OsTools.runSafe(this, "git checkout ${branch}")
updateRepositoryManagerVersion("${pwd()}/Dockerfile", 'java8')
updateRepositoryManagerVersion("${pwd()}/Dockerfile.java11", 'java11')
updateRepositoryManagerVersion("${pwd()}/Dockerfile.java17", 'java17')
def javaVersionsDockerfilesMap = [
(JAVA_8): DOCKERFILE_JAVA_8,
(JAVA_11): DOCKERFILE_JAVA_11,
(JAVA_17): DOCKERFILE_JAVA_17
]
javaVersionsDockerfilesMap.each { javaVersion, dockerfile ->
updateRepositoryManagerVersion("${pwd()}/${dockerfile}", javaVersion)
}
version = getShortVersion(params.nexus_repository_manager_version)
}
}
}
stage('Build') {
def dockerfilePath = 'Dockerfile'
if (params.java_version == OPENJDK11) {
dockerfilePath = 'Dockerfile.java11'
} else if (params.java_version == OPENJDK17) {
dockerfilePath = 'Dockerfile.java17'
}
def dockerfilesMap = [
(OPENJDK8): DOCKERFILE_JAVA_8,
(OPENJDK11): DOCKERFILE_JAVA_11,
(OPENJDK17): DOCKERFILE_JAVA_17
]
def dockerfilePath = dockerfilesMap.get(params.java_version)
def baseImage = extractBaseImage(dockerfilePath)
def baseImageRefFactory = load 'scripts/BaseImageReference.groovy'
def baseImageReference = baseImageRefFactory.build(this, baseImage as String)
Expand Down Expand Up @@ -88,17 +101,18 @@ node('ubuntu-zion') {
if (branch == 'main') {
stage('Push image to RSC') {
withSonatypeDockerRegistry() {
if (params.java_version == OPENJDK11) {
sh "docker tag ${imageId} docker-all.repo.sonatype.com/sonatype-internal/nexus3:${version}-java11"
sh "docker push docker-all.repo.sonatype.com/sonatype-internal/nexus3:${version}-java11"
} else if (params.java_version == OPENJDK17) {
sh "docker tag ${imageId} docker-all.repo.sonatype.com/sonatype-internal/nexus3:${version}-java17"
sh "docker push docker-all.repo.sonatype.com/sonatype-internal/nexus3:${version}-java17"
} else {
def javaVersionSuffixesMap = [
(OPENJDK8): JAVA_8,
(OPENJDK11): JAVA_11,
(OPENJDK17): JAVA_17
]
def javaVersionSuffix = javaVersionSuffixesMap.get(params.java_version)

sh "docker tag ${imageId} docker-all.repo.sonatype.com/sonatype-internal/nexus3:${version}-${javaVersionSuffix}"
sh "docker push docker-all.repo.sonatype.com/sonatype-internal/nexus3:${version}-${javaVersionSuffix}"
if (params.java_version == OPENJDK8) {
sh "docker tag ${imageId} docker-all.repo.sonatype.com/sonatype-internal/nexus3:${version}"
sh "docker push docker-all.repo.sonatype.com/sonatype-internal/nexus3:${version}"
sh "docker tag ${imageId} docker-all.repo.sonatype.com/sonatype-internal/nexus3:${version}-java8"
sh "docker push docker-all.repo.sonatype.com/sonatype-internal/nexus3:${version}-java8"
}
}
}
Expand Down
Loading