-
Notifications
You must be signed in to change notification settings - Fork 60
/
Makefile
78 lines (65 loc) · 3.67 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
IMAGE?=radanalyticsio/spark-operator
.PHONY: build
build: package image-build
.PHONY: build-travis
build-travis:
echo -e "travis_fold:start:mvn\033[33;1mMaven and container build\033[0m"
$(MAKE) build
echo -e "\ntravis_fold:end:mvn\r"
.PHONY: package
package:
# install parent pom in m2 cache
MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean install -DskipTests
# install annotator in m2 cache
MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean install -f annotator/pom.xml -DskipTests
# install abstract-operator in m2 cache
MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean install -f abstract-operator/pom.xml -DskipTests
# build uberjar for spark-operator
MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean package -f spark-operator/pom.xml -DskipTests
.PHONY: test
test:
MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean test
.PHONY: image-build
image-build:
docker build -t $(IMAGE):ubi -f Dockerfile.ubi .
docker tag $(IMAGE):ubi $(IMAGE):latest
.PHONY: image-build-alpine
image-build-alpine:
docker build -t $(IMAGE):alpine -f Dockerfile.alpine .
.PHONY: image-build-all
image-build-all: image-build image-build-alpine
.PHONY: image-publish-alpine
image-publish-alpine: image-build-alpine
docker tag $(IMAGE):alpine $(IMAGE):alpine-`git rev-parse --short=8 HEAD`
docker tag $(IMAGE):alpine $(IMAGE):latest-alpine
docker push $(IMAGE):latest-alpine
.PHONY: image-publish
image-publish: image-build
docker tag $(IMAGE):ubi $(IMAGE):`git rev-parse --short=8 HEAD`-ubi
docker tag $(IMAGE):ubi $(IMAGE):latest-ubi
docker push $(IMAGE):latest
.PHONY: image-publish-all
image-publish-all: build-travis image-build-all image-publish image-publish-alpine
.PHONY: devel
devel: build
-docker kill `docker ps -q` || true
oc cluster up ; oc login -u system:admin ; oc project default
sed 's;quay.io/radanalyticsio/spark-operator:latest-released;radanalyticsio/spark-operator:latest;g' manifest/operator.yaml > manifest/operator-devel.yaml && oc create -f manifest/operator-devel.yaml ; rm manifest/operator-devel.yaml || true
until [ "true" = "`oc get pod -l app.kubernetes.io/name=spark-operator -o json 2> /dev/null | grep \"\\\"ready\\\": \" | sed -e 's;.*\(true\|false\),;\1;'`" ]; do printf "."; sleep 1; done
oc logs -f `oc get pods --no-headers -l app.kubernetes.io/name=spark-operator | cut -f1 -d' '`
.PHONY: devel-kubernetes
devel-kubernetes:
-minikube delete
minikube start --vm-driver kvm2
eval `minikube docker-env` && $(MAKE) build
sed 's;quay.io/radanalyticsio/spark-operator:latest-released;radanalyticsio/spark-operator:latest;g' manifest/operator.yaml > manifest/operator-devel.yaml && kubectl create -f manifest/operator.yaml ; rm manifest/operator-devel.yaml || true
until [ "true" = "`kubectl get pod -l app.kubernetes.io/name=spark-operator -o json 2> /dev/null | grep \"\\\"ready\\\": \" | sed -e 's;.*\(true\|false\),;\1;'`" ]; do printf "."; sleep 1; done
kubectl logs -f `kubectl get pods --no-headers -l app.kubernetes.io/name=spark-operator | cut -f1 -d' '`
.PHONY: local-travis-tests
local-travis-tests: build
-docker kill `docker ps -q` || true
sed 's;quay.io/radanalyticsio/spark-operator:latest-released;radanalyticsio/spark-operator:latest;g' manifest/operator.yaml > manifest/operator-test.yaml
-BIN=oc CRD=0 MANIFEST_SUFIX="-test" .travis/.travis.test-oc-and-k8s.sh || true
-BIN=oc CRD=0 MANIFEST_SUFIX="-test" .travis/.travis.test-restarts.sh || true
-BIN=oc CRD=0 MANIFEST_SUFIX="-test" .travis/.travis.test-cross-ns.sh || true
-rm manifest/operator-test.yaml || true