#!/bin/bash1# Copyright (c) 2021 Gitpod GmbH. All rights reserved.2# Licensed under the GNU Affero General Public License (AGPL).3# See License.AGPL.txt in the project root for license information.45# This scipt connects via Google's cloud_sql_proxy to a database and runs the db-migrations67# ENV variables for configuration:8# * GOOGLE_APPLICATION_CREDENTIALS_DATA: contents of the crendetials files that cloud_sql_proxy uses for authentication9# * GCP_DATABASE: database name10# * DB_PASSWORD: database password1112# Example usage:13# docker run --rm \14# --env GOOGLE_APPLICATION_CREDENTIALS_DATA='...' \15# --env GCP_DATABASE="gitpod-foobar:europe-west1:gitpod-foobar-baz" \16# --env DB_PASSWORD="..." \17# gcr.io/gitpod-core-dev/build/db-migrations:x1 /app/migrate_gcp.sh1819set -euo pipefail2021/app/typeorm_gcp.sh migrations:run222324