Compare commits

...

6 Commits

Author SHA1 Message Date
Sonatype 6a1cc21a6e Update Repository Manager to 3.12.1-01. 2018-06-11 13:22:32 +00:00
Sonatype 850d5a247e Update Repository Manager Cookbook to release-0.5.20180420-205540.75aa3de. 2018-05-29 22:18:48 +00:00
Justin Young a614458159 CI Pipeline Library (#103) 2018-05-29 15:16:46 -07:00
Sonatype 3a68297242 Update Repository Manager to 3.12.0-01. 2018-05-22 21:38:51 +00:00
Sonatype 5f926027a5 Update Repository Manager to 3.11.0-01. 2018-05-01 19:43:30 +00:00
Justin Young af1f6b460c Update JRE Url from Jenkins Parameter (#101)
* Update JRE Url from Jenkins parameter.

* Adjust Jenkins stage name to be more descriptive.

* Update JRE Url from Jenkins test (#102)

* Update Oracle JRE to 8u172-b11.
2018-04-20 14:57:11 -07:00
4 changed files with 51 additions and 39 deletions
+6 -10
View File
@@ -20,18 +20,14 @@ LABEL vendor=Sonatype \
com.sonatype.license="Apache License, Version 2.0" \
com.sonatype.name="Nexus Repository Manager base image"
ARG NEXUS_VERSION=3.10.0-04
ARG NEXUS_VERSION=3.12.1-01
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz
ARG NEXUS_DOWNLOAD_SHA256_HASH=8f3137471cdb002b6cf9d1874bbddb6ad280d4d7a492e363cfc5f54fbd45b5d9
ARG NEXUS_DOWNLOAD_SHA256_HASH=6eb09810767ed1bfe33c995a2fa550b667189aa0ed99f002ce826436f60765ef
ENV JAVA_HOME=/opt/java \
JAVA_VERSION_MAJOR=8 \
JAVA_VERSION_MINOR=162 \
JAVA_VERSION_BUILD=12 \
JAVA_DOWNLOAD_HASH=0da788060d494f5095bf8624735fa2f1
ARG JAVA_URL=https://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/server-jre-8u172-linux-x64.tar.gz
ARG JAVA_DOWNLOAD_SHA256_HASH=3d0a5db2300423a1fd6ee25c229dbd5320d79204c73844337f5b6a082d58541f
ENV JAVA_URL=http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_DOWNLOAD_HASH}/server-jre-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
JAVA_DOWNLOAD_SHA256_HASH=6942684acb6001748a01fc090a18f52ebd8cbfcf7be27ec6131981906bfa8b53
ENV JAVA_HOME=/opt/java
# configure nexus runtime
ENV SONATYPE_DIR=/opt/sonatype
@@ -41,7 +37,7 @@ ENV NEXUS_HOME=${SONATYPE_DIR}/nexus \
SONATYPE_WORK=${SONATYPE_DIR}/sonatype-work \
DOCKER_TYPE='docker'
ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION="release-0.5.20180307-101842.bde3aae"
ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION="release-0.5.20180420-205540.75aa3de"
ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_URL="https://github.com/sonatype/chef-nexus-repository-manager/releases/download/${NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION}/chef-nexus-repository-manager.tar.gz"
ADD solo.json.erb /var/chef/solo.json.erb
+8 -12
View File
@@ -18,8 +18,8 @@ MAINTAINER Sonatype <cloud-ops@sonatype.com>
LABEL name="Nexus Repository Manager" \
vendor=Sonatype \
version="3.10.0-04" \
release="3.10.0" \
version="3.12.1-01" \
release="3.12.1" \
url="https://sonatype.com" \
summary="The Nexus Repository Manager server \
with universal support for popular component formats." \
@@ -37,18 +37,14 @@ LABEL name="Nexus Repository Manager" \
io.openshift.expose-services="8081:8081" \
io.openshift.tags="Sonatype,Nexus,Repository Manager"
ARG NEXUS_VERSION=3.10.0-04
ARG NEXUS_VERSION=3.12.1-01
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz
ARG NEXUS_DOWNLOAD_SHA256_HASH=8f3137471cdb002b6cf9d1874bbddb6ad280d4d7a492e363cfc5f54fbd45b5d9
ARG NEXUS_DOWNLOAD_SHA256_HASH=6eb09810767ed1bfe33c995a2fa550b667189aa0ed99f002ce826436f60765ef
ENV JAVA_HOME=/opt/java \
JAVA_VERSION_MAJOR=8 \
JAVA_VERSION_MINOR=162 \
JAVA_VERSION_BUILD=12 \
JAVA_DOWNLOAD_HASH=0da788060d494f5095bf8624735fa2f1
ARG JAVA_URL=https://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/server-jre-8u172-linux-x64.tar.gz
ARG JAVA_DOWNLOAD_SHA256_HASH=3d0a5db2300423a1fd6ee25c229dbd5320d79204c73844337f5b6a082d58541f
ENV JAVA_URL=http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_DOWNLOAD_HASH}/server-jre-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
JAVA_DOWNLOAD_SHA256_HASH=6942684acb6001748a01fc090a18f52ebd8cbfcf7be27ec6131981906bfa8b53
ENV JAVA_HOME=/opt/java
# configure nexus runtime
ENV SONATYPE_DIR=/opt/sonatype
@@ -58,7 +54,7 @@ ENV NEXUS_HOME=${SONATYPE_DIR}/nexus \
SONATYPE_WORK=${SONATYPE_DIR}/sonatype-work \
DOCKER_TYPE='rh-docker'
ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION="release-0.5.20180307-101842.bde3aae"
ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION="release-0.5.20180420-205540.75aa3de"
ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_URL="https://github.com/sonatype/chef-nexus-repository-manager/releases/download/${NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION}/chef-nexus-repository-manager.tar.gz"
ADD solo.json.erb /var/chef/solo.json.erb
+8 -12
View File
@@ -18,8 +18,8 @@ MAINTAINER Sonatype <cloud-ops@sonatype.com>
LABEL name="Nexus Repository Manager" \
vendor=Sonatype \
version="3.10.0-04" \
release="3.10.0" \
version="3.12.1-01" \
release="3.12.1" \
url="https://sonatype.com" \
summary="The Nexus Repository Manager server \
with universal support for popular component formats." \
@@ -37,18 +37,14 @@ LABEL name="Nexus Repository Manager" \
io.openshift.expose-services="8081:8081" \
io.openshift.tags="Sonatype,Nexus,Repository Manager"
ARG NEXUS_VERSION=3.10.0-04
ARG NEXUS_VERSION=3.12.1-01
ARG NEXUS_DOWNLOAD_URL=https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz
ARG NEXUS_DOWNLOAD_SHA256_HASH=8f3137471cdb002b6cf9d1874bbddb6ad280d4d7a492e363cfc5f54fbd45b5d9
ARG NEXUS_DOWNLOAD_SHA256_HASH=6eb09810767ed1bfe33c995a2fa550b667189aa0ed99f002ce826436f60765ef
ENV JAVA_HOME=/opt/java \
JAVA_VERSION_MAJOR=8 \
JAVA_VERSION_MINOR=162 \
JAVA_VERSION_BUILD=12 \
JAVA_DOWNLOAD_HASH=0da788060d494f5095bf8624735fa2f1
ARG JAVA_URL=https://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/server-jre-8u172-linux-x64.tar.gz
ARG JAVA_DOWNLOAD_SHA256_HASH=3d0a5db2300423a1fd6ee25c229dbd5320d79204c73844337f5b6a082d58541f
ENV JAVA_URL=http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_DOWNLOAD_HASH}/server-jre-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
JAVA_DOWNLOAD_SHA256_HASH=6942684acb6001748a01fc090a18f52ebd8cbfcf7be27ec6131981906bfa8b53
ENV JAVA_HOME=/opt/java
# configure nexus runtime
ENV SONATYPE_DIR=/opt/sonatype
@@ -58,7 +54,7 @@ ENV NEXUS_HOME=${SONATYPE_DIR}/nexus \
SONATYPE_WORK=${SONATYPE_DIR}/sonatype-work \
DOCKER_TYPE='rh-docker'
ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION="release-0.5.20180307-101842.bde3aae"
ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION="release-0.5.20180420-205540.75aa3de"
ARG NEXUS_REPOSITORY_MANAGER_COOKBOOK_URL="https://github.com/sonatype/chef-nexus-repository-manager/releases/download/${NEXUS_REPOSITORY_MANAGER_COOKBOOK_VERSION}/chef-nexus-repository-manager.tar.gz"
ADD solo.json.erb /var/chef/solo.json.erb
Vendored
+29 -5
View File
@@ -3,7 +3,7 @@
* Includes the third-party code listed at http://links.sonatype.com/products/nexus/attributions.
* "Sonatype" is a trademark of Sonatype, Inc.
*/
@Library('zion-pipeline-library')
@Library('ci-pipeline-library') _
import com.sonatype.jenkins.pipeline.GitHub
import com.sonatype.jenkins.pipeline.OsTools
@@ -12,7 +12,10 @@ properties([
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')
string(defaultValue: '', description: 'New Nexus Repository Manager Cookbook Version', name: 'nexus_repository_manager_cookbook_version'),
string(defaultValue: '', description: 'New JRE Url', name: 'oracle_jre_url'),
string(defaultValue: '', description: 'New JRE Sha256', name: 'oracle_jre_sha')
])
])
@@ -68,6 +71,12 @@ node('ubuntu-zion') {
dockerFileLocations.each { updateRepositoryCookbookVersion(it) }
}
}
if (params.oracle_jre_url && params.oracle_jre_sha) {
stage('Update JRE Url') {
OsTools.runSafe(this, "git checkout ${branch}")
dockerFileLocations.each { updateJreUrl(it) }
}
}
}
stage('Build') {
gitHub.statusUpdate commitId, 'pending', 'build', 'Build is running'
@@ -103,9 +112,10 @@ node('ubuntu-zion') {
if (currentBuild.result == 'FAILURE') {
return
}
if (params.nexus_repository_manager_version
&& params.nexus_repository_manager_version_sha || params.nexus_repository_manager_cookbook_version) {
stage('Commit Repository Manager Version Update') {
if (params.nexus_repository_manager_version && params.nexus_repository_manager_version_sha
|| params.nexus_repository_manager_cookbook_version
|| params.oracle_jre_url && params.oracle_jre_sha) {
stage('Commit Automated Code Update') {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'integrations-github-api',
usernameVariable: 'GITHUB_API_USERNAME', passwordVariable: 'GITHUB_API_PASSWORD']]) {
def commitMessage = [
@@ -113,6 +123,8 @@ node('ubuntu-zion') {
"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}." : "",
params.oracle_jre_url && params.oracle_jre_sha ?
"Update Oracle JRE to ${(params.oracle_jre_url =~ /(\du\d{3}\-b\d{2})/)[0][0]}." : ""
].findAll({ it }).join(' ')
OsTools.runSafe(this, """
git add .
@@ -231,3 +243,15 @@ def updateRepositoryCookbookVersion(dockerFileLocation) {
writeFile(file: dockerFileLocation, text: dockerFile)
}
def updateJreUrl(dockerFileLocation) {
def dockerFile = readFile(file: dockerFileLocation)
def jreUrlRegex = /(ARG JAVA_URL=)(http.*-linux-x64\.tar\.gz)/
def jreShaRegex = /(JAVA_DOWNLOAD_SHA256_HASH=)([A-Fa-f0-9]{64})/
dockerFile = dockerFile.replaceAll(jreUrlRegex, "\$1${params.oracle_jre_url}")
dockerFile = dockerFile.replaceAll(jreShaRegex, "\$1${params.oracle_jre_sha}")
writeFile(file: dockerFileLocation, text: dockerFile)
}