glide is so good, but its installation is so hard.
can you simplify the installation process(based on source code, for example, go get or anything else) of glide?
fwiw, have a look at github.com/deis/docker-go-dev. It's a fully loaded, containerized go development environment. Then look at any project that uses it (e.g. github.com/deis/router). We use the Travis build type generic, require Docker, and use carefully crafted Makefiles that delegate the build to the container. It solves the problem of how to elegantly install glide on Travis because you will no longer have to... but you also realize many other benefits-- namely your contributors no longer need to jump through hoops to maintain a _local_ go dev environment that's compatible with your project. This is by no means the "official" answer to this question, but you may find it helpful nonetheless.
glide itself is go getable (with vendored deps checked into git), it just won't include the exact commit hash in the binary this way. If you're ok with always pulling the glide master branch, this should be sufficient.
@jrick Thank you sooooo much!!!
glide itself is go getable should be written in README.md, because it is so useful for any newbee of glide
If you're ok with always pulling the glide master branch, this should be sufficient.
This is something to be cautious of. You can't guarantee your tests and builds are deterministic if the version of your dependency manager can change underneath you from one run to the next.
@krancour: That's a good point. It can be solved by checking out a specific revision after you use go get to obtain glide. For example, in .travis.yml you could do:
install:
- go get -v github.com/Masterminds/glide
- cd $GOPATH/src/github.com/Masterminds/glide && git checkout e73500c735917e39a8b782e0632418ab70250341 && go install && cd -
- glide install
...
Then, whenever you want to update your build environment to a new version of glide, you would simply need to update the .travis.yml to include a newer commit hash.
An alternative if you want a specific version is...
install:
- wget "https://github.com/Masterminds/glide/releases/download/0.10.2/glide-0.10.2-linux-amd64.tar.gz"
- mkdir -p $HOME/bin
- tar -vxz -C $HOME/bin --strip=1 -f glide-0.10.2-linux-amd64.tar.gz
- export PATH="$HOME/bin:$PATH"
Would be cool to get a documented, preferred approach.
Not sure if it was available at that time, but currently there is an installation script. The only problem is that it calls the API to check if the URL exists, so API Rate Limit kicks in from time to time.
A slightly better option could be to check if the build URL exists, like this:
curl --output /dev/null --silent --head --fail "$url"
There is no real overhead, since this would replace the API call, the number of HTTP calls would be the same.
See other options here: http://stackoverflow.com/questions/12199059/how-to-check-if-an-url-exists-with-the-shell-and-probably-curl
Most helpful comment
@krancour: That's a good point. It can be solved by checking out a specific revision after you use
go getto obtain glide. For example, in.travis.ymlyou could do:Then, whenever you want to update your build environment to a new version of glide, you would simply need to update the
.travis.ymlto include a newer commit hash.