I have a bitbucket pipelines config which builds my app.yaml file by replacing matching strings with pipeline environment variables. Some of these variables have special characters in and cause SED to fail. How can I get around this?
My pipelines script is this:
script:
- cp app.yaml.dist app.yaml
- cat app.yaml
- echo ${APP_GOOGLE_CLIENT_SECRET} > src/config/credentials/gcloud.json
- sed -i "s/\$DEBUG/$DEBUG/" app.yaml
- sed -i "s/\$DATABASE_URL/$STAGING_MONGOURL/" app.yaml
So I create an app.yaml file from my dist version. Then I replace the variables in my app.yaml file such as $DEBUG
and $DATABASE_URL
with environment variables which are stored in pipelines.
If it helps my app.yaml file environment variables section is basically this:
...
env_variables:
APP_DEBUG: $DEBUG
DATABASE_URL: $DATABASE_URL
...
The error I get is sed: -e expression #1, char 35: unknown option to 's'
Thanks in advance