mirror of https://github.com/OpenVidu/openvidu.git
Fixed restart execution in GCP
parent
4cf5c03994
commit
9fd195fde8
|
@ -147,6 +147,10 @@ locals {
|
||||||
METADATA_URL="http://metadata.google.internal/computeMetadata/v1"
|
METADATA_URL="http://metadata.google.internal/computeMetadata/v1"
|
||||||
get_meta() { curl -s -H "Metadata-Flavor: Google" "$${METADATA_URL}/$1"; }
|
get_meta() { curl -s -H "Metadata-Flavor: Google" "$${METADATA_URL}/$1"; }
|
||||||
|
|
||||||
|
# Create counter file for tracking script executions
|
||||||
|
touch /tmp/openvidu_install_counter.txt
|
||||||
|
|
||||||
|
|
||||||
# Create all the secrets
|
# Create all the secrets
|
||||||
gcloud secrets create OPENVIDU_URL --replication-policy=automatic || true
|
gcloud secrets create OPENVIDU_URL --replication-policy=automatic || true
|
||||||
gcloud secrets create MEET_INITIAL_ADMIN_USER --replication-policy=automatic || true
|
gcloud secrets create MEET_INITIAL_ADMIN_USER --replication-policy=automatic || true
|
||||||
|
@ -627,6 +631,8 @@ locals {
|
||||||
#!/bin/bash -x
|
#!/bin/bash -x
|
||||||
set -eu -o pipefail
|
set -eu -o pipefail
|
||||||
|
|
||||||
|
# Check if installation already completed
|
||||||
|
if [ ! -f /tmp/openvidu_install_counter.txt ]; then
|
||||||
# install.sh
|
# install.sh
|
||||||
cat > /usr/local/bin/install.sh << 'INSTALL_EOF'
|
cat > /usr/local/bin/install.sh << 'INSTALL_EOF'
|
||||||
${local.install_script}
|
${local.install_script}
|
||||||
|
@ -708,9 +714,10 @@ locals {
|
||||||
|
|
||||||
# Update shared secret
|
# Update shared secret
|
||||||
/usr/local/bin/after_install.sh || { echo "[OpenVidu] error updating shared secret"; exit 1; }
|
/usr/local/bin/after_install.sh || { echo "[OpenVidu] error updating shared secret"; exit 1; }
|
||||||
|
else
|
||||||
# Launch on reboot
|
# Launch on reboot
|
||||||
echo "@reboot /usr/local/bin/restart.sh >> /var/log/openvidu-restart.log" 2>&1 | crontab
|
/usr/local/bin/restart.sh || { echo "[OpenVidu] error restarting OpenVidu"; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
# Wait for the app
|
# Wait for the app
|
||||||
/usr/local/bin/check_app_ready.sh
|
/usr/local/bin/check_app_ready.sh
|
||||||
|
|
Loading…
Reference in New Issue