[ADD] docker_build with release

- when docker build without release, add hash of commit in version
This commit is contained in:
Mathieu Benoit 2020-11-21 00:10:55 -05:00
parent f81b257e3a
commit 0615f573d4
2 changed files with 17 additions and 4 deletions

View file

@ -1,10 +1,6 @@
#!/usr/bin/env bash
ERPLIBRE_VERSION="1.1.0"
ERPLIBRE_DOCKER_BASE="technolibre/erplibre-base"
ERPLIBRE_DOCKER_PROD="technolibre/erplibre"
ERPLIBRE_DOCKER_BASE_VERSION="${ERPLIBRE_DOCKER_BASE}:${ERPLIBRE_VERSION}"
ERPLIBRE_DOCKER_PROD_VERSION="${ERPLIBRE_DOCKER_PROD}:${ERPLIBRE_VERSION}"
EL_USER="erplibre"
EL_HOME="/${EL_USER}"

View file

@ -2,15 +2,32 @@
. ./env_var.sh
ARGS=""
IS_RELEASE=false
ERPLIBRE_DOCKER_BASE="technolibre/erplibre-base"
ERPLIBRE_DOCKER_PROD="technolibre/erplibre"
for arg in "$@"
do
if [ "$arg" == "--no-cache" ]
then
ARGS="${ARGS} --no-cache"
elif [ "$arg" == "--release" ]
then
IS_RELEASE=true
fi
done
if [ "$IS_RELEASE" == false ]
then
# Add commit hash when not a release
ERPLIBRE_VERSION="${ERPLIBRE_VERSION}_$(git rev-parse --short HEAD)"
fi
ERPLIBRE_DOCKER_BASE_VERSION="${ERPLIBRE_DOCKER_BASE}:${ERPLIBRE_VERSION}"
ERPLIBRE_DOCKER_PROD_VERSION="${ERPLIBRE_DOCKER_PROD}:${ERPLIBRE_VERSION}"
echo "Create docker ${ERPLIBRE_DOCKER_PROD_VERSION}"
# Rewrite docker-compose
./script/docker_update_version.py --version=${ERPLIBRE_VERSION} --base=${ERPLIBRE_DOCKER_BASE} --prod=${ERPLIBRE_DOCKER_PROD}