Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secretEnv not working correctly #211

Open
petrucci89 opened this issue Feb 21, 2022 · 0 comments
Open

secretEnv not working correctly #211

petrucci89 opened this issue Feb 21, 2022 · 0 comments

Comments

@petrucci89
Copy link

petrucci89 commented Feb 21, 2022

using this statement in cloudbuild.yaml i got $POSTGRES_PASSWORD as value of env variable POSTGRES_PASSWORD

- name: gcr.io/google-appengine/exec-wrapper
    args:
      - '-i'
      - '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
      - '-s'
      - '${PROJECT_ID}:${_DEPLOY_REGION}:${_DB_INSTANCE}'
      - '-e'
      - 'POSTGRES_HOST=${_POSTGRES_HOST}'
      - '-e'
      - 'POSTGRES_PASSWORD=$$POSTGRES_PASSWORD'
      - '--'
      - 'python'
      - 'manage.py'
      - 'migrate'
    id: Migrate
    secretEnv: ['POSTGRES_PASSWORD']

but using this statement everything work correctly

- name: gcr.io/google-appengine/exec-wrapper
    entrypoint: bash
    args: ['-c', "/buildstep/execute.sh -i $_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA -s ${PROJECT_ID}:${_DEPLOY_REGION}:${_DB_INSTANCE} -e POSTGRES_HOST=${_POSTGRES_HOST} -e POSTGRES_PASSWORD=$$POSTGRES_PASSWORD -- python manage.py migrate"]
    id: Migrate
    secretEnv: ['POSTGRES_PASSWORD']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant