forked from secureCodeBox/secureCodeBox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhooks.mk
More file actions
57 lines (48 loc) · 1.8 KB
/
hooks.mk
File metadata and controls
57 lines (48 loc) · 1.8 KB
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
#!/usr/bin/make -f
#
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0
#
#
# This Makefile is intended to be used for developement and testing only.
# For using this scanner/hook in production please use the helm chart.
# See: <https://docs.securecodebox.io/docs/getting-started/installation>
#
# This Makefile expects some additional software to be installed:
# - git
# - node + npm
# - docker
# - kind
# - kubectl
# - helm
# - yq
module = hook
prefix = hook
name = ${hook}
include ../../common.mk
include ../../env-paths.mk
## Telling the env-paths file where the root project dir is. This is done to allow the generation of the paths of the different project folders relative to where the makefile is being run from.
## So BIN_DIR= $(PROJECT_DIR)/bin will be BIN_DIR=../../bin
PROJECT_DIR=../..
module = $(hook-prefix)
.PHONY: docker-build
docker-build: | common-docker-build
.PHONY: docker-export
docker-export: | common-docker-export
.PHONY: kind-import
kind-import: | common-kind-import
.PHONY: unit-tests
unit-tests:
@$(MAKE) -s unit-test-js
.PHONY: deploy
deploy: ## 💾 Deploy this module via HelmChart into namespace "integration-tests"
@echo ".: 💾 Deploying '$(name)' $(hook-prefix) HelmChart with the docker tag '$(IMG_TAG)' into kind namespace 'integration-tests'."
helm -n integration-tests upgrade --install $(name) . --wait \
--set="hook.image.repository=docker.io/$(IMG_NS)/$(hook-prefix)-$(name)" \
--set="hook.image.tag=$(IMG_TAG)"
.PHONY: integration-tests
integration-tests: ## 🩺 Start integration test for this module in the namespace "integration-tests"
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd $(hook-prefix) && npm ci && npm run test --package jest@$(JEST_VERSION)