Setting up a Golang project on Semaphore is easy. The first time you add a Go project, Semaphore will analyze it and propose some frequently used build commands to speed up the setup process. If needed, these commands can be customized to better suit your needs.
The Semaphore platform supports the following Go versions:
Switching between different Go versions can be done in Project Settings or by adding the following command to your build commands:
Valid values for <version> are 1.4, 1.5, and 1.6.
To use change-go-version in a bash script, use the following command to load it:
#!/bin/sh source /opt/change-go-version.sh
The $GOPATH environment variable is set to /home/runner/workspace which contains the bin, pkg and src folders.
Your project's root directory is represented with a symlink in the src folder of $GOPATH.
Go project by default are configured to run:
go get -v -d ./… && go build -v ./…
The three dots (...) Go wildcard is used to expand to all package directories found in $GOPATH.
To achieve faster build times, we recommend caching your project's dependencies with godep.
Semaphore Docs are open source — Edit on GitHub