-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
82 lines (61 loc) · 2.43 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
72
73
74
75
76
77
78
79
80
81
82
# Environment settings
MAPPING_FOLDER=_data/mapping
ERRORS_FOLDER=_data/errors
VALIDATION_FOLDER=validation
REVOCATION_FOLDER=revocation
VERBOSITY=">/dev/null 2>&1"
# Set branch name (from Travis or locally)
BRANCH:=$(or $(TRAVIS_BRANCH),`git branch --show-current`)
all: build
install:
pip3 install --user -r requirements.txt
bundle install
# Generate all certs and do the mapping
validation:
@make --directory=$(VALIDATION_FOLDER) \
MAPPING_DIR=$(CURDIR)/$(MAPPING_FOLDER) \
ERRORS_DIR=$(CURDIR)/$(ERRORS_FOLDER)
# Run the validation with debug on
debug:
@make --directory=$(VALIDATION_FOLDER) \
MAPPING_DIR=$(CURDIR)/$(MAPPING_FOLDER) \
ERRORS_DIR=$(CURDIR)/$(ERRORS_FOLDER) \
DEBUG="--debug"
# Create ZIP files with revocation clients
revocation:
@make --directory=$(REVOCATION_FOLDER)
# Test generated certificates for assigned errors
#$(ERRORS_FOLDER)/*/*.yml:
# @printf "Testing certificates for %-70s" $(@D)/$(@F)
# @if RES=`grep verify-expected $@ | wc -l` && [ $$RES -eq 0 ]; then printf "[ -- ]\n"; \
# else utils/test-cert-validation.sh $(CERTS_BUILD_FOLDER) $@ && printf "[ OK ]\n"; fi
# === Targets for generating files ===
generated-files: humans.txt
humans.txt: CONTRIBUTORS.md
@echo "Creating humans.txt file ..."
cp CONTRIBUTORS.md humans.txt
# === Web build, test and deploy targets ===
build: revocation validation generated-files
@echo "Building the website using Jekyll ..."
@if [ "$(BRANCH)" = "master" ]; then echo "=== Production build ($(BRANCH)) ==="; else echo "=== Development build ($(BRANCH)) ==="; fi
@if [ "$(BRANCH)" = "master" ]; then JEKYLL_ENV=production bundle exec jekyll build; else bundle exec jekyll build; fi
local: validation generated-files
bundle exec jekyll serve
test: build
@echo "Running internal tests on the generated site using html-proofer ..."
bundle exec ruby utils/web-test.rb
@echo "Running tests on the external content using html-proofer ..."
-bundle exec ruby utils/web-test.rb external
deploy-preview: build
./firebase hosting:channel:deploy $(BRANCH) --only preview
deploy-production: build
./firebase deploy --only hosting:production
# === Cleaning targets ===
clean:
rm -rf _site
rm -rf humans.txt
rm -rf $(MAPPING_FOLDER)
make --directory=$(VALIDATION_FOLDER) clean
make --directory=$(REVOCATION_FOLDER) clean
# === Target flags ===
.PHONY: all install validation debug revocation generated-files build local test deploy-preview deploy-production clean