Merge pull request #18 from ERPLibre/fix_docker_poetry_1_0_10
[FIX] install locally poetry to force version 1.0.10
This commit is contained in:
commit
26029241e8
12 changed files with 51 additions and 20 deletions
|
|
@ -11,6 +11,9 @@ services:
|
||||||
PASSWORD: mysecretpassword
|
PASSWORD: mysecretpassword
|
||||||
USER: odoo
|
USER: odoo
|
||||||
POSTGRES_DB: postgres
|
POSTGRES_DB: postgres
|
||||||
|
STOP_BEFORE_INIT: "False"
|
||||||
|
DB_NAME: ""
|
||||||
|
UPDATE_ALL_DB: "False"
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
command: odoo
|
command: odoo
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' > /etc/
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install npm dependencies
|
# Install npm dependencies
|
||||||
RUN sudo npm install -g rtlcss less \
|
RUN npm install -g rtlcss less \
|
||||||
&& ln -fs /usr/local/bin/lessc /usr/bin/lessc
|
&& ln -fs /usr/local/bin/lessc /usr/bin/lessc
|
||||||
|
|
||||||
# Install python with pyenv
|
# Install python with pyenv
|
||||||
|
|
@ -114,7 +114,7 @@ RUN groupadd --gid 101 --force odoo && \
|
||||||
|
|
||||||
# TODO delete poetry installation
|
# TODO delete poetry installation
|
||||||
# Install Poetry
|
# Install Poetry
|
||||||
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
|
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - -y --preview --version 1.0.10
|
||||||
#curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
|
#curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
|
||||||
|
|
||||||
# Copy entrypoint script and Odoo configuration file
|
# Copy entrypoint script and Odoo configuration file
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@ FROM technolibre/erplibre-base:1.1.0
|
||||||
|
|
||||||
ENV REPO_MANIFEST_URL http://git.erplibre.ca/ERPLibre
|
ENV REPO_MANIFEST_URL http://git.erplibre.ca/ERPLibre
|
||||||
ARG WORKING_BRANCH
|
ARG WORKING_BRANCH
|
||||||
|
ARG WORKING_HASH
|
||||||
ENV BRANCH_ERPLIBRE $WORKING_BRANCH
|
ENV BRANCH_ERPLIBRE $WORKING_BRANCH
|
||||||
|
ENV COMMIT_ERPLIBRE $WORKING_HASH
|
||||||
|
|
||||||
RUN cat /etc/os-release
|
RUN cat /etc/os-release
|
||||||
|
|
||||||
|
|
@ -12,13 +14,15 @@ RUN mkdir ~/.ssh/ && \
|
||||||
echo "StrictHostKeyChecking no" >> ~/.ssh/config && \
|
echo "StrictHostKeyChecking no" >> ~/.ssh/config && \
|
||||||
apt update && \
|
apt update && \
|
||||||
apt install ssh-client git -y --no-install-recommends && \
|
apt install ssh-client git -y --no-install-recommends && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN cd ; mkdir -p .bin/ && \
|
RUN cd ; mkdir -p .bin/ && \
|
||||||
git config --global color.ui false && \
|
git config --global color.ui false && \
|
||||||
git config --global user.email "foo@bar.io" && \
|
git config --global user.email "foo@bar.io" && \
|
||||||
git config --global user.name "Foo Bar" && \
|
git config --global user.name "Foo Bar" && \
|
||||||
git clone $REPO_MANIFEST_URL -b $BRANCH_ERPLIBRE $ODOO_PREFIX
|
if [ "$BRANCH_ERPLIBRE" = "HEAD" ]; then git clone $REPO_MANIFEST_URL $ODOO_PREFIX ; else git clone $REPO_MANIFEST_URL -b $BRANCH_ERPLIBRE $ODOO_PREFIX; fi && \
|
||||||
|
cd $ODOO_PREFIX && \
|
||||||
|
git checkout $COMMIT_ERPLIBRE
|
||||||
|
|
||||||
RUN cd $ODOO_PREFIX && \
|
RUN cd $ODOO_PREFIX && \
|
||||||
python -m venv .venv
|
python -m venv .venv
|
||||||
|
|
|
||||||
|
|
@ -71,14 +71,29 @@ case "$1" in
|
||||||
exec odoo "$@" || exec odoo-bin "$@"
|
exec odoo "$@" || exec odoo-bin "$@"
|
||||||
else
|
else
|
||||||
cd $ODOO_PREFIX
|
cd $ODOO_PREFIX
|
||||||
|
if [[ "${STOP_BEFORE_INIT}" == "True" ]] ; then
|
||||||
|
sleep 999999
|
||||||
|
fi
|
||||||
./docker/wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
./docker/wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
||||||
exec ./.venv/bin/python $ODOO_EXEC_BIN "$@" "${DB_ARGS[@]}" -c /etc/odoo/odoo.conf
|
if [[ "${UPDATE_ALL_DB}" == "True" ]] ; then
|
||||||
|
# --stop-after-init
|
||||||
|
exec ./.venv/bin/python $ODOO_EXEC_BIN "$@" "${DB_ARGS[@]}" -c /etc/odoo/odoo.conf -u all -d "${DB_NAME}"
|
||||||
|
else
|
||||||
|
exec ./.venv/bin/python $ODOO_EXEC_BIN "$@" "${DB_ARGS[@]}" -c /etc/odoo/odoo.conf
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
cd $ODOO_PREFIX
|
cd $ODOO_PREFIX
|
||||||
|
if [[ "${STOP_BEFORE_INIT}" == "True" ]] ; then
|
||||||
|
sleep 999999
|
||||||
|
fi
|
||||||
./docker/wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
./docker/wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
||||||
exec ./.venv/bin/python $ODOO_EXEC_BIN "$@" "${DB_ARGS[@]}" -c /etc/odoo/odoo.conf
|
if [[ "${UPDATE_ALL_DB}" == "True" ]] ; then
|
||||||
|
exec ./.venv/bin/python $ODOO_EXEC_BIN "$@" "${DB_ARGS[@]}" -c /etc/odoo/odoo.conf -u all -d "${DB_NAME}"
|
||||||
|
else
|
||||||
|
exec ./.venv/bin/python $ODOO_EXEC_BIN "$@" "${DB_ARGS[@]}" -c /etc/odoo/odoo.conf
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
||||||
|
|
@ -446,13 +446,13 @@ max_cron_threads = 1
|
||||||
# Prevents the worker from using more than <limit> CPU seconds for each
|
# Prevents the worker from using more than <limit> CPU seconds for each
|
||||||
# request. If the limit is exceeded, the worker is killed
|
# request. If the limit is exceeded, the worker is killed
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
limit_time_cpu = 600
|
limit_time_cpu = 2400
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Prevents the worker from taking longer than <limit> seconds to process a
|
# Prevents the worker from taking longer than <limit> seconds to process a
|
||||||
# request. If the limit is exceeded, the worker is killed.
|
# request. If the limit is exceeded, the worker is killed.
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
limit_time_real = 900
|
limit_time_real = 3600
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Maximum allowed virtual memory per worker. If the limit is exceeded, the
|
# Maximum allowed virtual memory per worker. If the limit is exceeded, the
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,22 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
. ./env_var.sh
|
. ./env_var.sh
|
||||||
|
|
||||||
|
ARGS=""
|
||||||
|
|
||||||
|
for arg in "$@"
|
||||||
|
do
|
||||||
|
if [ "$arg" == "--no-cache" ]
|
||||||
|
then
|
||||||
|
ARGS="${ARGS} --no-cache"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Rewrite docker-compose
|
# Rewrite docker-compose
|
||||||
./script/docker_update_version.py --version=${ERPLIBRE_VERSION} --base=${ERPLIBRE_DOCKER_BASE} --prod=${ERPLIBRE_DOCKER_PROD}
|
./script/docker_update_version.py --version=${ERPLIBRE_VERSION} --base=${ERPLIBRE_DOCKER_BASE} --prod=${ERPLIBRE_DOCKER_PROD}
|
||||||
|
|
||||||
cd docker
|
cd docker
|
||||||
|
|
||||||
ARGS=--build-arg=WORKING_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
ARGS="${ARGS} --build-arg=WORKING_BRANCH=$(git rev-parse --abbrev-ref HEAD) --build-arg=WORKING_HASH=$(git rev-parse --verify HEAD)"
|
||||||
|
|
||||||
# Clear cache
|
|
||||||
# ARGS="${ARGS} --no-cache"
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,7 @@ PYTHON_EXEC=${PYENV_VERSION_PATH}/bin/python
|
||||||
POETRY_PATH=~/.poetry
|
POETRY_PATH=~/.poetry
|
||||||
VENV_PATH=./.venv
|
VENV_PATH=./.venv
|
||||||
VENV_REPO_PATH=${VENV_PATH}/repo
|
VENV_REPO_PATH=${VENV_PATH}/repo
|
||||||
|
POETRY_VERSION=1.0.10
|
||||||
|
|
||||||
if [[ ! -d "${PYENV_PATH}" ]]; then
|
if [[ ! -d "${PYENV_PATH}" ]]; then
|
||||||
echo -e "\n---- Installing pyenv in ${PYENV_PATH} ----"
|
echo -e "\n---- Installing pyenv in ${PYENV_PATH} ----"
|
||||||
|
|
@ -198,10 +199,11 @@ fi
|
||||||
pyenv local 3.7.7
|
pyenv local 3.7.7
|
||||||
|
|
||||||
if [[ ! -d "${POETRY_PATH}" ]]; then
|
if [[ ! -d "${POETRY_PATH}" ]]; then
|
||||||
|
# Delete directory ~/.poetry and .venv to force update to new version
|
||||||
echo -e "\n---- Installing poetry for reliable python package ----"
|
echo -e "\n---- Installing poetry for reliable python package ----"
|
||||||
# curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | ${PYTHON_EXEC}
|
# curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | ${PYTHON_EXEC}
|
||||||
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
|
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
|
||||||
python get-poetry.py -y --preview
|
python get-poetry.py -y --preview --version ${POETRY_VERSION}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -d ${VENV_PATH} ]]; then
|
if [[ ! -d ${VENV_PATH} ]]; then
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,6 @@
|
||||||
#EL_MANIFEST_DEV="./manifest/default.dev.xml"
|
#EL_MANIFEST_DEV="./manifest/default.dev.xml"
|
||||||
|
|
||||||
# Update git-repo
|
# Update git-repo
|
||||||
./.venv/repo init -u http://git.erplibre.ca/ERPLibre -b $(git rev-parse --abbrev-ref HEAD) -m ${EL_MANIFEST_DEV}
|
./.venv/repo init -u http://git.erplibre.ca/ERPLibre -b $(git rev-parse --verify HEAD) -m ${EL_MANIFEST_DEV}
|
||||||
#./.venv/repo sync --force-sync
|
#./.venv/repo sync --force-sync
|
||||||
./.venv/repo sync --force-sync -v
|
./.venv/repo sync --force-sync -v
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose &
|
git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose &
|
||||||
DAEMON_PID=$!
|
DAEMON_PID=$!
|
||||||
|
|
||||||
./.venv/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --abbrev-ref HEAD) -m ${EL_MANIFEST_DEV}
|
./.venv/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --verify HEAD) -m ${EL_MANIFEST_DEV}
|
||||||
./.venv/repo sync -v --force-sync -m ${EL_MANIFEST_DEV}
|
./.venv/repo sync -v --force-sync -m ${EL_MANIFEST_DEV}
|
||||||
|
|
||||||
kill ${DAEMON_PID}
|
kill ${DAEMON_PID}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose &
|
git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose &
|
||||||
DAEMON_PID=$!
|
DAEMON_PID=$!
|
||||||
|
|
||||||
./.venv/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --abbrev-ref HEAD) -m ${EL_MANIFEST_EXP}
|
./.venv/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --verify HEAD) -m ${EL_MANIFEST_EXP}
|
||||||
./.venv/repo sync -v --force-sync -m ${EL_MANIFEST_EXP}
|
./.venv/repo sync -v --force-sync -m ${EL_MANIFEST_EXP}
|
||||||
|
|
||||||
kill ${DAEMON_PID}
|
kill ${DAEMON_PID}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose &
|
git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose &
|
||||||
DAEMON_PID=$!
|
DAEMON_PID=$!
|
||||||
|
|
||||||
./.venv/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --abbrev-ref HEAD) -m ${EL_MANIFEST_PROD}
|
./.venv/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --verify HEAD) -m ${EL_MANIFEST_PROD}
|
||||||
./.venv/repo sync -v -m ${EL_MANIFEST_PROD}
|
./.venv/repo sync -v -m ${EL_MANIFEST_PROD}
|
||||||
|
|
||||||
kill ${DAEMON_PID}
|
kill ${DAEMON_PID}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,6 @@
|
||||||
#EL_MANIFEST_DEV="./manifest/default.dev.xml"
|
#EL_MANIFEST_DEV="./manifest/default.dev.xml"
|
||||||
|
|
||||||
# Update git-repo
|
# Update git-repo
|
||||||
./.venv/repo init -u http://git.erplibre.ca/ERPLibre -b $(git rev-parse --abbrev-ref HEAD)
|
./.venv/repo init -u http://git.erplibre.ca/ERPLibre -b $(git rev-parse --verify HEAD)
|
||||||
#./.venv/repo sync --force-sync
|
#./.venv/repo sync --force-sync
|
||||||
./.venv/repo sync -v
|
./.venv/repo sync -v
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue