josmo / drone-rancher

Drone plugin for triggering Rancher deployments
53 stars 35 forks source link

custom env variable names #23

Closed peetasan closed 6 years ago

peetasan commented 6 years ago

Based on Drone-secret's documentation I was expecting that I can name my secrets anything I want if I refer to them in my .drone.yml. However, the below snippet presents me with an error: "Eek: Must have url, key, secret, and service definied"

So my question is: is there a way to use access and secret key names different from RANCHER_ACCESS_KEY and RANCHER_SECRET_KEY?

Use case being that different when events would deploy to different rancher environments having different keys along the lines of:

  rancher_staging:
    image: peloton/drone-rancher
    service: my_service
    url: https://rancher.mycompany.com
    ...
    access_key: ${RANCHER_STAGING_ACCESS_KEY}
    secret_key: ${RANCHER_STAGING_SECRET_KEY}
    start_first: false
    when:
      event:
        - pull_request
    secrets:
      - RANCHER_STAGING_ACCESS_KEY
      - RANCHER_STAGING_SECRET_KEY
josmo commented 6 years ago

@peetasan secrets in the newest version of drone doesn't work that way, checkout http://docs.drone.io/manage-secrets/ specifically you need to do something like

secrets:
  - source: rancher_statging_access_key
    target: rancher_access_key
peetasan commented 6 years ago

Thank you, this works. Somehow I missed that part from the documentation.