From: yangyan Date: Fri, 10 May 2019 09:07:54 +0000 (+0800) Subject: Add ARG and PKG_VERSION to Dockerfile X-Git-Tag: 1.0.2~5 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=modeling%2Fetsicatalog.git;a=commitdiff_plain;h=51a5b243a40535f2a8b7133deed8deae2a6f765f Add ARG and PKG_VERSION to Dockerfile Change-Id: I260ab6b5a2c9d7cb464649eda0ff96d1412e57af Issue-ID: VFC-1383 Signed-off-by: yangyan --- diff --git a/docker/Dockerfile b/docker/Dockerfile index 98bea25..6631641 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,8 +2,10 @@ FROM python:2-alpine ARG HTTP_PROXY=${HTTP_PROXY} ARG HTTPS_PROXY=${HTTPS_PROXY} +ARG PKG_VERSION ENV http_proxy $HTTP_PROXY ENV https_proxy $HTTPS_PROXY +ENV pkg_version=${PKG_VERSION} ADD . /service WORKDIR /service diff --git a/docker/build_image.sh b/docker/build_image.sh index 17ef9a7..e4538d0 100755 --- a/docker/build_image.sh +++ b/docker/build_image.sh @@ -13,6 +13,8 @@ DOCKER_REPOSITORY="nexus3.onap.org:10003" IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}" TIMESTAMP=$(date +"%Y%m%dT%H%M%S") +BUILD_ARGS+=" --build-arg PKG_VERSION=${VERSION}" + if [ $HTTP_PROXY ]; then BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}" fi diff --git a/docker/docker-env-conf.sh b/docker/docker-env-conf.sh index fe35ff9..51f98c5 100755 --- a/docker/docker-env-conf.sh +++ b/docker/docker-env-conf.sh @@ -8,7 +8,7 @@ install_sf(){ # get binary zip from nexus - vfc-nfvo-genericparser - wget -q -O modeling-genericparser.zip 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.modeling.genericparser&a=modeling-genericparser&e=zip&v=1.0.1-SNAPSHOT' && \ + wget -q -O modeling-genericparser.zip 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.modeling.genericparser&a=modeling-genericparser&e=zip&v=${pkg_version}-SNAPSHOT&e=zip' && \ unzip modeling-genericparser.zip && \ rm -rf modeling-genericparser.zip && \ pip install --upgrade setuptools pip && \