mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(docker): configure fastapi's commit_hash based on $COMMIT_HASH
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
b49b629395
commit
8239dcdd1b
4 changed files with 7 additions and 0 deletions
1
.env
1
.env
|
@ -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=
|
||||
|
|
|
@ -55,6 +55,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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue