Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Stream Server Project
Stream Server
Commits
1daaad39
Commit
1daaad39
authored
Aug 22, 2019
by
Simon Kirsten
Browse files
Fixed CI pipeline
parent
0adba982
Pipeline
#22297
passed with stages
in 1 minute and 26 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci-server.yml
View file @
1daaad39
...
...
@@ -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
...
...
cmd/stream-tv-server/main.go
View file @
1daaad39
...
...
@@ -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
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment