Commit 1daaad39 authored by Simon Kirsten's avatar Simon Kirsten
Browse files

Fixed CI pipeline

parent 0adba982
Pipeline #22297 passed with stages
in 1 minute and 26 seconds
......@@ -5,12 +5,11 @@ server:
image: golang:1.12
# TWITCH_CLIENT_ID is supplied via the GitLab CI/CD environment variables. This way only project owners can see the private key.
variables:
LDFLAGS: -s -X main.twitchClientID=$TWITCH_CLIENT_ID -X main.version=$CI_COMMIT_TAG-$CI_COMMIT_SHORT_SHA
before_script:
- VERSION=$(git describe --always --long --dirty)
- export LDFLAGS="-s -X stream-tv/pkg/twitch.ClientID=$TWITCH_CLIENT_ID -X stream-tv/cmd/stream-tv-server/main.version=$VERSION"
- go mod download
- echo "building $VERSION"
script:
- env GOOS=darwin GOARCH=386 go build -ldflags "$LDFLAGS" -o binaries/darwin-x86/stream-tv-server ./cmd/stream-tv-server
......
......@@ -21,14 +21,18 @@ const (
var (
// version will automatically be set by the CI pipeline.
version = "unknown"
// twitchClientID will automatically be set by the CI pipeline.
twitchClientID = ""
)
func init() {
// The CI pipeline automatically sets twitch.ClientID to the projects client id.
// If you want to use your own set the TWITCH_CLIENT_ID environment variable.
// If you want to use your own twitch client id set the TWITCH_CLIENT_ID environment variable.
if clientID := os.Getenv("TWITCH_CLIENT_ID"); clientID != "" {
twitch.ClientID = clientID
} else {
twitch.ClientID = twitchClientID
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment