Using Go inside of a detached head in Jenkins

Has anyone successfully used Go with Jenkins, allowing the Jenkins Hudson Git plugin to do the clone (detached head) and then executing the “go get -u…” command afterwards from the GOPATH (which I have set to my workspace where my clone puts the repo in a GO directory structure: src[sitename]…) to fill out embedded public module? Inside the project code, several directories in, there is a\satori\go.uuid directory which if I execute the “go get -u” command on another machine (not Jenkins build box) it reaches out to Github and clones the contents into the go.uuid directory. I just want to be clear on that other machine, I am NOT using a detached head. I am able to execute “go get -u…” from the GOPATH and the go.uuid subdirectory is populated with no errors. In a detached head (on Jenkins) it complains during the git pull. I am not a GO developer. I am merely trying to get this properly cloned and built in Jenkins. Any help will be greatly appreciated.

It sounds like you don’t want to update the source code on disk, your detected head, but rather fetch missing dependencies. Try dropping the -u flag, or is substituting it with -d

1 Like

Thanks, however the “go get -d” did not work. I do not receive any errors, but the packages are not retrieved.

Is the build log online somewhere ?

I just found out that the Jenkins Git Plugin has a recursive clone feature. I updated the checkout with the Advanced sub-modules behaviours --> Recursively update submodules checked and it works fine now. Thanks for the help.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.