Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5979462f0 | ||
|
|
c726bfdbd7 | ||
|
|
c0579c502f |
@@ -110,9 +110,18 @@ run chmod -R g+rwX "$host_release"
|
||||
run ln -s ../../shared/.env "$host_release/.env"
|
||||
run ln -s ../../shared/storage "$host_release/storage"
|
||||
|
||||
# PHP runs as uid/gid 1000 inside the container. act_runner often owns
|
||||
# shared/.env as 0600, which makes env() empty and config:cache write NULLs.
|
||||
run chgrp "$php_group" "$DEPLOY_ROOT/shared/.env"
|
||||
run chmod 640 "$DEPLOY_ROOT/shared/.env"
|
||||
|
||||
run docker exec --user "$php_user" --workdir "$container_release" \
|
||||
"$PHP_CONTAINER" composer install \
|
||||
--no-dev --no-interaction --prefer-dist --optimize-autoloader
|
||||
# Keep the release readable by the PHP runtime group. Do not chown on the host:
|
||||
# act_runner cannot change ownership of files created inside the container.
|
||||
run docker exec "$PHP_CONTAINER" sh -c \
|
||||
"chown -R ${php_user} '${container_release}' && chmod -R g+rwX '${container_release}'"
|
||||
|
||||
if test "$dry_run" != "true"; then
|
||||
bash -c "$BACKUP_COMMAND"
|
||||
@@ -146,7 +155,12 @@ if test "$dry_run" != "true"; then
|
||||
'
|
||||
)
|
||||
if test "${#old_releases[@]}" -gt 0; then
|
||||
rm -rf -- "${old_releases[@]}"
|
||||
for old_release in "${old_releases[@]}"; do
|
||||
release_name="$(basename "$old_release")"
|
||||
# Delete via the PHP container as root so vendor trees are removable.
|
||||
run docker exec "$PHP_CONTAINER" \
|
||||
rm -rf "$CONTAINER_DEPLOY_ROOT/releases/$release_name"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user