Your secret Repository URL
The secret repository URL is the Go Modules proxy URL for your Gemfury account and packages. Do not share this URL to keep your account private. Your Repo-URL has the following format:
Uploading packages by Go
To upload a module to your account, use the Git builder:
# Initial one-time setup $ git remote add fury https://git.fury.io/USERNAME/PACKAGE-NAME.git # Push to build a new version $ git push fury master Username for 'https://git.fury.io': <Your personal username> Password for 'https://firstname.lastname@example.org': <Your personal password>
USERNAME in the path of your
git.fury.io repository URL is the destination of the build, however, the username and password for authentication are your account credentials. Usually the former is your team account, and the latter is a personal one.
Go Modules are versioned with Semantic Versioning scheme derived from the tags of your Git repo. To release a new version, create a tag and push it:
$ git tag v1.1.8 $ git push --tags fury master
Setting up Go with Gemfury
Go uses a central proxy to collect a project’s dependencies. By default, it is configured to the public proxy run by Go’s patron-company (Google).
Set the following environment variables to configure Go to use Gemfury. This can be done in your terminal before running
go or in a start-up shell script like
$ export GOPROXY=https://TOKEN@go-proxy.fury.io/USERNAME/ $ export GOPRIVATE="git.fury.io/USERNAME/*" $ export GONOPROXY=none
Once you have this configuration in place, start your build:
$ go build ./...
Please note that
GOPRIVATE specifies the match pattern for the names of your private modules, and does not have to be a “fury.io” URL. Please adjust it to match the names of modules you upload to Gemfury.
If you are only accessing public packages in your Gemfury account, you do not need to specify the token in the proxy URL.
Fetching directly using the Git Builder’s URL
If you have specified your module dependencies using the Git builder URL, you may allow Go to directly fetch the module from your account.
go.mod specified the dependency as:
require git.fury.io/USERNAME/PACKAGE v1.0.0
You may choose to keep your
GOPROXY environment variable unset or use the default public proxy, since Go supports directly connnecting to the source control’s server.
With this configuration, you may start the build:
$ go build ./...
For private packages, you can specify the credentials in your
~/.netrc file, which Go will use if specified:
machine git.fury.io login <personal-email> password <password-or-api-token>
Currently, Go Modules support is in Beta. Please contact us if you encounter difficulties in using it.
Go does not support splitting public and private requests between two proxies. ↩︎