Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
56db0f3
switch to a new ubuntu bionic based image for faster compilation of g…
sgagniere Oct 7, 2022
4e9fc9e
update base image tags in the dockerfiles
sgagniere Oct 8, 2022
ed4bf11
remove windows format override in glibc goreleaser file since it does…
sgagniere Oct 8, 2022
2f61949
changed centos to ubuntu in the image name for the updated arm64 buil…
sgagniere Oct 8, 2022
b4d5b15
Add support for building the arm64 binary inside an arm64 image when …
sgagniere Oct 10, 2022
1d0c54d
Merge branch 'main' of github.com:confluentinc/cli into linux-build-u…
sgagniere Oct 10, 2022
ad7fe22
updated the m1 dockerfile to pull the updated image
sgagniere Oct 11, 2022
d04d0b0
Update dockerfiles/Dockerfile_linux_glibc_arm64
sgagniere Oct 12, 2022
eedebc7
move duplicated line outside of if
sgagniere Oct 13, 2022
e9ad06c
Merge branch 'linux-build-update' of github.com:confluentinc/cli into…
sgagniere Oct 13, 2022
76d6d34
Update dockerfiles/Dockerfile_linux_glibc_arm64_m1
sgagniere Oct 13, 2022
acc89f5
Merge branch 'linux-build-update' of github.com:confluentinc/cli into…
sgagniere Oct 13, 2022
9e3bef0
Update build_linux_glibc.sh
sgagniere Oct 13, 2022
b0bae26
renaming dockerfiles
sgagniere Oct 13, 2022
6a90c45
change rename to sed in the other dockerfile
sgagniere Oct 13, 2022
8a8d768
merge from main
sgagniere Nov 2, 2022
27db823
Remove go111module=off download for mousetrap
sgagniere Nov 2, 2022
28ea886
removing gonosumdb, it should default to whatever is in goprivate now
sgagniere Nov 2, 2022
bbc7b38
go mod tidy because why not
sgagniere Nov 3, 2022
6055c4b
Update build_linux_glibc.sh
sgagniere Nov 3, 2022
b693970
moved build_linux_glibc.sh to scripts
sgagniere Nov 3, 2022
c2459a9
Merge branch 'linux-build-update' of github.com:confluentinc/cli into…
sgagniere Nov 3, 2022
c798cfc
Update scripts/build_linux_glibc.sh
sgagniere Nov 3, 2022
edf45f9
Merge branch 'main' of github.com:confluentinc/cli into linux-build-u…
sgagniere Dec 8, 2022
01fc799
replace sed with rename
sgagniere Dec 8, 2022
a7a68fd
merge main into linux-build-update
sgagniere Dec 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .goreleaser-linux-glibc-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ archives:
- id: archive
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format: tar.gz
format_overrides:
- goos: windows
format: zip
wrap_in_directory: "{{ .ProjectName }}"
files:
- LICENSE
Expand Down
3 changes: 0 additions & 3 deletions .goreleaser-linux-glibc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ archives:
- id: archive
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format: tar.gz
format_overrides:
- goos: windows
format: zip
wrap_in_directory: "{{ .ProjectName }}"
files:
- LICENSE
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile_linux_glibc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-centos-base-amd64:latest
FROM --platform=linux/amd64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-centos-base-amd64:2.0

COPY . /go/src/github.com/confluentinc/cli/

Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/Dockerfile_linux_glibc_arm64
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM --platform=linux/arm64/v8 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-centos-base-arm64:latest
FROM --platform=linux/arm64/v8 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-ubuntu-base-arm64:arm64

COPY . /go/src/github.com/confluentinc/cli/

RUN cd /go/src/github.com/confluentinc/cli && \
make gorelease-linux-glibc-arm64

