github.com/qsunny/k8s@v0.0.0-20220101153623-e6dca256d5bf/examples-master/cassandra/Makefile (about) 1 # Copyright 2016 The Kubernetes Authors. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 # build the cassandra image. 16 VERSION=v14 17 PROJECT_ID?=google_samples 18 PROJECT=gcr.io/${PROJECT_ID} 19 CASSANDRA_VERSION=3.11.2 20 21 all: kubernetes-cassandra.jar build 22 23 build-go: 24 go build -a -installsuffix cgo \ 25 -ldflags "-s -w" \ 26 -o image/files/cassandra-seed.so -buildmode=c-shared go/main.go 27 28 kubernetes-cassandra.jar: 29 @echo "Building kubernetes-cassandra.jar" 30 docker run -v ${PWD}/java:/usr/src/app maven:3-jdk-8-onbuild-alpine mvn clean install 31 cp java/target/kubernetes-cassandra*.jar image/files/kubernetes-cassandra.jar 32 33 container: 34 @echo "Building ${PROJECT}/cassandra:${VERSION}" 35 docker build --pull --build-arg "CASSANDRA_VERSION=${CASSANDRA_VERSION}" -t ${PROJECT}/cassandra:${VERSION} image 36 37 container-dev: 38 docker build --pull --build-arg "CASSANDRA_VERSION=${CASSANDRA_VERSION}" --build-arg "DEV_CONTAINER=true" -t ${PROJECT}/cassandra:${VERSION}-dev image 39 40 build: container container-dev 41 42 push: build 43 gcloud docker -- push ${PROJECT}/cassandra:${VERSION} 44 gcloud docker -- push ${PROJECT}/cassandra:${VERSION}-dev 45 46 .PHONY: all build push