Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Megha-Rajanna authored Sep 10, 2024
1 parent 644ebe3 commit 5a210cc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
#Setting the java based on the architecture
ifeq ($(shell uname -m), s390x)
JAVA_TYPE="ibmjava"
else
JAVA_TYPE="openjdk"
endif

# Install CRDs into a cluster
install: manifests kustomize
Expand Down Expand Up @@ -128,14 +134,20 @@ build-go:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build \
-ldflags "-X github.com/$(REPO)/pkg/version.Version=$(VERSION) -X github.com/$(REPO)/pkg/version.GitSHA=$(GIT_SHA)" \
-o bin/$(EXPORTER_NAME)-windows-amd64.exe cmd/exporter/main.go
CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build \
-ldflags "-X github.com/$(REPO)/pkg/version.Version=$(VERSION) -X github.com/$(REPO)/pkg/version.GitSHA=$(GIT_SHA)" \
-o bin/$(PROJECT_NAME)-linux-s390x main.go
CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build \
-ldflags "-X github.com/$(REPO)/pkg/version.Version=$(VERSION) -X github.com/$(REPO)/pkg/version.GitSHA=$(GIT_SHA)" \
-o bin/$(EXPORTER_NAME)-linux-s390x cmd/exporter/main.go

build-image:
docker build --build-arg VERSION=$(VERSION) --build-arg DOCKER_REGISTRY=$(DOCKER_REGISTRY) --build-arg DISTROLESS_DOCKER_REGISTRY=$(DISTROLESS_DOCKER_REGISTRY) --build-arg GIT_SHA=$(GIT_SHA) -t $(REPO):$(VERSION) .
docker tag $(REPO):$(VERSION) $(REPO):latest

build-zk-image:

docker build --build-arg VERSION=$(VERSION) --build-arg DOCKER_REGISTRY=$(DOCKER_REGISTRY) --build-arg GIT_SHA=$(GIT_SHA) -t $(APP_REPO):$(VERSION) ./docker
docker build --build-arg VERSION=$(VERSION) --build-arg DOCKER_REGISTRY=$(DOCKER_REGISTRY) --build-arg JAVA_TYPE=$(JAVA_TYPE) --build-arg GIT_SHA=$(GIT_SHA) -t $(APP_REPO):$(VERSION) ./docker
docker tag $(APP_REPO):$(VERSION) $(APP_REPO):latest

build-zk-image-swarm:
Expand Down

0 comments on commit 5a210cc

Please sign in to comment.