Verified Commit 8294f617 authored by Kevin Morris's avatar Kevin Morris
Browse files

feat(docker): configure fastapi's commit_hash based on $COMMIT_HASH


Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
parent ffdd157f
......@@ -6,3 +6,4 @@ AURWEB_FASTAPI_PREFIX=https://localhost:8444
AURWEB_SSHD_PREFIX=ssh://aur@localhost:2222
GIT_DATA_DIR="./aur.git/"
TEST_RECURSION_LIMIT=10000
COMMIT_HASH=
......@@ -54,6 +54,7 @@ deploy:
AURWEB_PHP_PREFIX: https://aur-dev.archlinux.org
AURWEB_FASTAPI_PREFIX: https://aur-dev.archlinux.org
AURWEB_SSHD_PREFIX: ssh://aur@aur-dev.archlinux.org:2222
COMMIT_HASH: $CI_COMMIT_SHA
script:
- pacman -Syu --noconfirm docker-compose socat openssh
- chmod 600 ${SSH_KEY}
......
......@@ -48,6 +48,7 @@ services:
fastapi:
restart: always
environment:
- COMMIT_HASH=$COMMIT_HASH
- FASTAPI_BACKEND="gunicorn"
- FASTAPI_WORKERS=${FASTAPI_WORKERS}
- AURWEB_FASTAPI_PREFIX=${AURWEB_FASTAPI_PREFIX}
......
......@@ -11,6 +11,10 @@ sed -ri "s;^(aur_location) = .+;\1 = ${AURWEB_FASTAPI_PREFIX};" conf/config
sed -ri 's/^(cache) = .+/\1 = redis/' conf/config
sed -ri 's|^(redis_address) = .+|\1 = redis://redis|' conf/config
if [ "$COMMIT_HASH" ]; then
sed -ri "s/^;?(commit_hash) =.*$/\1 = $COMMIT_HASH/" conf/config
fi
sed -ri "s|^(git_clone_uri_anon) = .+|\1 = ${AURWEB_FASTAPI_PREFIX}/%s.git|" conf/config.defaults
sed -ri "s|^(git_clone_uri_priv) = .+|\1 = ${AURWEB_SSHD_PREFIX}/%s.git|" conf/config.defaults
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment