- Go to
deploy/<your project>/dotenv
and check the following variables (change values accordingly):
DATABASE_HOST=10.202.64.3:3306
DATABASE_URL=mysql://redcall_prod:<my password>@$DATABASE_HOST/redcall_prod
GCP_PROJECT_NAME=covid-fight-redcall
GCP_BASTION_INSTANCE=redcall-bastion
- Go to
deploy/<your project>/dotenv-migrate
and set the right DATABASE_URL
DATABASE_URL=mysql://redcall_prod:<my password>@$DATABASE_HOST/redcall_prod
- Go to
deploy/<your project>/app.yaml
and change the VPC connector (change values accordingly):
vpc_access_connector:
name: "projects/covid-fight-redcall/locations/europe-west1/connectors/redcall-serverless-vpc"
- You're ready to migrate the database
Edit the "migrate.sh" script and comment the following lines:
GREENLIGHT=`wget -O- ${WEBSITE_URL}/deploy`
if [[ "${GREENLIGHT}" != "0" ]]
then
echo "A communication has recently been triggered, cannot deploy before ${GREENLIGHT} seconds"
cp deploying/.env symfony/.env
rm -r deploying
exit 1
fi
Then run:
cd deploy
sh migrate.sh <your project>
You can uncomment the code you commented above.
- Edit the "deploy.sh" script and comment the following lines:
GREENLIGHT=`wget -O- ${WEBSITE_URL}/deploy`
if [[ "${GREENLIGHT}" != "0" ]]
then
echo "A communication has recently been triggered, cannot deploy before ${GREENLIGHT} seconds"
cp deploying/.env symfony/.env
rm -r deploying
exit 1
fi
- Run the following commands:
cd deploy
sh deploy.sh <your project>
When you will sign up your first user, you indeed won't be able to ask the administrator to enable your account.
-
first, create your account using the registration form, whatever the environment.
-
use
start_sql.sh
to start and bind your SQL instance on your own local machine, on port 3304. Set the "dotenv-migrate" variable at the bottom of your project's.env
(in the symfony directory). -
Finally, run the following commands:
php bin/console user:verify <your registration email>
php bin/console user:trust <your registration email>
php bin/console user:admin <your registration email>
php bin/console user:verify [email protected] php bin/console user:trust [email protected] php bin/console user:admin [email protected]
-
Run the development environment in order to generate the database schema
-
Enable your public IP address in your Cloud SQL instance (see this related doc)
-
In the
.env
file of the symfony directory, backup and changeDATABASE_URL
environment variable to point to your Cloud SQL db:
DATABASE_URL=mysql://root:<your root password>@<your instance public ip>:3306/redcall_preprod
- Inside the container, run the following command:
php bin/console user:verify <your registration email>
php bin/console user:trust <your registration email>
php bin/console user:admin <your registration email>
-
Disable your public IP address in your Cloud SQL instance.
-
Restore your
DATABASE_URL
variable in.env
.