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
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
yq w -i /app/data/production.yaml database.hostname "${CLOUDRON_POSTGRESQL_HOST}"
yq w -i /app/data/production.yaml database.port "${CLOUDRON_POSTGRESQL_PORT}"
yq w -i /app/data/production.yaml database.username "${CLOUDRON_POSTGRESQL_USERNAME}"
yq w -i /app/data/production.yaml database.password "${CLOUDRON_POSTGRESQL_PASSWORD}"
yq w -i /app/data/production.yaml database.name "${CLOUDRON_POSTGRESQL_DATABASE}"
yq d -i /app/data/production.yaml database.suffix
yq eval ".database.hostname = \"${CLOUDRON_POSTGRESQL_HOST}\"" -i /app/data/production.yaml
yq eval ".database.port = ${CLOUDRON_POSTGRESQL_PORT}" -i /app/data/production.yaml
yq eval ".database.username = \"${CLOUDRON_POSTGRESQL_USERNAME}\"" -i /app/data/production.yaml
yq eval ".database.password = \"${CLOUDRON_POSTGRESQL_PASSWORD}\"" -i /app/data/production.yaml
yq eval ".database.name = \"${CLOUDRON_POSTGRESQL_DATABASE}\"" -i /app/data/production.yaml
yq eval "del(.database.suffix)" -i /app/data/production.yaml
# redis
yq w -i /app/data/production.yaml redis.hostname "${CLOUDRON_REDIS_HOST}"
yq w -i /app/data/production.yaml redis.port "${CLOUDRON_REDIS_PORT}"
yq w -i /app/data/production.yaml redis.auth "${CLOUDRON_REDIS_PASSWORD}"
yq eval ".redis.hostname = \"${CLOUDRON_REDIS_HOST}\"" -i /app/data/production.yaml
yq eval ".redis.port = ${CLOUDRON_REDIS_PORT}" -i /app/data/production.yaml
yq eval ".redis.auth = \"${CLOUDRON_REDIS_PASSWORD}\"" -i /app/data/production.yaml
# smtp
yq w -i /app/data/production.yaml smtp.hostname "${CLOUDRON_MAIL_SMTP_SERVER}"
yq w -i /app/data/production.yaml smtp.port "${CLOUDRON_MAIL_SMTP_PORT}"
yq w -i /app/data/production.yaml smtp.username "${CLOUDRON_MAIL_SMTP_USERNAME}"
yq w -i /app/data/production.yaml smtp.password "${CLOUDRON_MAIL_SMTP_PASSWORD}"
yq w -i /app/data/production.yaml smtp.tls false
yq w -i /app/data/production.yaml smtp.disable_starttls true
yq w -i /app/data/production.yaml smtp.from_address "${CLOUDRON_MAIL_FROM}"
yq eval ".smtp.hostname = \"${CLOUDRON_MAIL_SMTP_SERVER}\"" -i /app/data/production.yaml
yq eval ".smtp.port = ${CLOUDRON_MAIL_SMTP_PORT}" -i /app/data/production.yaml
yq eval ".smtp.username = \"${CLOUDRON_MAIL_SMTP_USERNAME}\"" -i /app/data/production.yaml
yq eval ".smtp.password = \"${CLOUDRON_MAIL_SMTP_PASSWORD}\"" -i /app/data/production.yaml
yq eval ".smtp.tls = false" -i /app/data/production.yaml
yq eval ".smtp.disable_starttls = true" -i /app/data/production.yaml
yq eval ".smtp.from_address = \"${CLOUDRON_MAIL_FROM}\"" -i /app/data/production.yaml
chown -R cloudron:cloudron /app/data
echo "==> Starting PeerTube"
exec gosu cloudron:cloudron npm start