Compare commits

..

2 Commits

Author SHA1 Message Date
ec4d3806ce
Merge pull request 'do not recreate docker runner group and user' (!75) from do-no-recreate-group-and-user into master
All checks were successful
rvr-nextgen/pipeline/tag This commit looks good
rvr-nextgen/pipeline/head This commit looks good
Reviewed-on: #75
2024-03-11 00:15:07 +01:00
0c2334502d
do not recreate docker runner group and user
All checks were successful
rvr-nextgen/pipeline/pr-master This commit looks good
2024-03-10 23:53:11 +01:00
2 changed files with 16 additions and 8 deletions

View File

@ -16,10 +16,14 @@ echo "Migrating DB..."
./rvr db:migrate ./rvr db:migrate
echo "Set runner user based on owner of .env..." echo "Set runner user based on owner of .env..."
USER_UID=$(stat -c "%u" .env) if ! getent group rvr; then
USER_GID=$(stat -c "%g" .env) USER_GID=$(stat -c "%g" .env)
groupadd --gid $USER_GID rvr groupadd --gid $USER_GID rvr
useradd --uid $USER_UID --gid $USER_GID rvr fi
if ! id -u rvr; then
USER_UID=$(stat -c "%u" .env)
useradd --uid $USER_UID --gid $USER_GID rvr
fi
sed -i -e "s/^user = .*$/user = rvr/g" -e "s/^group = .*$/group = rvr/g" /etc/php/8.1/fpm/pool.d/www.conf sed -i -e "s/^user = .*$/user = rvr/g" -e "s/^group = .*$/group = rvr/g" /etc/php/8.1/fpm/pool.d/www.conf
set +e set +e

View File

@ -9,10 +9,14 @@ echo "Installing crontab..."
/usr/bin/crontab docker/scripts/cron /usr/bin/crontab docker/scripts/cron
echo "Set runner user based on owner of .env..." echo "Set runner user based on owner of .env..."
USER_UID=$(stat -c "%u" .env) if ! getent group rvr; then
USER_GID=$(stat -c "%g" .env) USER_GID=$(stat -c "%g" .env)
groupadd --gid $USER_GID rvr groupadd --gid $USER_GID rvr
useradd --uid $USER_UID --gid $USER_GID rvr fi
if ! id -u rvr; then
USER_UID=$(stat -c "%u" .env)
useradd --uid $USER_UID --gid $USER_GID rvr
fi
chown -R rvr:rvr cache chown -R rvr:rvr cache
sed -i -e "s/^user = .*$/user = rvr/g" -e "s/^group = .*$/group = rvr/g" /etc/php/8.1/fpm/pool.d/www.conf sed -i -e "s/^user = .*$/user = rvr/g" -e "s/^group = .*$/group = rvr/g" /etc/php/8.1/fpm/pool.d/www.conf