Open jtallinger opened 4 years ago
Sorry @jtallinger I'm finally catching up on notifications and I definitely let this go. Did you find the issue? at first glance I'm wondering if something weird is going on it needing to be quoted or something.
Hi,
I was looking into this but did not find any solution. Issue relates to urfave/cli package (https://github.com/urfave/cli/issues/549), where comma is used as a separator. Seems not possible to escape it either.
I added a debug print in plugin.go and used this as a test:
steps:
- name: test
image: tallinger/drone-ecs:1.1
settings:
environment_variables:
- TEST=test,test
And output to console:
[test:0] Drone AWS ECS Plugin built
[test:1] ENV: TEST=test
[test:2] ENV: test
Tried various escape methods like TEST="test,test", TEST='test,test', "TEST=test,test" but none worked. For now I changed my application to use | as separator instead of comma. For those I could not change I use secrets manager, which works as a work around.
I'm using jsonnet and I'm having the same issue when using the "_" character as separator.
Hi, as a fix for me
steps:
- name: ssh commands
image: appleboy/drone-ssh
environment:
COMMA:
from_secret: comma
PLATFORM: linux/arm/v7,linux/arm64/v8,linux/amd64,linux/386
settings:
host: localhost
username: user
port: 22
key:
from_secret: ssh_key
envs:
- COMMA
- PLATFORM
script:
- echo `pwd`
- echo $COMMA $PLATFORM
- echo
Output
latest: Pulling from appleboy/drone-ssh
--
2 | Digest: sha256:095ca4ceafcb751f1f22fe416057d3e2a6302f7b1f7011b17010973cb6bbdd9f
3 | Status: Image is up to date for appleboy/drone-ssh:latest
4 | ======CMD======
5 | echo `pwd`
6 | echo $COMMA $PLATFORM
7 | echo
8 | ======END======
9 | out: /home/user
10 | out: , linux/arm/v7,linux/arm64/v8,linux/amd64,linux/386
11 | ==============================================
12 | ✅ Successfully executed commands to all host.
13 | ==============================================
Hi,
Whenever I try to use commas in the environmental variables the plugin panics. I've tried wrapping the value with " but it does not help. I've noticed the same issue in two different code projects. If I put the value in a env secret then it works fine.
Any ideas what is wrong? I had a look at row 212 in plugin.go but I do not see anything obvious wrong?