fix(deploy): fall back to container SHA discovery when the staging revision state file is unreadable
The staging host currently has .state/deployed-revision unreadable by the deploy user, so the forward-only revision check failed with 'Permission denied' before it could compare revisions. Treat an unreadable state file like a missing one and discover the running revision from the web container's GITHUB_SHA, in both the workflow step and the server-side deploy/migration scripts.
This commit is contained in:
@@ -47,7 +47,7 @@ flock -n 9 || {
|
||||
}
|
||||
|
||||
current_sha="not-deployed"
|
||||
if [ -f "$state_directory/deployed-revision" ]; then
|
||||
if [ -r "$state_directory/deployed-revision" ]; then
|
||||
current_sha="$(<"$state_directory/deployed-revision")"
|
||||
else
|
||||
existing_web="$("${docker_command[@]}" ps -aq \
|
||||
|
||||
@@ -41,7 +41,7 @@ flock -n 9 || {
|
||||
}
|
||||
|
||||
current_sha="not-deployed"
|
||||
if [ -f "$state_directory/deployed-revision" ]; then
|
||||
if [ -r "$state_directory/deployed-revision" ]; then
|
||||
current_sha="$(<"$state_directory/deployed-revision")"
|
||||
else
|
||||
existing_web="$("${docker_command[@]}" ps -aq \
|
||||
|
||||
Reference in New Issue
Block a user