-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (49 loc) · 1.85 KB
/
Makefile
File metadata and controls
60 lines (49 loc) · 1.85 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
58
59
60
APP=secdim.lab.cicd
.SILENT:
.PHONY: all build test securitytest clean header
all: build
check:
ifeq (,$(shell which act))
$(error "[!] act not found.")
endif
test: check header
echo -e "\033[1;33m\n[i] Running Github workflow locally\033[0m\n"
act pull_request \
&& echo -e "\033[1;32m\n[i] Well done! Github workflow ran successfully\033[0m\n"\
|| echo -e "\033[1;31m\n[!] Oh, no! Github workflow has bug(s)! Try again\033[0m\n"
securitytest: header build
echo -e "\033[1;33m\n[i] Push your code to SecDim repository\033[0m\n"
echo -e "\033[1;33m\n[i] Security tests would run against your code\033[0m\n"
run: test
clean:
docker image rm ${APP}
docker system prune
docker image prune -f
define HEADER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%% %%%%%%%%%%%%
%%%%%%%%%%% ,%%%%%%%%%%
%%%%%%%%%% *%%%%* %%%%%%%%%%%
%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% *%%%%%%%%%%%%%%%
%%%%%%%%%%%%% .%%%%%%%%%%%
%%%%%%%%%%%%%%%%%% %%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%
%%%%%%%%%% .%%%%. %%%%%%%%%
%%%%%%%%%% .%%%%%%%%%%
%%%%%%%%%%%%, ,%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
play.secdim.com
endef
export HEADER
header:
@echo -e "\033[1;35m$$HEADER\033[0m"
push: test
echo -e "\033[1;33m\n[i] Build, test and push to SecDim\033[0m\n"
git add . && git commit -m 'security fix' && git push
echo -e "\033[1;32m\n[i] Done! Checkout the challenge commits page\033[0m\n"
status:
curl "https://play.secdim.com/api/v1/status/$(shell git rev-parse HEAD)/username/$(word 3, $(subst /, ,$(shell git remote get-url origin)))"