Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Stream Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Elias Flötzinger
Stream Server
Commits
1daaad39
Commit
1daaad39
authored
5 years ago
by
Simon Kirsten
Browse files
Options
Downloads
Patches
Plain Diff
Fixed CI pipeline
parent
0adba982
No related branches found
Branches containing commit
Tags
v0.9.1
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci-server.yml
+2
-3
2 additions, 3 deletions
.gitlab-ci-server.yml
cmd/stream-tv-server/main.go
+6
-2
6 additions, 2 deletions
cmd/stream-tv-server/main.go
with
8 additions
and
5 deletions
.gitlab-ci-server.yml
+
2
−
3
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
...
...
This diff is collapsed.
Click to expand it.
cmd/stream-tv-server/main.go
+
6
−
2
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
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment