On Mar 26, 2013, at 4:03 PM, Herbert Fischer <
herbert...@gmail.com> wrote:
> Hi,
>
> I'm trying to setup a Jenkins job for a private Go project that:
>
> - Pool git to watch repo for changes (one job for each branch I want to watch: master and develop);
> - Fetch changes;
> - Go get dependencies, updated ones, mostly public dependencies, but in the future I may have private ones also;
> - Build project;
> - Archive and upload artefacts;
>
> I was able to do it for some public projects by using this script in the jobs:
>
> export GOPATH="$JENKINS_HOME/jobs/$JOB_NAME/builds/$BUILD_ID/golang"
> export GOBIN="$GOPATH/bin"
> mkdir -p $GOPATH
> go get -v
> go build -v
>
> But this have two issues:
>
> - If my job is watching and fetching another branch than the master, "go get" will fetch all deps, including the "master" source and put it somewhere into $GOPATH. In other words, I'll always be building the master branch of the project, instead the source Jenkins fetched.
>
> - This does not work with private repos.
Random information, but I have found that .netrc files are honored by git (possibly other scm's?), which go get calls out to.