RUN cd /go/src/github.com/confluentinc/cli && \
for file in dist/*.txt; do mv -v "$file" "${file/checksums/checksums_linux_arm64}"; done;
rename 's/checksums/checksums_linux_arm64/' dist/*.txt
9 changes: 9 additions & 0 deletions dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM --platform=linux/amd64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-ubuntu-base-arm64:latest

COPY . /go/src/github.com/confluentinc/cli/

RUN cd /go/src/github.com/confluentinc/cli && \
make gorelease-linux-glibc-arm64

RUN cd /go/src/github.com/confluentinc/cli && \
rename 's/checksums/checksums_linux_arm64/' dist/*.txt
13 changes: 7 additions & 6 deletions mk-files/release.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ endef
# The glibc container doesn't need to publish to S3 so it doesn't need to $(caasenv-authenticate)
.PHONY: gorelease-linux-glibc
gorelease-linux-glibc:
GO111MODULE=off go get -u github.com/inconshreveable/mousetrap && \
GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) S3FOLDER=$(S3_STAG_FOLDER_NAME)/confluent-cli goreleaser release --rm-dist -f .goreleaser-linux-glibc.yml
GOPRIVATE=github.com/confluentinc VERSION=$(VERSION) goreleaser release --rm-dist -f .goreleaser-linux-glibc.yml

.PHONY: gorelease-linux-glibc-arm64
gorelease-linux-glibc-arm64:
GO111MODULE=off go get -u github.com/inconshreveable/mousetrap && \
GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) S3FOLDER=$(S3_STAG_FOLDER_NAME)/confluent-cli goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml
ifneq (,$(findstring x86_64,$(shell uname -m)))
GOPRIVATE=github.com/confluentinc VERSION=$(VERSION) CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml
else
GOPRIVATE=github.com/confluentinc VERSION=$(VERSION) goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml
endif

# This builds the Darwin, Windows and Linux binaries using goreleaser on the host computer. Goreleaser takes care of uploading the resulting binaries/archives/checksums to S3.
# Uploading linux glibc files because its goreleaser file has set release disabled
Expand All @@ -61,11 +63,10 @@ gorelease:
$(eval token := $(shell (grep github.com ~/.netrc -A 2 | grep password || grep github.com ~/.netrc -A 2 | grep login) | head -1 | awk -F' ' '{ print $$2 }'))
$(aws-authenticate) && \
echo "BUILDING FOR DARWIN, WINDOWS, AND ALPINE LINUX" && \
GO111MODULE=off go get -u github.com/inconshreveable/mousetrap && \
GOPRIVATE=github.com/confluentinc VERSION=$(VERSION) GITHUB_TOKEN=$(token) S3FOLDER=$(S3_STAG_FOLDER_NAME)/confluent-cli goreleaser release --rm-dist --timeout 60m -f .goreleaser.yml; \
rm -f CLIEVCodeSigningCertificate2.pfx && \
echo "BUILDING FOR GLIBC LINUX" && \
./build_linux_glibc.sh && \
scripts/build_linux_glibc.sh && \
$(aws-authenticate) && \
aws s3 cp dist/confluent_$(VERSION)_linux_amd64.tar.gz $(S3_STAG_PATH)/confluent-cli/archives/$(VERSION_NO_V)/confluent_$(VERSION)_linux_amd64.tar.gz && \
aws s3 cp dist/confluent_$(VERSION)_linux_arm64.tar.gz $(S3_STAG_PATH)/confluent-cli/archives/$(VERSION_NO_V)/confluent_$(VERSION)_linux_arm64.tar.gz && \
Expand Down
13 changes: 10 additions & 3 deletions build_linux_glibc.sh → scripts/build_linux_glibc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
aws ecr get-login-password --region us-west-1 | docker login --username AWS --password-stdin 050879227952.dkr.ecr.us-west-1.amazonaws.com

go mod vendor
#amd64

# Build linux/amd64
docker build . -f ./dockerfiles/Dockerfile_linux_glibc -t cli-linux-glibc-builder-image
docker container create --name cli-linux-glibc-builder cli-linux-glibc-builder-image
docker container cp cli-linux-glibc-builder:/go/src/github.com/confluentinc/cli/dist/. ./dist/
docker container rm cli-linux-glibc-builder
#arm64
docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64 -t cli-linux-glibc-arm64-builder-image

# Build linux/arm64
architecture=$(uname -m)
if [ "$architecture" == 'x86_64' ]; then
docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 -t cli-linux-glibc-arm64-builder-image
else
docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64 -t cli-linux-glibc-arm64-builder-image
fi
docker container create --name cli-linux-glibc-arm64-builder cli-linux-glibc-arm64-builder-image
docker container cp cli-linux-glibc-arm64-builder:/go/src/github.com/confluentinc/cli/dist/. ./dist/
docker container rm cli-linux-glibc-arm64-builder
Expand Down