From ebe94200e2d74dea2684e1130b60bd7a97e3cb6a Mon Sep 17 00:00:00 2001 From: George Adams Date: Wed, 16 Jun 2021 13:23:05 +0100 Subject: [PATCH] Add dockerfile build support for Ubuntu16.04 --- Jenkinsfile | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 33c249b442..830f2908dc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,28 +3,44 @@ pipeline { stages { stage('Docker Build') { parallel { - stage('Linux x64') { + stage('CentOS7 x64') { agent { label "dockerBuild&&linux&&x64" } steps { - dockerBuild('amd64') + dockerBuild('amd64', 'centos7', 'Dockerfile.CentOS7') } } - stage('Linux aarch64') { + stage('Ubuntu16.04 x64') { agent { label "dockerBuild&&linux&&aarch64" } steps { - dockerBuild('arm64') + dockerBuild('x64', 'ubuntu1604', 'Dockerfile.Ubuntu1604') } } - stage('Linux ppc64le') { + stage('CentOS7 aarch64') { + agent { + label "dockerBuild&&linux&&aarch64" + } + steps { + dockerBuild('arm64', 'centos7', 'Dockerfile.CentOS7') + } + } + stage('Ubuntu16.04 aarch64') { + agent { + label "dockerBuild&&linux&&aarch64" + } + steps { + dockerBuild('arm64', 'ubuntu1604', 'Dockerfile.Ubuntu1604') + } + } + stage('CentOS7 ppc64le') { agent { label "dockerBuild&&linux&&ppc64le" } steps { - dockerBuild('ppc64le') + dockerBuild('ppc64le', 'centos7', 'Dockerfile.CentOS7') } } } @@ -43,12 +59,12 @@ pipeline { } } -def dockerBuild(architecture) { +def dockerBuild(architecture, distro, dockerfile) { git poll: false, url: 'https://github.com/adoptium/infrastructure.git' - sh label: '', script: "docker build -t adoptopenjdk/centos7_build_image:linux-$architecture -f ansible/Dockerfile.CentOS7 ." + sh label: '', script: "docker build -t adoptopenjdk/$distro_build_image:linux-$architecture -f ansible/docker/$dockerfile ." // dockerhub is the ID of the credentials stored in Jenkins docker.withRegistry('https://index.docker.io/v1/', 'dockerhub') { - sh label: '', script: "docker push adoptopenjdk/centos7_build_image:linux-$architecture" + sh label: '', script: "docker push adoptopenjdk/$distro_build_image:linux-$architecture" } } @@ -57,6 +73,7 @@ def dockerManifest() { docker.withRegistry('https://index.docker.io/v1/', 'dockerhub') { git poll: false, url: 'https://github.com/adoptium/infrastructure.git' sh ''' + # Centos7 export TARGET="adoptopenjdk/centos7_build_image" AMD64=$TARGET:linux-amd64 ARM64=$TARGET:linux-arm64 @@ -66,6 +83,14 @@ def dockerManifest() { docker manifest annotate $TARGET $ARM64 --arch arm64 --os linux docker manifest annotate $TARGET $PPC64LE --arch ppc64le --os linux docker manifest push $TARGET + # Ubuntu1604 + export TARGET="adoptopenjdk/ubuntu1604_build_image" + AMD64=$TARGET:linux-amd64 + ARM64=$TARGET:linux-arm64 + docker manifest create $TARGET $AMD64 $ARM64 $PPC64LE + docker manifest annotate $TARGET $AMD64 --arch amd64 --os linux + docker manifest annotate $TARGET $ARM64 --arch arm64 --os linux + docker manifest push $TARGET ''' } }