From 7a7277c63727867cb7e007cf72402f9ad8f9c166 Mon Sep 17 00:00:00 2001 From: David Mejia Date: Tue, 7 Nov 2023 13:27:50 -0500 Subject: [PATCH 1/2] ensure /var/www/volumes_static exists on container restart --- infrastructure/deploy.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/infrastructure/deploy.sh b/infrastructure/deploy.sh index babd67471..a8e9332ce 100755 --- a/infrastructure/deploy.sh +++ b/infrastructure/deploy.sh @@ -388,6 +388,19 @@ if [[ -n $container_running ]]; then -i data-refinery-key.pem \ api-configuration/environment "ubuntu@$API_IP_ADDRESS:/home/ubuntu/environment" + # Ensure the API's static file dir exists and is accessible" + ssh -o StrictHostKeyChecking=no \ + -o ServerAliveInterval=15 \ + -o ConnectTimeout=5 \ + -i data-refinery-key.pem \ + "ubuntu@$API_IP_ADDRESS" "mkdir -p /var/www/volumes_static" + + ssh -o StrictHostKeyChecking=no \ + -o ServerAliveInterval=15 \ + -o ConnectTimeout=5 \ + -i data-refinery-key.pem \ + "ubuntu@$API_IP_ADDRESS" "chmod a+rwx /var/www/volumes_static" + # shellcheck disable=SC2029 ssh -o StrictHostKeyChecking=no \ -o ServerAliveInterval=15 \ From 111a821dc421e2a2b0f79cb8ff934daeaf99cc4e Mon Sep 17 00:00:00 2001 From: David Date: Tue, 7 Nov 2023 14:15:23 -0500 Subject: [PATCH 2/2] combine mkdir + chmod commands Co-authored-by: Arkadii Yakovets --- infrastructure/deploy.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/infrastructure/deploy.sh b/infrastructure/deploy.sh index a8e9332ce..dcdbfae4e 100755 --- a/infrastructure/deploy.sh +++ b/infrastructure/deploy.sh @@ -388,18 +388,12 @@ if [[ -n $container_running ]]; then -i data-refinery-key.pem \ api-configuration/environment "ubuntu@$API_IP_ADDRESS:/home/ubuntu/environment" - # Ensure the API's static file dir exists and is accessible" + # Ensure the API's static file dir exists and is accessible. ssh -o StrictHostKeyChecking=no \ -o ServerAliveInterval=15 \ -o ConnectTimeout=5 \ -i data-refinery-key.pem \ - "ubuntu@$API_IP_ADDRESS" "mkdir -p /var/www/volumes_static" - - ssh -o StrictHostKeyChecking=no \ - -o ServerAliveInterval=15 \ - -o ConnectTimeout=5 \ - -i data-refinery-key.pem \ - "ubuntu@$API_IP_ADDRESS" "chmod a+rwx /var/www/volumes_static" + "ubuntu@$API_IP_ADDRESS" "mkdir -m a+rwx -p /var/www/volumes_static" # shellcheck disable=SC2029 ssh -o StrictHostKeyChecking=no \