aboutsummaryrefslogtreecommitdiffstats
path: root/docker_build.sh
diff options
context:
space:
mode:
authormmis <michael.morris@ericsson.com>2018-03-05 18:23:39 +0000
committermmis <michael.morris@ericsson.com>2018-03-05 18:37:45 +0000
commit0d85691073de0731e54a12e56b02b6b44807aa58 (patch)
treecafddbeb94e884d187a3911c7b05716ac8ff842d /docker_build.sh
parent26ad312c7232b44aa06e61beca114f305bd702d4 (diff)
Remove policy-os and policy-base images
Remove the policy-os and policy-base images in favour of including their contents directly in the policy-pdp and policy-pe images Issue-ID: POLICY-624 Change-Id: Ie4ef62d5a7fc0edb481be13891ee12cf9271674c Signed-off-by: mmis <michael.morris@ericsson.com>
Diffstat (limited to 'docker_build.sh')
-rwxr-xr-xdocker_build.sh108
1 files changed, 51 insertions, 57 deletions
diff --git a/docker_build.sh b/docker_build.sh
index a06f0251..5fe01bed 100755
--- a/docker_build.sh
+++ b/docker_build.sh
@@ -6,6 +6,7 @@ MVN_VERSION=$(cat target/version)
MVN_MAJMIN_VERSION=$(cut -f 1,2 -d . target/version)
TIMESTAMP=$(date -u +%Y%m%dT%H%M%S)
PROXY_ARGS=""
+IMAGE=policy-nexus
if [ $HTTP_PROXY ]; then
PROXY_ARGS+="--build-arg HTTP_PROXY=${HTTP_PROXY}"
@@ -40,71 +41,64 @@ fi
echo $MVN_MAJMIN_VERSION
-cp policy-pe/* target/policy-pe/
-cp policy-drools/* target/policy-drools/
-
-for image in policy-os policy-nexus policy-base policy-drools policy-pe ; do
- echo "Building $image"
- mkdir -p target/$image
- cp $image/* target/$image
-
- #
- # This is the local latest tagged image. The Dockerfile's need this to build images
- #
- TAGS="--tag onap/policy/${image}:latest"
- #
- # This is the nexus repo prepended for latest tagged image.
- #
- TAGS="${TAGS} --tag ${DOCKER_REPOSITORY}/onap/policy/${image}:latest"
- #
- # This has the nexus repo prepended and only major/minor version with latest
- #
- TAGS="${TAGS} --tag ${DOCKER_REPOSITORY}/onap/policy/${image}:${MVN_MAJMIN_VERSION}-latest"
- #
- # This has the nexus repo prepended and major/minor/patch version with timestamp
- #
- TAGS="${TAGS} --tag ${DOCKER_REPOSITORY}/onap/policy/${image}:${MVN_VERSION}-STAGING-${TIMESTAMP}"
-
- echo $TAGS
-
- docker build --quiet ${PROXY_ARGS} $TAGS target/$image
-
- if [ $? -ne 0 ]
- then
- echo "Docker build failed"
- docker images
- exit 1
- fi
-done
+echo "Building $IMAGE"
+mkdir -p target/$IMAGE
+cp $IMAGE/* target/$IMAGE
+
+#
+# This is the local latest tagged image. The Dockerfile's need this to build images
+#
+TAGS="--tag onap/policy/${IMAGE}:latest"
+#
+# This is the nexus repo prepended for latest tagged image.
+#
+TAGS="${TAGS} --tag ${DOCKER_REPOSITORY}/onap/policy/${IMAGE}:latest"
+#
+# This has the nexus repo prepended and only major/minor version with latest
+#
+TAGS="${TAGS} --tag ${DOCKER_REPOSITORY}/onap/policy/${IMAGE}:${MVN_MAJMIN_VERSION}-latest"
+#
+# This has the nexus repo prepended and major/minor/patch version with timestamp
+#
+TAGS="${TAGS} --tag ${DOCKER_REPOSITORY}/onap/policy/${IMAGE}:${MVN_VERSION}-STAGING-${TIMESTAMP}"
+
+echo $TAGS
+
+docker build --quiet ${PROXY_ARGS} $TAGS target/$IMAGE
+
+if [ $? -ne 0 ]
+then
+ echo "Docker build failed"
+ docker images
+ exit 1
+fi
docker images
-for image in policy-nexus policy-base policy-drools policy-pe ; do
- echo "Pushing $image"
+echo "Pushing $IMAGE"
- docker push ${DOCKER_REPOSITORY}/onap/policy/$image:latest
+docker push ${DOCKER_REPOSITORY}/onap/policy/$IMAGE:latest
- if [ $? -ne 0 ]
- then
- echo "Docker push failed"
- exit 1
+if [ $? -ne 0 ]
+then
+ echo "Docker push failed"
+ exit 1
- fi
+fi
- docker push ${DOCKER_REPOSITORY}/onap/policy/$image:${MVN_MAJMIN_VERSION}-latest
+docker push ${DOCKER_REPOSITORY}/onap/policy/$IMAGE:${MVN_MAJMIN_VERSION}-latest
- if [ $? -ne 0 ]
- then
- echo "Docker push failed"
- exit 1
+if [ $? -ne 0 ]
+then
+ echo "Docker push failed"
+ exit 1
- fi
- docker push ${DOCKER_REPOSITORY}/onap/policy/$image:${MVN_VERSION}-STAGING-${TIMESTAMP}
+fi
+docker push ${DOCKER_REPOSITORY}/onap/policy/$IMAGE:${MVN_VERSION}-STAGING-${TIMESTAMP}
- if [ $? -ne 0 ]
- then
- echo "Docker push failed"
- exit 1
+if [ $? -ne 0 ]
+then
+ echo "Docker push failed"
+ exit 1
- fi
-done
+fi