-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
71 lines (52 loc) · 1.28 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
PROJECT = "LICENSE_SCANNER"
dir = $(shell pwd)
env_file = $(dir)/.env
lib_dir = $(dir)/lib
scripts_dir = $(dir)/scripts
default:
make build set-up run
##
# build tool
##
build:
@mkdir -p ${lib_dir}
@cd ${lib_dir} && git clone https://github.com/vessels-tech/toml-to-env.git || echo 'Already cloned'
@cd ${lib_dir}/toml-to-env && npm install
@cd ${lib_dir}/ && npm install
@cd ${scripts_dir}/ && npm install
default-files:
@echo 'setting up default files'
cp .env.template .env
##
# Set Up
##
check-env:
@if [ -f "${env_file}" ]; then echo 'OK'; else echo "Error: No env file found. Please fill out before continuing"; cat $(dir)/.env.template > .env; exit 1; fi
check-config:
@${lib_dir}/toml-to-env/bin/toml-to-env.js ${dir}/config.toml || exit 1
@echo 'OK'
set-up:
@make check-env
@make set-up-git set-up-install
set-up-git:
@${scripts_dir}/_checkout.sh
set-up-install:
@${scripts_dir}/_install.sh
##
# Run Commands
##
run:
${scripts_dir}/_run.sh
cleanup:
@${scripts_dir}/_cleanup.sh
##
# Post-Processing
##
post-csv-to-excel:
@cd ${scripts_dir} && node _combine_csv_reports.js
@#fix issues with the xlsx package:
@mv ${scripts_dir}/.xlsx $(dir)/results/license-summary.xlsx
post-summarize-csv:
@echo 'Not implemented yet'
@exit 1
.PHONY: run-all run-one cleanup