Skip to content

Commit f0b7ed2

Browse files
committed
Update Makefile For finding-post-processing
As mentioned in Issue #495 I introduced new directory containing the code for the hook. I also updated the Makefile to use jest via npx Signed-off-by: Yannik Fuhrmeister <yannik.fuhrmeister@iteratec.com>
1 parent 205e87a commit f0b7ed2

11 files changed

Lines changed: 14 additions & 9 deletions

File tree

‎hooks/finding-post-processing/.helmignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ src/*
3232
config/*
3333
Dockerfile
3434
.dockerignore
35-
3635
finding-post-processing.tar
36+
hook/*

‎hooks/finding-post-processing/Makefile‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,32 @@
2828
#
2929
# IMG_TAG: Tag used to tag the newly created image. Defaults to the shortend commit hash
3030
# prefixed with `sha-` e.g. `sha-ef8de4b7`
31+
#
32+
# JEST_VERSION Defines the jest version used for executing the tests. Defaults to latest
3133

3234
SHELL = /bin/sh
3335

3436
IMG_NS ?= securecodebox
3537
BASE_IMG_TAG ?= latest
3638
IMG_TAG ?= sha-$$(git rev-parse --short HEAD)
39+
JEST_VERSION ?= latest
3740

3841
hook = finding-post-processing
3942
hook-prefix =
4043

41-
all: | install-deps unit-tests build-images images-export kind-import deploy deploy-demo-apps integration-tests
44+
all: | install-deps unit-tests build-images images-export kind-import deploy deploy-test-deps integration-tests
4245

43-
.PHONY: unit-tests install-deps build-images images-export kind-import deploy deploy-demo-apps integration-tests all
46+
.PHONY: unit-tests install-deps build-images images-export kind-import deploy deploy-test-deps integration-tests all
4447

4548
unit-tests:
46-
npm test -- --ci --colors --modulePathIgnorePatterns $(hook).test.js
49+
cd hook && npx --yes --package jest@$(JEST_VERSION) jest
4750

4851
install-deps:
49-
npm ci
52+
cd hook && npm ci
5053

5154
build-images:
5255
@echo Build With BASE_IMG_TAG: $(BASE_IMG_TAG)
53-
docker build --build-arg=baseImageTag=$(BASE_IMG_TAG) --build-arg=namespace=$(IMG_NS) -t $(IMG_NS)/$(hook-prefix)$(hook):$(IMG_TAG) .
56+
docker build --build-arg=baseImageTag=$(BASE_IMG_TAG) --build-arg=namespace=$(IMG_NS) -t $(IMG_NS)/$(hook-prefix)$(hook):$(IMG_TAG) -f ./hook/Dockerfile ./hook
5457

5558
images-export:
5659
docker save $(IMG_NS)/$(hook-prefix)$(hook):$(IMG_TAG) -o $(hook-prefix)$(hook).tar
@@ -65,14 +68,15 @@ deploy:
6568
--set="image.tag=$(IMG_TAG)"
6669

6770
deploy-test-deps:
68-
helm -n integration-tests upgrade --install test-scan ../../scanners/test-scan/
71+
helm -n integration-tests upgrade --install test-scan ../../scanners/test-scan/ \
72+
--set="image.tag=$(BASE_IMG_TAG)" \
73+
--set="parserImage.tag=$(BASE_IMG_TAG)"
6974

7075
install-integration-test-deps:
71-
cd ../../tests/integration && npm ci
7276

7377
integration-tests:
7478
kubectl -n integration-tests delete scans --all
75-
cd ../../tests/integration/ && npm test -- --ci --colors $(hook).test.js
79+
cd integration-tests && npx --yes --package jest@$(JEST_VERSION) jest
7680

7781
clean:
7882
rm ./$(hook-prefix)$(hook).tar
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

hooks/finding-post-processing/package-lock.json.license renamed to hooks/finding-post-processing/hook/package-lock.json.license

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)