summaryrefslogtreecommitdiffstats
path: root/policy-common
diff options
context:
space:
mode:
authorPaul Vaduva <Paul.Vaduva@enea.com>2019-06-27 18:00:57 +0200
committerCristina Pauna <cristina.pauna@enea.com>2019-09-05 22:14:56 +0300
commit4da9d4476fe968d3b915f7ca28b22bb322899614 (patch)
tree4db52be328d455f2244395f76f387f183c4ffc39 /policy-common
parent1f89af3b9916cd2b0198aa3a9491946f33c3f7cc (diff)
Multiplatform support for policy
Add multiplatfrom support for policy-base and policy-common docker images: - the pom.xml files are modified to push and pull from dockerhub instead of nexus repository (as nexus lacks support for manifest list) - for each image that is built with maven, an arch suffix is added to the tag. The currently supported architectures are amd64 and arm64. - the creation of the timestamped tag is moved from the pom.xml files to the docker_push_manifest.sh script - for each image built via the Jenkins CI jobs, the docker_push_manifest.sh is called. The script pushes a manifest list for each tag, plus it creates the timestamp tags for SNAPSHOT or STAGING images, depending on what job called the script (merge job, or stag job) For using the images, the name of the manifest list is to be used (which is the same as the current images in nexus) Issue-ID: POLICY-1997 Change-Id: If54e7ee6ac432a999844d3584e146a90e2247323 Signed-off-by: Paul Vaduva <Paul.Vaduva@enea.com> Signed-off-by: Cristina Pauna <cristina.pauna@enea.com> Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'policy-common')
-rw-r--r--policy-common/alpine/pom.xml17
-rw-r--r--policy-common/alpine/src/main/docker/Dockerfile4
-rw-r--r--policy-common/pom.xml7
3 files changed, 16 insertions, 12 deletions
diff --git a/policy-common/alpine/pom.xml b/policy-common/alpine/pom.xml
index bc4211b7..b36221c4 100644
--- a/policy-common/alpine/pom.xml
+++ b/policy-common/alpine/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.policy.docker</groupId>
<artifactId>policy-common</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>2.0.0-SNAPSHOT</version>
</parent>
<packaging>pom</packaging>
@@ -43,7 +43,7 @@
<version>1.0</version>
<executions>
<execution>
- <phase>validate</phase>
+ <phase>pre-clean</phase>
<goals>
<goal>execute</goal>
</goals>
@@ -62,6 +62,12 @@
}
println 'New tag for docker: ' + project.properties['project.docker.latesttag.version'];
+ if ( "aarch64".equals(System.properties['os.arch']) ) {
+ project.properties['project.docker.arch'] = "arm64";
+ } else {
+ project.properties['project.docker.arch'] = System.properties['os.arch'];
+ }
+ println 'Using arch for docker: ' + project.properties['project.docker.arch'];
</source>
</configuration>
</execution>
@@ -79,14 +85,13 @@
<pushRegistry>${docker.push.registry}</pushRegistry>
<images>
<image>
- <name>onap/policy-common-alpine</name>
+ <name>onap/policy-common-alpine:latest-${project.docker.arch}</name>
<build>
<cleanup>try</cleanup>
<dockerFile>Dockerfile</dockerFile>
<tags>
- <tag>${project.version}</tag>
- <tag>${project.version}-${maven.build.timestamp}</tag>
- <tag>${project.docker.latesttag.version}</tag>
+ <tag>${project.version}-${project.docker.arch}</tag>
+ <tag>${project.docker.latesttag.version}-${project.docker.arch}</tag>
</tags>
<args>
<BUILD_VERSION>${docker.build.version}</BUILD_VERSION>
diff --git a/policy-common/alpine/src/main/docker/Dockerfile b/policy-common/alpine/src/main/docker/Dockerfile
index 96f4df53..ba8d2d17 100644
--- a/policy-common/alpine/src/main/docker/Dockerfile
+++ b/policy-common/alpine/src/main/docker/Dockerfile
@@ -17,9 +17,9 @@
# ============LICENSE_END=========================================================
#
-# Docker file to build an image that contains commom packages for Policy components
+# Docker file to build an image that contains common packages for Policy components
#
-FROM onap/policy-base-alpine
+FROM onap/policy-base-alpine:latest-${project.docker.arch}
LABEL maintainer="Policy Team"
diff --git a/policy-common/pom.xml b/policy-common/pom.xml
index 433fd00f..d63bf4e5 100644
--- a/policy-common/pom.xml
+++ b/policy-common/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.onap.policy.docker</groupId>
<artifactId>docker</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>policy-common</artifactId>
@@ -37,9 +37,8 @@
<docker.skip>false</docker.skip>
<docker.skip.build>false</docker.skip.build>
<docker.skip.push>false</docker.skip.push>
- <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
- <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
- <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
+ <docker.pull.registry>docker.io</docker.pull.registry>
+ <docker.push.registry>docker.io</docker.push.registry>
<docker.build.version>${project.version}</docker.build.version>
</properties>