summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristina Pauna <cristina.pauna@enea.com>2017-03-09 16:45:38 +0200
committerCristina Pauna <cristina.pauna@enea.com>2017-03-13 12:36:15 +0200
commitcc3943b24290b25d716022e8f35a8fd19b253bd2 (patch)
treefa0d8b4b84ca19627326b57f8ce0913937b037a7
parent3ec2c2b06b992f24e578f7f4441a36e2363ccd73 (diff)
Allow creation of Dockerfile.aarch64 through patch
When building an aarch64 docker image an Dockerfile.aarch64 file is expected to exist. With this patch we may create it from the x86 Dockerfile by applying an aarch64 patch This feature can be used with qtip, via https://gerrit.opnfv.org/gerrit/#/c/30185/ JIRA: ARMBAND-219 Change-Id: I71e1e1852e31f92fb1f1947542f7f397b996541f Signed-off-by: Cristina Pauna <cristina.pauna@enea.com>
-rw-r--r--jjb/releng/opnfv-docker.sh16
1 files changed, 13 insertions, 3 deletions
diff --git a/jjb/releng/opnfv-docker.sh b/jjb/releng/opnfv-docker.sh
index ded743d7e..7066d37f0 100644
--- a/jjb/releng/opnfv-docker.sh
+++ b/jjb/releng/opnfv-docker.sh
@@ -53,9 +53,19 @@ if [[ -n "$(docker images | grep $DOCKER_REPO_NAME)" ]]; then
fi
cd $WORKSPACE/docker
-if [ ! -f ${DOCKERFILE} ]; then
- echo "ERROR: Dockerfile not found."
- exit 1
+HOST_ARCH=$(uname -m)
+if [ ! -f "${DOCKERFILE}" ]; then
+ # If this is expected to be a Dockerfile for other arch than x86
+ # and it does not exist, but there is a patch for the said arch,
+ # then apply the patch and create the Dockerfile.${HOST_ARCH} file
+ if [[ "${DOCKERFILE}" == *"${HOST_ARCH}" && \
+ -f "Dockerfile.${HOST_ARCH}.patch" ]]; then
+ patch -o Dockerfile."${HOST_ARCH}" Dockerfile \
+ Dockerfile."${HOST_ARCH}".patch
+ else
+ echo "ERROR: No Dockerfile or ${HOST_ARCH} patch found."
+ exit 1
+ fi
fi
# Get tag version