summaryrefslogtreecommitdiffstats
path: root/jjb/releng/opnfv-docker.sh
diff options
context:
space:
mode:
authorAric Gardner <agardner@linuxfoundation.org>2017-11-08 03:19:21 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-11-08 03:19:21 +0000
commit43a05d45f99d31c42a11578dce3f45c74745145d (patch)
tree1e54d7bf2c6d66e50900a21416c416aa8c3d357d /jjb/releng/opnfv-docker.sh
parent3ade521d53d4ed4fd8df232dff75a1869dc01e56 (diff)
parentf7068f8a89d2d5f83a2b2d26477ee17ccbe85efe (diff)
Merge "Refactor arch-specific Dockerfile patching"
Diffstat (limited to 'jjb/releng/opnfv-docker.sh')
-rw-r--r--jjb/releng/opnfv-docker.sh21
1 files changed, 7 insertions, 14 deletions
diff --git a/jjb/releng/opnfv-docker.sh b/jjb/releng/opnfv-docker.sh
index 402099a91..6be6b18d8 100644
--- a/jjb/releng/opnfv-docker.sh
+++ b/jjb/releng/opnfv-docker.sh
@@ -54,20 +54,13 @@ if [[ -n "$(docker images | grep $DOCKER_REPO_NAME)" ]]; then
done
fi
-cd $WORKSPACE/$DOCKER_DIR
-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
+cd "$WORKSPACE/$DOCKER_DIR" || exit 1
+HOST_ARCH="$(uname -m)"
+#If there is a patch for other arch then x86, apply the patch and
+#replace Dockerfile file
+dockerfile_patch="Dockerfile.${HOST_ARCH}.patch"
+if [[ -f "${dockerfile_patch}" ]]; then
+ patch -f Dockerfile -p1 < "${dockerfile_patch}"
fi
# Get tag version