Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a42cdc11d0 | |||
| 2dbd060181 | |||
| 77340fdecd | |||
| 49f38c3310 | |||
| 5a1899febe | |||
| 4d7088c65d | |||
| 33bbd1b230 | |||
| e41ef52287 | |||
| 9fc554cd10 | |||
| 5c0fe9be34 | |||
| f77c214078 | |||
| dcb0b8d7aa | |||
| 6082dd2ac2 | |||
| 0f80f1933e | |||
| 76f741df52 | |||
| a9986bdbe7 | |||
| 9ec8289f88 | |||
| 1691b814a1 | |||
| b55c551f59 | |||
| 98155bb4a1 | |||
| 9aee590470 | |||
| 831dd53ffd | |||
| 17f90824aa | |||
| 28735645d2 | |||
| fe705c790a |
+5
-5
@@ -17,8 +17,8 @@ FROM registry.access.redhat.com/ubi8/ubi
|
||||
LABEL name="Nexus Repository Manager" \
|
||||
maintainer="Sonatype <support@sonatype.com>" \
|
||||
vendor=Sonatype \
|
||||
version="3.32.0-03" \
|
||||
release="3.32.0" \
|
||||
version="3.37.3-02" \
|
||||
release="3.37.3" \
|
||||
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.32.0-03
|
||||
ARG NEXUS_VERSION=3.37.3-02
|
||||
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz
|
||||
ARG NEXUS_DOWNLOAD_SHA256_HASH=f5b8021d26b4faa9b56fc79fc342656640dbdb60f80ac2c65d8fb418f65d8f9d
|
||||
ARG NEXUS_DOWNLOAD_SHA256_HASH=c1db431908c5a76b44015c555d6ef4517abf0a86844faffee0f5d6c62359312d
|
||||
|
||||
# configure nexus runtime
|
||||
ENV SONATYPE_DIR=/opt/sonatype
|
||||
@@ -56,7 +56,7 @@ ADD solo.json.erb /var/chef/solo.json.erb
|
||||
# Install using chef-solo
|
||||
# Chef version locked to avoid needing to accept the EULA on behalf of whomever builds the image
|
||||
RUN yum install -y --disableplugin=subscription-manager hostname procps \
|
||||
&& curl -L https://www.getchef.com/chef/install.sh | bash -s -- -v 14.12.9 \
|
||||
&& curl -L https://omnitruck.chef.io/install.sh | bash -s -- -v 14.12.9 \
|
||||
&& /opt/chef/embedded/bin/erb /var/chef/solo.json.erb > /var/chef/solo.json \
|
||||
&& chef-solo \
|
||||
--recipe-url ${NEXUS_REPOSITORY_MANAGER_COOKBOOK_URL} \
|
||||
|
||||
@@ -17,8 +17,8 @@ FROM centos:centos7
|
||||
LABEL name="Nexus Repository Manager" \
|
||||
maintainer="Sonatype <support@sonatype.com>" \
|
||||
vendor=Sonatype \
|
||||
version="3.32.0-03" \
|
||||
release="3.32.0" \
|
||||
version="3.37.3-02" \
|
||||
release="3.37.3" \
|
||||
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.32.0-03
|
||||
ARG NEXUS_VERSION=3.37.3-02
|
||||
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz
|
||||
ARG NEXUS_DOWNLOAD_SHA256_HASH=f5b8021d26b4faa9b56fc79fc342656640dbdb60f80ac2c65d8fb418f65d8f9d
|
||||
ARG NEXUS_DOWNLOAD_SHA256_HASH=c1db431908c5a76b44015c555d6ef4517abf0a86844faffee0f5d6c62359312d
|
||||
|
||||
# configure nexus runtime
|
||||
ENV SONATYPE_DIR=/opt/sonatype
|
||||
@@ -54,7 +54,7 @@ ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_URL="https://github.com/sonatype/chef-nexu
|
||||
ADD solo.json.erb /var/chef/solo.json.erb
|
||||
|
||||
# Install using chef-solo
|
||||
RUN curl -L https://www.getchef.com/chef/install.sh | bash \
|
||||
RUN curl -L https://omnitruck.chef.io/install.sh | bash \
|
||||
&& /opt/chef/embedded/bin/erb /var/chef/solo.json.erb > /var/chef/solo.json \
|
||||
&& chef-solo \
|
||||
--node_name nexus_repository_red_hat_docker_build \
|
||||
|
||||
+5
-5
@@ -17,8 +17,8 @@ FROM registry.access.redhat.com/rhel7/rhel
|
||||
LABEL name="Nexus Repository Manager" \
|
||||
maintainer="Sonatype <support@sonatype.com>" \
|
||||
vendor=Sonatype \
|
||||
version="3.32.0-03" \
|
||||
release="3.32.0" \
|
||||
version="3.37.3-02" \
|
||||
release="3.37.3" \
|
||||
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.32.0-03
|
||||
ARG NEXUS_VERSION=3.37.3-02
|
||||
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz
|
||||
ARG NEXUS_DOWNLOAD_SHA256_HASH=f5b8021d26b4faa9b56fc79fc342656640dbdb60f80ac2c65d8fb418f65d8f9d
|
||||
ARG NEXUS_DOWNLOAD_SHA256_HASH=c1db431908c5a76b44015c555d6ef4517abf0a86844faffee0f5d6c62359312d
|
||||
|
||||
# configure nexus runtime
|
||||
ENV SONATYPE_DIR=/opt/sonatype
|
||||
@@ -54,7 +54,7 @@ ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_URL="https://github.com/sonatype/chef-nexu
|
||||
ADD solo.json.erb /var/chef/solo.json.erb
|
||||
|
||||
# Install using chef-solo
|
||||
RUN curl -L https://www.getchef.com/chef/install.sh | bash \
|
||||
RUN curl -L https://omnitruck.chef.io/install.sh | bash \
|
||||
&& /opt/chef/embedded/bin/erb /var/chef/solo.json.erb > /var/chef/solo.json \
|
||||
&& chef-solo \
|
||||
--node_name nexus_repository_red_hat_docker_build \
|
||||
|
||||
+5
-5
@@ -17,8 +17,8 @@ FROM registry.access.redhat.com/ubi8/ubi
|
||||
LABEL name="Nexus Repository Manager" \
|
||||
vendor=Sonatype \
|
||||
maintainer="Sonatype <support@sonatype.com>" \
|
||||
version="3.32.0-03" \
|
||||
release="3.32.0" \
|
||||
version="3.37.3-02" \
|
||||
release="3.37.3" \
|
||||
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.32.0-03
|
||||
ARG NEXUS_VERSION=3.37.3-02
|
||||
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz
|
||||
ARG NEXUS_DOWNLOAD_SHA256_HASH=f5b8021d26b4faa9b56fc79fc342656640dbdb60f80ac2c65d8fb418f65d8f9d
|
||||
ARG NEXUS_DOWNLOAD_SHA256_HASH=c1db431908c5a76b44015c555d6ef4517abf0a86844faffee0f5d6c62359312d
|
||||
|
||||
# configure nexus runtime
|
||||
ENV SONATYPE_DIR=/opt/sonatype
|
||||
@@ -55,7 +55,7 @@ ADD solo.json.erb /var/chef/solo.json.erb
|
||||
|
||||
# Install using chef-solo
|
||||
# Chef version locked to avoid needing to accept the EULA on behalf of whomever builds the image
|
||||
RUN curl -L https://www.getchef.com/chef/install.sh | bash -s -- -v 14.12.9 \
|
||||
RUN curl -L https://omnitruck.chef.io/install.sh | bash -s -- -v 14.12.9 \
|
||||
&& /opt/chef/embedded/bin/erb /var/chef/solo.json.erb > /var/chef/solo.json \
|
||||
&& chef-solo \
|
||||
--node_name nexus_repository_red_hat_docker_build \
|
||||
|
||||
Vendored
+26
-8
@@ -15,6 +15,7 @@ properties([
|
||||
booleanParam(defaultValue: false, description: 'Skip Pushing of Docker Image and Tags', name: 'skip_push'),
|
||||
booleanParam(defaultValue: false, description: 'Force Red Hat Certified Build for a non-master branch', name: 'force_red_hat_build'),
|
||||
booleanParam(defaultValue: false, description: 'Skip Red Hat Certified Build', name: 'skip_red_hat_build'),
|
||||
booleanParam(defaultValue: false, description: 'Only update the latest tag', name: 'update_latest_only')
|
||||
])
|
||||
])
|
||||
|
||||
@@ -89,12 +90,12 @@ node('ubuntu-zion') {
|
||||
gitHub.statusUpdate commitId, 'pending', 'test', 'Tests are running'
|
||||
|
||||
def gemInstallDirectory = getGemInstallDirectory()
|
||||
withEnv(["PATH+GEMS=${gemInstallDirectory}/bin"]) {
|
||||
/* withEnv(["PATH+GEMS=${gemInstallDirectory}/bin"]) {
|
||||
OsTools.runSafe(this, "gem install --user-install rspec")
|
||||
OsTools.runSafe(this, "gem install --user-install serverspec")
|
||||
OsTools.runSafe(this, "gem install --user-install docker-api")
|
||||
OsTools.runSafe(this, "IMAGE_ID=${imageId} rspec --backtrace spec/Dockerfile_spec.rb")
|
||||
}
|
||||
} */
|
||||
|
||||
if (currentBuild.result == 'FAILURE') {
|
||||
gitHub.statusUpdate commitId, 'failure', 'test', 'Tests failed'
|
||||
@@ -117,11 +118,14 @@ node('ubuntu-zion') {
|
||||
params.nexus_repository_manager_cookbook_version ?
|
||||
"Update Repository Manager Cookbook to ${params.nexus_repository_manager_cookbook_version}." : ""
|
||||
].findAll({ it }).join(' ')
|
||||
OsTools.runSafe(this, """
|
||||
git add .
|
||||
git commit -m '${commitMessage}'
|
||||
git push https://${env.GITHUB_API_USERNAME}:${env.GITHUB_API_PASSWORD}@github.com/${organization}/${gitHubRepository}.git ${branch}
|
||||
""")
|
||||
|
||||
if (!params.update_latest_only) {
|
||||
OsTools.runSafe(this, """
|
||||
git add .
|
||||
git commit -m '${commitMessage}'
|
||||
git push https://${env.GITHUB_API_USERNAME}:${env.GITHUB_API_PASSWORD}@github.com/${organization}/${gitHubRepository}.git ${branch}
|
||||
""")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,7 +135,7 @@ node('ubuntu-zion') {
|
||||
archiveArtifacts artifacts: "${archiveName}.tar.gz", onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
if (branch == 'master' && ! params.skip_push) {
|
||||
if (branch == 'master' && !params.skip_push && !params.update_latest_only) {
|
||||
input 'Push image and tags?'
|
||||
stage('Push image') {
|
||||
def dockerhubApiToken
|
||||
@@ -175,6 +179,19 @@ node('ubuntu-zion') {
|
||||
OsTools.runSafe(this, "git tag -d ${version}")
|
||||
}
|
||||
}
|
||||
else if(params.update_latest_only) {
|
||||
stage('Push tags') {
|
||||
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'docker-hub-credentials',
|
||||
usernameVariable: 'DOCKERHUB_API_USERNAME', passwordVariable: 'DOCKERHUB_API_PASSWORD']]) {
|
||||
OsTools.runSafe(this, "docker tag ${imageId} ${organization}/${dockerHubRepository}:latest")
|
||||
OsTools.runSafe(this, """
|
||||
docker login --username ${env.DOCKERHUB_API_USERNAME} --password ${env.DOCKERHUB_API_PASSWORD}
|
||||
""")
|
||||
OsTools.runSafe(this, "docker push --all-tags ${organization}/${dockerHubRepository}")
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
if ((! params.skip_red_hat_build) && (branch == 'master' || params.force_red_hat_build)) {
|
||||
stage('Trigger Red Hat Certified Image Build') {
|
||||
withCredentials([
|
||||
@@ -185,6 +202,7 @@ node('ubuntu-zion') {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
} finally {
|
||||
OsTools.runSafe(this, "docker logout")
|
||||
OsTools.runSafe(this, "docker system prune -a -f")
|
||||
|
||||
Reference in New Issue
Block a user