-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Trying to run a Cloud Build file like the next:
steps:
- name: 'gcr.io/google-appengine/exec-wrapper'
id: TEST
args:
[
'-i',
'gcr.io/$PROJECT_ID/${_BUILD_TARGET}',
'-s',
'${_CLOUD_SQL_DEV}',
'-e',
'DJANGO_SETTINGS_MODULE=$$DJANGO_SETTINGS_MODULE',
'-e',
'CLOUD_SQL=/cloudsql/${_CLOUD_SQL_DEV}',
'--',
'python',
'manage.py',
'migrate',
'--no-input',
]
env:
- 'DJANGO_SETTINGS_MODULE=test.production'
Is throwing an error, as it is assigning the env variable in app engine as the string "$DJANGO_SETTINGS_MODULE" instead of the real value that was coming from the env variable.
Step #0 - "apply migrations": ModuleNotFoundError: No module named '$DJANGO_SETTINGS_MODULE' Finished Step #0 - "apply migrations"
Not sure if the problem is in
ENV_PARAMS+=(-e "$OPTARG") |
ENV_PARAMS+=(-e "$OPTARG")
. Maybe removing the quotes would fix the issue
ENV_PARAMS+=(-e $OPTARG)
or the problem can also be in
ENV_PARAMS+=(-e "$OPTARG") |
docker run --rm ${ENTRYPOINT} --volumes-from=${CONTAINER} --network=${CONTAINER_NETWORK} ${ENV_PARAMS[@]} ${IMAGE} "$@"
It is a silly example, as I can use a substituion instead of an env variable there, but what I'm really trying to do is something like https://cloud.google.com/build/docs/securing-builds/use-secrets