25 lines
907 B
Bash
25 lines
907 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
|
|
# recupérer le commit sur l'url
|
|
# par exemple :
|
|
# URL : https://github.com/odoo/docker/tree/b8b9102bf64e67d7baeaa410ff506dbe16fa8dfe/18.0
|
|
# Commit ! b8b9102bf64e67d7baeaa410ff506dbe16fa8dfe
|
|
#
|
|
|
|
COMMIT="b8b9102bf64e67d7baeaa410ff506dbe16fa8dfe"
|
|
BASE="https://raw.githubusercontent.com/odoo/docker/${COMMIT}/18.0"
|
|
DEST="./"
|
|
FILES=(Dockerfile entrypoint.sh odoo.conf wait-for-psql.py)
|
|
|
|
mkdir -p "${DEST}"
|
|
for f in "${FILES[@]}"; do
|
|
curl -fsSL "${BASE}/${f}" -o "${DEST}/${f}"
|
|
done
|
|
chmod +x "${DEST}/entrypoint.sh" "${DEST}/wait-for-psql.py"
|
|
|
|
sed -i 's/curl \\/curl vim \\/' "${DEST}/Dockerfile"
|
|
sed -i 's|^COPY \./entrypoint\.sh /$|COPY ./requirements.txt /tmp/requirements.txt\nRUN pip install --no-cache-dir --break-system-packages -r /tmp/requirements.txt\nCOPY ./entrypoint.sh /|' "${DEST}/Dockerfile"
|
|
|
|
echo "OK. ${#FILES[@]} fichiers dans ${DEST}"
|