aboutsummaryrefslogtreecommitdiffstats
path: root/ci/build.sh
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2020-01-26 14:25:05 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2020-01-27 14:10:02 +0000
commit279195ddeb8e459a5931430f0841724ba6c06db1 (patch)
tree1b1c33972675b172ed4c6c4758493cb5dd9c5bc8 /ci/build.sh
parente93266360b871183e29ffc0750339e4cff5b92bb (diff)
docker build, deploy: Switch tooling to python3
Python2.7 is deprecated and packages are starting to enforce py3 usage (e.g. dockermake recently started supporting only 3.6). Switch pipenv to python3, but allow pyhton3.5 by pinning dockermake to v0.8 since Ubuntu Xenial does not have python3.6 easily available. While at it, switch deploy tooling (PDF/IDF configuration parsing) from python2 to pyhton3 too and fix some jumphost package requirements. Change-Id: Id66d08d0f51a1bc35c1d78c1956df832a5536bde Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com> (cherry picked from commit fccf558f0c55c0b26448961a97d8edae3dd7db4d)
Diffstat (limited to 'ci/build.sh')
-rwxr-xr-xci/build.sh19
1 files changed, 9 insertions, 10 deletions
diff --git a/ci/build.sh b/ci/build.sh
index 8fab2ca01..6119472ec 100755
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -56,26 +56,25 @@ trap do_exit SIGINT SIGTERM EXIT
# Set no restrictive umask so that Jenkins can remove any residuals
umask 0000
-# Clone git submodules and apply our patches
-make -C "${MCP_REPO_ROOT_PATH}/mcp/patches" deepclean patches-import
-
pushd "${DEPLOY_DIR}" > /dev/null
# Install distro packages and pip-managed prerequisites
-PYTHON_BIN_PATH="$(python -m site --user-base)/bin"
-PATH="$PATH:$PYTHON_BIN_PATH"
notify "[NOTE] Installing required build-time distro and pip pkgs" 2
jumpserver_pkg_install 'build'
-python -m pip install --upgrade pipenv --user
+PYTHON_BIN_PATH="$(python3 -m site --user-base)/bin"
+PATH="$PATH:$PYTHON_BIN_PATH"
+# Clone git submodules and apply our patches
+make -C "${MCP_REPO_ROOT_PATH}/mcp/patches" deepclean patches-import
+python3 -m pip install --upgrade pipenv --user
docker_install
popd > /dev/null
pushd "${DOCKER_DIR}" > /dev/null
-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
+env PIPENV_HIDE_EMOJIS=1 VIRTUALENV_ALWAYS_COPY=1 python3 -m pipenv --three install
+env PIPENV_HIDE_EMOJIS=1 VIRTUALENV_ALWAYS_COPY=1 python3 -m pipenv install invoke
# shellcheck disable=SC2086
-env PIPENV_HIDE_EMOJIS=1 python -m pipenv run \
+env PIPENV_HIDE_EMOJIS=1 python3 -m pipenv run \
invoke build saltmaster-reclass \
--require 'salt salt-formulas opnfv reclass tini-saltmaster' \
--dist=ubuntu \
@@ -87,7 +86,7 @@ env PIPENV_HIDE_EMOJIS=1 python -m pipenv run \
CACHE_INVALIDATE=\"${CACHE_INVALIDATE}\"" \
${DOCKER_PUSH}
-env PIPENV_HIDE_EMOJIS=1 python -m pipenv run \
+env PIPENV_HIDE_EMOJIS=1 python3 -m pipenv run \
invoke build saltminion-maas \
--require 'maas' \
--dist=ubuntu \