I am using CircleCI as my tool to build my images to publish on Kubernetes.
My projects are using Golang, and I am using Go Modules.
It turns out, I am having issues when, after checking out my code, the step go get -v -t -d ./...
runs.
At some point, for some dependencies (which are internal dependencies from my company, and they are under my company's github project), I receive unknown revision
message.
I already configured the Machine Account, as I have my own github account set.
I have tried to add the following lines
- run: echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
- run: cp key ~/.ssh/id_rsa
- run: git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
- run: git config --global gc.auto 0 || true
- run: go get -v -t -d ./...
The command cp key ~/.ssh/id_rsa
copies a ssh key
which has access to github projects, and I can use it locally to do the same steps above.
Any help would be very welcome, because I have read tons of documentations / comments over the internet, but nothing seems to work.
Thanks.
Answering my own question:
go get
private repositories, even if the user which is running is owner (on docker - because circleCI is using docker containers to run the build)git config --global url."https://<my-dev-token>:x-oauth-basic@github.com/<company-slug>".insteadOf "https://github.com/<company-slug>" || true
I have tested other solutions, but that was the only one which worked just fine.