Is it possible to temporary store a local variable?

Hi, I’m trying to store the result I get from a web request like so
JWT=$(curl --header “Content-Type: application/json” --request POST --data “{“Username”:”$USERNAME",“Password”:"$PASSWORD"}" $PORTAINER/auth | grep -Eo ‘[^"]{20,}’)

But I am getting the error ‘yaml: line 23: mapping values are not allowed in this context’ (Line 23 is the above mentioned line’). Is this not possible with Drone or am I doing something wrong?

.drone.yml file (Link to pastebin so it doesn’t lose formatting)

The yaml file you posted is invalid and therefore fails parsing. You can reproduce this error with any yaml parser. For example, try pasting your yaml into the following website:

This is likely due to using reserved characters in the yaml, which requires either quoting the string and escaping reserved characters, or using a scalar value. For example:

- - sed -i "s|\"MySQL\": \"Server=; Port=3306; Database=KDGPLANNER; Uid=username; Pwd=password;\"|$MYSQL|g" Planner.UI.MVC/appsettings.json
+ - |
+   sed -i "s|\"MySQL\": \"Server=; Port=3306; Database=KDGPLANNER; Uid=username; Pwd=password;\"|$MYSQL|g" Planner.UI.MVC/appsettings.json

I recommend getting your yaml file working with a linter (like before trying to use it with Drone.

Hi, thanks for the reply!
I did try with a validator but turns out it was giving false positives. I’ve got it working in the meantime but now I’m getting the cannot connect to docker error. I’ve tried everything suggested in the FAQ but so far no luck. Running in single machine in case that’s of any help.

Thanks in advance!

sorry, that is not enough information for me to assist. To troubleshoot installation errors we require your full Drone server configuration and the command you used to start Drone (if you are using another program to start Drone, like docker-compose or kubernetes we need to see your docker-compose.yml or kuberenetes spec files respectively). We also require your debug server logs (see the docs to enable debug logging). Once all required information is provided we can then help troubleshoot.