From 7cdae555806b7fb642460845961295992c6f7f34 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Thu, 22 Mar 2018 14:16:40 -0700 Subject: [PATCH] Updating with binary compile in the bash script Adding build commands within the bash script This will then be called in the nightly docker push Issue-ID: AAF-100 Change-Id: Iab29de26c7f9feac1b3f76666f1674ad7a267da8 Signed-off-by: Kiran Kamineni --- sms-service/bin/Dockerfile | 2 +- sms-service/bin/build_image.sh | 15 ++++++++++++++- sms-service/bin/make_build_image.sh | 9 --------- 3 files changed, 15 insertions(+), 11 deletions(-) delete mode 100755 sms-service/bin/make_build_image.sh diff --git a/sms-service/bin/Dockerfile b/sms-service/bin/Dockerfile index d663f80..cbc9454 100644 --- a/sms-service/bin/Dockerfile +++ b/sms-service/bin/Dockerfile @@ -7,7 +7,7 @@ LABEL maintainer="vamshi krishna " EXPOSE 10443 -ADD auth /sms/auth/ +RUN mkdir -p /sms/auth ADD sms /sms/bin/sms RUN chmod +x /sms/bin/sms diff --git a/sms-service/bin/build_image.sh b/sms-service/bin/build_image.sh index 3e29c0c..7a9ddba 100755 --- a/sms-service/bin/build_image.sh +++ b/sms-service/bin/build_image.sh @@ -20,6 +20,17 @@ if [ $HTTPS_PROXY ]; then BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}" fi +function generate_binary { + pushd ../src/sms + make build + popd + cp ../target/sms . +} + +function remove_binary { + rm sms +} + function build_image { echo "Start build docker image: ${IMAGE_NAME}" docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:latest . @@ -41,5 +52,7 @@ function push_image { push_image_tag ${IMAGE_NAME}:${VERSION}-STAGING-${TIMESTAMP} } +generate_binary build_image -#push_image \ No newline at end of file +push_image +remove_binary \ No newline at end of file diff --git a/sms-service/bin/make_build_image.sh b/sms-service/bin/make_build_image.sh deleted file mode 100755 index 5281f42..0000000 --- a/sms-service/bin/make_build_image.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -DIRNAME=`dirname $0` -DOCKER_BUILD_DIR=`cd $DIRNAME/; pwd` -cd ${DOCKER_BUILD_DIR} - -(cd ../src/sms && make build) -cp ../target/sms . - -sudo ./build_image.sh -- 2.16.6