Add pipeline to publish ghcr multi-arch image (#2268)

Refactor operator image build process
Add a pipeline to build and publish arm64/amd64 image in ghcr on every
pushed tag
This commit is contained in:
Polina Bungina
2023-04-17 15:28:27 +02:00
committed by GitHub
parent fc86c44ec3
commit a9c6d46f7d
5 changed files with 104 additions and 10 deletions
+2 -6
View File
@@ -60,17 +60,13 @@ linux: ${SOURCES}
macos: ${SOURCES}
GOOS=darwin GOARCH=amd64 CGO_ENABLED=${CGO_ENABLED} go build -o build/macos/${BINARY} ${BUILD_FLAGS} -ldflags "$(LDFLAGS)" $^
docker-context: scm-source.json linux
mkdir -p docker/build/
cp build/linux/${BINARY} scm-source.json docker/build/
docker: ${DOCKERDIR}/${DOCKERFILE} docker-context
docker: ${DOCKERDIR}/${DOCKERFILE} scm-source.json
echo `(env)`
echo "Tag ${TAG}"
echo "Version ${VERSION}"
echo "CDP tag ${CDP_TAG}"
echo "git describe $(shell git describe --tags --always --dirty)"
cd "${DOCKERDIR}" && docker build --rm -t "$(IMAGE):$(TAG)$(CDP_TAG)$(DEBUG_FRESH)$(DEBUG_POSTFIX)" -f "${DOCKERFILE}" .
docker build --rm -t "$(IMAGE):$(TAG)$(CDP_TAG)$(DEBUG_FRESH)$(DEBUG_POSTFIX)" -f "${DOCKERDIR}/${DOCKERFILE}" --build-arg VERSION="${VERSION}" .
indocker-race:
docker run --rm -v "${GOPATH}":"${GOPATH}" -e GOPATH="${GOPATH}" -e RACE=1 -w ${PWD} golang:1.18.9 bash -c "make linux"