I'm deploying my Laravel project on App Engine. I need to put some data like the password of the database in the app.yaml configuration file, I would like to do something like this when I have added $DB_PASSWORD in the environment variables of the Bitbucket repo.
runtime: php73
env_variables:
...
DB_PASSWORD: $DB_PASSWORD
Is there any way to accomplish this?
I don't really think the `env` set in bitbucket can be read by the App Engine `app.yml`. I suggest you do the following
1. Bitbucket pipelines ships with an awesome feature, Bitbucket pipes, which makes most of deployments easy. The good news, there exists a bitbucket pipe for Google App Engine, See Link below;
https://confluence.atlassian.com/bitbucket/deploy-to-google-cloud-900820342.html
below is a snipe you can apply, do everything you need like building the app and `env` all in within the pipeline, so by the time it's sent to App Engine, the `env` already exists;
image: node:10.15.1
# image: php:7.2-fpm
pipelines:
default:
- step:
name: Build and Test
script:
- cp .env.example .env
# pass environment variables in travis to the app
- sed -ri 's~^DB_PASSWORD=~DB_PASSWORD=\$DB_PASSWORD~' .env
- step:
name: Deploy
script:
- pipe: atlassian/google-app-engine-deploy:0.2.1
variables:
KEY_FILE: $KEY_FILE
PROJECT: 'my-project'
2. You can maintain your config and I believe the `env` variables within `app.yml` should be defined in App Engine rather than bitbucket
I hope this helps
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.