Skip to content

Commit a7166da

Browse files
corneliusludmannroboquat
authored andcommitted
Set version in Go components during build time
1 parent 2d73165 commit a7166da

File tree

17 files changed

+19
-5
lines changed

17 files changed

+19
-5
lines changed

WORKSPACE.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defaultVariant:
1515
config:
1616
go:
1717
lintCommand: ["sh", "-c", "gokart scan && golangci-lint run --disable govet,errcheck,typecheck,staticcheck --allow-parallel-runners --timeout 5m"]
18-
buildFlags: ["-trimpath", "-ldflags='-buildid= -w -s'"]
18+
buildCommand: ["go", "build", "-trimpath", "-ldflags='-buildid= -w -s'"]
1919

2020
variants:
2121
- name: oss

components/blobserve/BUILD.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ packages:
1515
- GOOS=linux
1616
config:
1717
packaging: app
18+
buildCommand: ["go", "build", "-trimpath", "-ldflags", "-buildid= -w -s -X 'github.com/gitpod-io/gitpod/blobserve/cmd.Version=commit-${__git_commit}'"]
1819
- name: docker
1920
type: docker
2021
deps:

components/content-service/BUILD.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ packages:
2828
- GOOS=linux
2929
config:
3030
packaging: app
31+
buildCommand: ["go", "build", "-trimpath", "-ldflags", "-buildid= -w -s -X 'github.com/gitpod-io/gitpod/content-service/cmd.Version=commit-${__git_commit}'"]
3132
- name: docker
3233
type: docker
3334
deps:

components/ee/agent-smith/BUILD.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ packages:
1414
- GOOS=linux
1515
config:
1616
packaging: app
17+
buildCommand: ["go", "build", "-trimpath", "-ldflags", "-buildid= -w -s -X 'github.com/gitpod-io/gitpod/agent-smith/cmd.Version=commit-${__git_commit}'"]
1718
- name: lib
1819
type: go
1920
srcs:
@@ -29,6 +30,7 @@ packages:
2930
- GOOS=linux
3031
config:
3132
packaging: library
33+
buildCommand: ["go", "build", "-trimpath", "-ldflags", "-buildid= -w -s -X 'github.com/gitpod-io/gitpod/agent-smith/cmd.Version=commit-${__git_commit}'"]
3234
- name: docker
3335
type: docker
3436
deps:

components/ee/kedge/BUILD.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ packages:
1313
- GOOS=linux
1414
config:
1515
packaging: app
16+
buildCommand: ["go", "build", "-trimpath", "-ldflags", "-buildid= -w -s -X 'github.com/gitpod-io/gitpod/kedge/cmd.Version=commit-${__git_commit}'"]
1617
- name: docker
1718
type: docker
1819
deps:

components/ee/ws-scheduler/BUILD.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ packages:
1414
- GOOS=linux
1515
config:
1616
packaging: app
17+
buildCommand: ["go", "build", "-trimpath", "-ldflags", "-buildid= -w -s -X 'github.com/gitpod-io/gitpod/ws-scheduler/cmd.Version=commit-${__git_commit}'"]
1718
- name: docker
1819
type: docker
1920
deps:

components/image-builder-mk3/BUILD.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ packages:
1818
- GOOS=linux
1919
config:
2020
packaging: app
21+
buildCommand: ["go", "build", "-trimpath", "-ldflags", "-buildid= -w -s -X 'github.com/gitpod-io/gitpod/image-builder/cmd.Version=commit-${__git_commit}'"]
2122
- name: docker
2223
type: docker
2324
deps:

components/image-builder/BUILD.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ packages:
1515
- GOOS=linux
1616
config:
1717
packaging: app
18+
buildCommand: ["go", "build", "-trimpath", "-ldflags", "-buildid= -w -s -X 'github.com/gitpod-io/gitpod/image-builder/cmd.Version=commit-${__git_commit}'"]
1819
- name: docker
1920
type: docker
2021
deps:

components/registry-facade/BUILD.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ packages:
1515
- GOOS=linux
1616
config:
1717
packaging: app
18+
buildCommand: ["go", "build", "-trimpath", "-ldflags", "-buildid= -w -s -X 'github.com/gitpod-io/gitpod/registry-facade/cmd.Version=commit-${__git_commit}'"]
1819
- name: lib
1920
type: go
2021
srcs:

components/service-waiter/BUILD.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ packages:
1212
- GOOS=linux
1313
config:
1414
packaging: app
15+
buildCommand: ["go", "build", "-trimpath", "-ldflags", "-buildid= -w -s -X 'github.com/gitpod-io/gitpod/service-waiter/cmd.Version=commit-${__git_commit}'"]
1516
- name: docker
1617
type: docker
1718
deps:

0 commit comments

Comments
 (0)