I have configured two identical build jobs for my GitHub repo. The issue in my case is that only one build succeeds while the other fails on the exact same command. The command is simply an API request to GitHub. What is the cause of this failure?
Here’s the code snippet which is failing:
- "if [ $latest == 'true' ]; then\n link=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest
| grep \"/hugo_[0-9]\\.[0-9]*\\.*[0-9]_Linux-64bit.tar.gz\" | cut -d\\\" -f4)\nelse \n link=\"https://github.com/gohugoio/hugo/releases/download/v${minVer}/hugo_${minVer}_Linux-64bit.tar.gz\"\nfi\n"
- wget $link -O hugo.tgz
Basically, $link
is successfully declared in one job, while it isn’t in the other job. When $link
is empty, the wget
command fails and hence the build job as well.
Here are the necessary links:
- Config file: .travis.yml
- Repository: hugo-dream-plus
- Build Log: Build #54