1
1
# Makefile
2
2
# This makefile is for development purpose
3
3
4
+ # ##############################################################################
5
+ # # Setup: ##
6
+ # ##############################################################################
4
7
SHELL = /bin/bash
5
- # SED ?= sed
6
8
7
9
DOCKERFILE ="Dockerfile"
8
10
IMAGE_REGISTRY ="ghcr.io/sovereigncloudstack/standards"
9
- IMAGE_NAME ="scsconformance"
10
- # IMAGE_VERSION_TAG ="v0.1.2"
11
+ IMAGE_NAME ="scs-kaas-conformance"
11
12
12
13
KIND_CLUSTER ="testcluster"
13
14
14
- # PLUGIN_NAME="k8s-default-storage-class-plugin-go"
15
- PLUGIN_NAME ="plugin"
15
+ PLUGIN_NAME ="scs-conformance-sonobuoy-plugin"
16
16
PLUGIN_FILE ="${PLUGIN_NAME}.yaml"
17
+ KIND_CONFIG_FILE ="kind_config.yaml"
17
18
18
- # ~ SONO_WAIT = 1
19
- # ~ SONO_TIMEOUT = 60
20
-
21
- KUBERNETES_SERVICE_HOST =127.0.0.1
22
- KUBERNETES_SERVICE_PORT =34743
23
-
19
+ SONO_WAIT = 30
24
20
25
21
# ##############################################################################
26
22
# # Helpers: ##
27
23
# ##############################################################################
28
24
29
- ifeq ( $( IMAGE_VERSION_TAG ) ,)
25
+ ifndef IMAGE_VERSION_TAG :
30
26
export TAG=dev
31
27
else
32
28
export TAG=${IMAGE_VERSION_TAG}
@@ -46,70 +42,75 @@ kind-init:
46
42
@echo " [KindCluster] ${KIND_CLUSTER} "
47
43
@echo " "
48
44
49
-
50
45
# ##############################################################################
51
46
# # For develpoment usage: ##
52
47
# ##############################################################################
53
48
54
49
dev-prerequests :
55
- @echo " [check-test-setup]"
56
50
@kind version
57
- @docker version
51
+ @docker version -f json | jq ' .Client.Version '
58
52
@sonobuoy version --short
53
+ @yq --version
54
+ @jq --version
59
55
@go version
60
56
@docker buildx version
61
57
62
58
63
59
dev-setup : kind-init
64
- kind create cluster --name ${KIND_CLUSTER}
60
+ kind create cluster --config ${KIND_CONFIG_FILE} -- name ${KIND_CLUSTER}
65
61
66
62
67
63
dev-build : container-init
68
- @echo " [build ]"
64
+ @echo " [Building image... ]"
69
65
DOCKER_BUILDKIT=1 docker build . -f ${DOCKERFILE} -t ${SONOBUOY_IMAGE}
70
66
kind load docker-image --name ${KIND_CLUSTER} ${SONOBUOY_IMAGE}
71
67
72
68
73
- dev-go :
74
- @echo " [go]"
75
- @echo " [KubernetesService] ${KUBERNETES_SERVICE_HOST} :${KUBERNETES_SERVICE_PORT} "
76
- @rm -rf ./build || true
77
- @mkdir ./build
78
- go test -c -o ./build ./...
79
- # go test -c -o ./build ./... --args --skip-labels="type=pod-list"
80
- # go tool test2json ./build -test.v
69
+ dev-run :
70
+ @echo " [Running sonobuoy...]"
71
+ @sonobuoy run -p ${PLUGIN_FILE} --wait=${SONO_WAIT}
72
+ @sonobuoy status
81
73
82
74
83
- dev-run :
84
- @echo " [run-test]"
85
- @echo " sonobuoy run --plugin ${PLUGIN_FILE} --wait=${SONO_WAIT} --timeout=${SONO_TIMEOUT} "
86
- # ~ @sonobuoy run --plugin ${PLUGIN_FILE} --wait=${SONO_WAIT} --timeout=${SONO_TIMEOUT}
87
- @sonobuoy run --plugin ${PLUGIN_FILE}
75
+ dev-run-background :
76
+ @echo " [Running sonobuoy in background...]"
77
+ @sonobuoy run -p ${PLUGIN_FILE}
88
78
@sonobuoy status
89
79
90
80
91
- dev-result :
92
- @echo " [result]"
93
- # outfile=$(sonobuoy retrieve) && mkdir results && tar -xf ${outfile} -C results
81
+ dev-result : dev-clean-result
82
+ @echo " [Retrieve results...]"
94
83
sonobuoy retrieve
95
- sonobuoy results * .tar.gz
84
+ @echo " [Extracting results...] "
96
85
mkdir results
97
86
tar -xf * .tar.gz -C results
87
+ cat results/plugins/scs-kaas-conformance/sonobuoy_results.yaml | yq
88
+ cat results/plugins/scs-kaas-conformance/results/global/out.json | jq
89
+ @echo " [Displaying results...]"
90
+ sonobuoy results * .tar.gz
98
91
99
92
100
- dev-clean :
101
- @echo " [clean] "
102
- @sonobuoy delete --all --wait || true
103
- @sonobuoy status || true
93
+ dev-rerun : dev-clean-sonobuoy dev-build dev-run dev-result
94
+
95
+
96
+ dev-clean-result :
104
97
@rm -rf * .tar.gz || true
105
98
@rm -rf results || true
106
99
107
100
101
+ dev-clean-sonobuoy : dev-clean-result
102
+ @echo " [Cleanup sonobuoy environment from cluster...]"
103
+ @sonobuoy delete --all --wait || true
104
+ @sonobuoy status || true
108
105
109
- dev-purge : kind-init dev-clean
110
- @echo " [purge]"
106
+
107
+ dev-purge : kind-init clean-sonobuoy
108
+ @echo " [Purge everthing...]"
109
+ @echo " [Deleting kind cluster...]"
111
110
kind delete cluster --name ${KIND_CLUSTER} || true
111
+ @echo " [Removing docker image...]"
112
112
docker rmi ${SONOBUOY_IMAGE} || true
113
+ @rm -rf ./build || true
113
114
115
+ PHONY : dev-prerequests dev-build dev-run dev-result dev-clean-sonobuoy dev-clean-result dev-purge dev-rerun dev-run-background
114
116
115
- PHONY : dev-prerequests dev-build dev-run dev-result dev-clean dev-clean dev-purge
0 commit comments