How to properly use curl in Travis-CI config file (YAML)?

Ok - I've managed to solve (or hack) this problem, by creating simple bash script:

#!/bin/bash
curl -H 'Authorization: Token someToken' -X POST http://my.server.com -F [email protected]

And then I proceed to call the script in .travis.yml file:

- ./upload_script.sh

All credits goes to @набиячлэвэлиь for suggesting me that solution in the comments.

Any other - nicer - solutions are more than welcome.


In YAML, colons are delimiters that separate map keys and values.

What you have now:

curl -H 'Authorization: token someToken' "https://api.github.com/repos/:owner/:repo/releases/tags/$TRAVIS_TAG"

​ is a map with key curl -H 'Authorization and value token someToken' "https://api.github.com/repos/:owner/:repo/releases/tags/$TRAVIS_TAG". You can see how this creeps into the build script.

What you want is a properly quoted string:

after_deploy:
  - "curl -H 'Authorization: token someToken' \"https://api.github.com/repos/:owner/:repo/releases/tags/$TRAVIS_TAG\""