Hoping someone here might be able to help as I'm not too familiar with go.
My Jenkins slaves are running on Amazon Linux 2 on EC2, using the EC2 plugin. I'm currently creating a job to build and deploy a Go application using the Go plugin, but am getting stuck on running a 'go get' on a private repository in BitBucket. The error I'm getting is:
403 Forbidden
server response: Access denied. You must have write or admin access.
After searching online I found that running git config --global url."git@bitbucket:".insteadOf "https://bitbucket.org/
should help so I've build this into the slave image, but I'm still getting the same issue. I've also set GOPRIVATE=bitbucket.org/ORG_NAME/
as was advised.
Permissions on the repo are correct so I'm not quite sure what's going on here and I'm wondering if I should go down the route of using containers or whether that will just complicate things more.
Any advice would be helpful, thanks!