mosgjig
mosgjig

Reputation: 537

what are drone.io 0.8.5 plugin/gcr secretes' acceptable values?

I'm having trouble pushing to gcr with the following

gcr:
    image: plugins/gcr
    registry: us.gcr.io
    repo:  dev-221608/api
    tags:
      - ${DRONE_BRANCH}
      - ${DRONE_COMMIT_SHA}
      - ${DRONE_BUILD_NUMBER}
    dockerfile: src/main/docker/Dockerfile
    secrets: [GOOGLE_CREDENTIALS]
    when:
      branch: [prod]

...Where GOOGLE_CREDENTIALS will work, but if named say GOOGLE_CREDENTIALS_DEV it will not be properly picked up. GCR_JSON_KEY works fine. I recall reading legacy documentation that spelled out the acceptable variable names, of which GOOGLE_CREDENTIALS and GCR_JSON_KEY were listed among other variants but as of version 1 they've done some updates omitting that info.

So, question is, is the plugin capable of accepting whatever variable name or is it expecting specific variable names and if so what are they?

Upvotes: 0

Views: 208

Answers (1)

Oliver
Oliver

Reputation: 13011

The Drone GCR plugin accepts the credentials in a secret named PLUGIN_JSON_KEY, GCR_JSON_KEY, GOOGLE_CREDENTIALS, or TOKEN (see code here)

If you stored the credentials in drone as GOOGLE_CREDENTIALS_DEV then you can rename it in the .drone.yml file like this:

    ...

    secrets:
      - source: GOOGLE_CREDENTIALS_DEV
        target: GOOGLE_CREDENTIALS

    ...

Upvotes: 1

Related Questions