aboutsummaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-11-21 16:57:10 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-11-21 18:14:15 +0100
commitf03a33bc58135acc7e4420efaaf34c26a32d6142 (patch)
tree8c302374639934a4d842bc79f9b8ebf4e6d957db /ci
parent3fef67294b7e2b880217e2e1e0cafee6e4d6e9bc (diff)
[docker] build: Allow cache invalidation
While at it, fix emoji issues with latest virtualenv [1]. JIRA: FUEL-398 [1] https://github.com/pypa/pipenv/issues/3223 Change-Id: Ice5937222bf75c1ddadc6b9f1994635bc10faf57 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/build.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/ci/build.sh b/ci/build.sh
index 67b6d46d8..108ce139a 100755
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -32,12 +32,14 @@ DEPLOY_DIR=$(cd "${MCP_REPO_ROOT_PATH}/mcp/scripts"; pwd)
DOCKER_DIR=$(cd "${MCP_REPO_ROOT_PATH}/docker"; pwd)
DOCKER_TAG=${1:-latest}
DOCKER_PUSH=${2---push} # pass an empty second arg to disable push
+CACHE_INVALIDATE=${CACHE_INVALIDATE:-0}
source "${DEPLOY_DIR}/globals.sh"
source "${DEPLOY_DIR}/lib.sh"
source "${DEPLOY_DIR}/lib_jump_common.sh"
[ ! "${TERM:-unknown}" = 'unknown' ] || export TERM=vt220
+[ "${CACHE_INVALIDATE}" = 0 ] || CACHE_INVALIDATE=$(date +%s)
#
# END of variables to customize
@@ -69,11 +71,10 @@ docker_install
popd > /dev/null
pushd "${DOCKER_DIR}" > /dev/null
-python -m pipenv --two
-env VIRTUALENV_ALWAYS_COPY=1 python -m pipenv install
-env VIRTUALENV_ALWAYS_COPY=1 python -m pipenv install invoke
+env PIPENV_HIDE_EMOJIS=1 VIRTUALENV_ALWAYS_COPY=1 python -m pipenv --two install
+env PIPENV_HIDE_EMOJIS=1 VIRTUALENV_ALWAYS_COPY=1 python -m pipenv install invoke
# shellcheck disable=SC2086
-python -m pipenv run \
+env PIPENV_HIDE_EMOJIS=1 python -m pipenv run \
invoke build saltmaster-reclass \
--require 'salt salt-formulas opnfv reclass tini-saltmaster' \
--dist=ubuntu \
@@ -81,6 +82,8 @@ python -m pipenv run \
--formula-rev=nightly \
--opnfv-tag="${DOCKER_TAG}" \
--salt='stable 2017.7' \
+ --build-arg-extra " \
+ CACHE_INVALIDATE=\"${CACHE_INVALIDATE}\"" \
${DOCKER_PUSH}
popd > /dev/null