Migrate to yq v4

https://mikefarah.gitbook.io/yq/v/v4.x/upgrading-from-v3
This commit is contained in:
Johannes Zellner 2021-02-24 15:23:52 +01:00
parent 485447583a
commit be561c8896

View file

@ -42,32 +42,31 @@ else
fi fi
echo "==> Updating configs" echo "==> Updating configs"
yq w -i /app/data/production.yaml webserver.hostname "${CLOUDRON_APP_DOMAIN}" yq eval ".webserver.hostname = \"${CLOUDRON_APP_DOMAIN}\"" -i /app/data/production.yaml
# database # database
yq w -i /app/data/production.yaml database.hostname "${CLOUDRON_POSTGRESQL_HOST}" yq eval ".database.hostname = \"${CLOUDRON_POSTGRESQL_HOST}\"" -i /app/data/production.yaml
yq w -i /app/data/production.yaml database.port "${CLOUDRON_POSTGRESQL_PORT}" yq eval ".database.port = ${CLOUDRON_POSTGRESQL_PORT}" -i /app/data/production.yaml
yq w -i /app/data/production.yaml database.username "${CLOUDRON_POSTGRESQL_USERNAME}" yq eval ".database.username = \"${CLOUDRON_POSTGRESQL_USERNAME}\"" -i /app/data/production.yaml
yq w -i /app/data/production.yaml database.password "${CLOUDRON_POSTGRESQL_PASSWORD}" yq eval ".database.password = \"${CLOUDRON_POSTGRESQL_PASSWORD}\"" -i /app/data/production.yaml
yq w -i /app/data/production.yaml database.name "${CLOUDRON_POSTGRESQL_DATABASE}" yq eval ".database.name = \"${CLOUDRON_POSTGRESQL_DATABASE}\"" -i /app/data/production.yaml
yq d -i /app/data/production.yaml database.suffix yq eval "del(.database.suffix)" -i /app/data/production.yaml
# redis # redis
yq w -i /app/data/production.yaml redis.hostname "${CLOUDRON_REDIS_HOST}" yq eval ".redis.hostname = \"${CLOUDRON_REDIS_HOST}\"" -i /app/data/production.yaml
yq w -i /app/data/production.yaml redis.port "${CLOUDRON_REDIS_PORT}" yq eval ".redis.port = ${CLOUDRON_REDIS_PORT}" -i /app/data/production.yaml
yq w -i /app/data/production.yaml redis.auth "${CLOUDRON_REDIS_PASSWORD}" yq eval ".redis.auth = \"${CLOUDRON_REDIS_PASSWORD}\"" -i /app/data/production.yaml
# smtp # smtp
yq w -i /app/data/production.yaml smtp.hostname "${CLOUDRON_MAIL_SMTP_SERVER}" yq eval ".smtp.hostname = \"${CLOUDRON_MAIL_SMTP_SERVER}\"" -i /app/data/production.yaml
yq w -i /app/data/production.yaml smtp.port "${CLOUDRON_MAIL_SMTP_PORT}" yq eval ".smtp.port = ${CLOUDRON_MAIL_SMTP_PORT}" -i /app/data/production.yaml
yq w -i /app/data/production.yaml smtp.username "${CLOUDRON_MAIL_SMTP_USERNAME}" yq eval ".smtp.username = \"${CLOUDRON_MAIL_SMTP_USERNAME}\"" -i /app/data/production.yaml
yq w -i /app/data/production.yaml smtp.password "${CLOUDRON_MAIL_SMTP_PASSWORD}" yq eval ".smtp.password = \"${CLOUDRON_MAIL_SMTP_PASSWORD}\"" -i /app/data/production.yaml
yq w -i /app/data/production.yaml smtp.tls false yq eval ".smtp.tls = false" -i /app/data/production.yaml
yq w -i /app/data/production.yaml smtp.disable_starttls true yq eval ".smtp.disable_starttls = true" -i /app/data/production.yaml
yq w -i /app/data/production.yaml smtp.from_address "${CLOUDRON_MAIL_FROM}" yq eval ".smtp.from_address = \"${CLOUDRON_MAIL_FROM}\"" -i /app/data/production.yaml
chown -R cloudron:cloudron /app/data chown -R cloudron:cloudron /app/data
echo "==> Starting PeerTube" echo "==> Starting PeerTube"
exec gosu cloudron:cloudron npm start exec gosu cloudron:cloudron npm start