woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.07k stars 353 forks source link

Setting AWS Key and secret in value does not work #706

Closed jasonrichardsmith closed 2 years ago

jasonrichardsmith commented 2 years ago

I have been testing woodpecker ci at codeberg. The S3 plugin did not work like this:

pipeline:
  upload:
    image: woodpeckerci/plugin-s3
    secrets: [aws_access_key_id, aws_secret_access_key]
    bucket: my-bucket-name
    access_key: $aws_access_key_id
    secret_key: $aws_secret_access_key
    source: public/**/*
    target: /target/location

But it does when you just leave the values as env vars:

pipeline:
  upload:
    image: woodpeckerci/plugin-s3
    secrets: [aws_access_key_id, aws_secret_access_key]
    bucket: my-bucket-name
    source: public/**/*
    target: /target/location
jasonrichardsmith commented 2 years ago

Not sure if this a bug in the plugin or a typo in documentation.

anbraten commented 2 years ago

Could you try:

pipeline:
  upload:
    image: woodpeckerci/plugin-s3
    secrets: [aws_access_key_id, aws_secret_access_key]
    settings:
      bucket: my-bucket-name
      access_key:
        secret: aws_access_key_id
      secret_key:
        secret: aws_secret_access_key
      source: public/**/*
      target: /target/location
6543 commented 2 years ago

Note: we have to update plugin docus & pipelines to use new syntax

anbraten commented 2 years ago

The suggested answer should work. We also fixed some bugs related to the secret passing #842