Skip to content

Commit c4b4a40

Browse files
authored
[CLI-3288] Build all OS/Arch combinations in pipeline (#2961)
1 parent 98cebe8 commit c4b4a40

File tree

3 files changed

+84
-4
lines changed

3 files changed

+84
-4
lines changed

.semaphore/semaphore.yml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ blocks:
1717
dependencies: []
1818
task:
1919
jobs:
20-
- name: linux/amd64
20+
- name: "Test linux/amd64"
2121
commands:
2222
- checkout
2323
- sem-version go $(cat .go-version)
@@ -27,24 +27,60 @@ blocks:
2727
- make lint
2828
- make test
2929
- make test-installer
30+
- name: "Build linux/amd64 (GLIBC)"
31+
commands:
32+
- checkout
33+
- docker build . --file docker/Dockerfile_build_linux_amd64 --tag test-build
34+
- name: "Build linux/amd64 (Alpine)"
35+
commands:
36+
- checkout
37+
- sem-version go $(cat .go-version)
38+
- export PATH=$(go env GOPATH)/bin:$PATH
39+
- sudo apt install musl-tools --yes
40+
- CC=musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 GOEXPERIMENT=boringcrypto go build -tags musl -ldflags="-s -w -X main.commit="00000000" -X main.date="1970-01-01T00:00:00Z" -X main.isTest=true" ./cmd/confluent
3041
epilogue:
3142
always:
3243
commands:
3344
- test-results publish . -N "linux/amd64"
3445

35-
- name: darwin/arm64
46+
- name: linux/arm64
47+
dependencies: []
48+
task:
49+
agent:
50+
machine:
51+
type: s1-prod-ubuntu20-04-arm64-1
52+
jobs:
53+
- name: "Build linux/arm64 (GLIBC)"
54+
commands:
55+
- checkout
56+
- docker build . --file docker/Dockerfile_build_linux_arm64 --tag test-build
57+
- name: "Build linux/arm64 (Alpine)"
58+
commands:
59+
- checkout
60+
- sem-version go $(cat .go-version)
61+
- export PATH=$(go env GOPATH)/bin:$PATH
62+
- sudo apt install musl-tools --yes
63+
- CC=musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 GOEXPERIMENT=boringcrypto go build -tags musl -ldflags="-s -w -X main.commit="00000000" -X main.date="1970-01-01T00:00:00Z" -X main.isTest=true" ./cmd/confluent
64+
65+
- name: darwin
3666
dependencies: []
3767
task:
3868
agent:
3969
machine:
4070
type: s1-prod-macos-13-5-arm64
4171
jobs:
42-
- name: darwin/arm64
72+
- name: "Build & Test darwin/arm64"
4373
commands:
4474
- checkout
4575
- sem-version go $(cat .go-version)
4676
- export PATH=$(go env GOPATH)/bin:$PATH
4777
- make test
78+
- name: "Build darwin/amd64"
79+
commands:
80+
- checkout
81+
- sem-version go $(cat .go-version)
82+
- export PATH=$(go env GOPATH)/bin:$PATH
83+
- GOARCH=amd64 CGO_ENABLED=1 go build -ldflags="-s -w -X main.commit="00000000" -X main.date="1970-01-01T00:00:00Z" -X main.isTest=true" ./cmd/confluent
4884
epilogue:
4985
always:
5086
commands:
@@ -57,7 +93,7 @@ blocks:
5793
machine:
5894
type: s1-prod-windows
5995
jobs:
60-
- name: windows/amd64
96+
- name: "Build & Test windows/amd64"
6197
commands:
6298
- checkout
6399
# https://confluentinc.atlassian.net/browse/DP-9532

docker/Dockerfile_build_linux_amd64

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM --platform=linux/amd64 almalinux:8.10
2+
3+
SHELL ["/bin/bash", "-c"]
4+
5+
RUN yum -y update
6+
7+
RUN yum -y install make sudo
8+
9+
RUN sudo yum -y install git wget gcc-toolset-9
10+
11+
RUN scl enable gcc-toolset-9 bash
12+
13+
COPY . /cli/
14+
15+
RUN export GO_VERSION=$(cat /cli/.go-version) && \
16+
wget "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" && \
17+
sudo tar -C /usr/local -xzf "go${GO_VERSION}.linux-amd64.tar.gz"
18+
19+
ENV PATH=${PATH}:/usr/local/go/bin:/root/go/bin
20+
21+
RUN cd /cli/ && \
22+
CGO_ENABLED=1 GOEXPERIMENT=boringcrypto go build -ldflags="-s -w -X main.commit="00000000" -X main.date="1970-01-01T00:00:00Z" -X main.isTest=true" ./cmd/confluent

docker/Dockerfile_build_linux_arm64

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM --platform=linux/arm64/v8 almalinux:8.10
2+
3+
SHELL ["/bin/bash", "-c"]
4+
5+
RUN yum -y update
6+
7+
RUN yum -y install make sudo
8+
9+
RUN sudo yum -y install git wget gcc-toolset-9
10+
11+
RUN scl enable gcc-toolset-9 bash
12+
13+
COPY . /cli/
14+
15+
RUN export GO_VERSION=$(cat /cli/.go-version) && \
16+
wget "https://go.dev/dl/go${GO_VERSION}.linux-arm64.tar.gz" && \
17+
sudo tar -C /usr/local -xzf "go${GO_VERSION}.linux-arm64.tar.gz"
18+
19+
ENV PATH=${PATH}:/usr/local/go/bin:/root/go/bin
20+
21+
RUN cd /cli/ && \
22+
CGO_ENABLED=1 GOEXPERIMENT=boringcrypto go build -ldflags="-s -w -X main.commit="00000000" -X main.date="1970-01-01T00:00:00Z" -X main.isTest=true" ./cmd/confluent

0 commit comments

Comments
 (0)