[FIX] docker can checkout specific commit, like a tag

This commit is contained in:
Mathieu Benoit 2020-10-25 02:28:41 -04:00
parent 8facd58991
commit ec17f91bd4
7 changed files with 14 additions and 10 deletions

View 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

View file

@ -16,7 +16,7 @@ done
cd docker cd docker
ARGS="${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)"
set -e set -e

View file

@ -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

View file

@ -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}

View file

@ -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}

View file

@ -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}

View file

@ -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