forked from 28mm/blast-radius
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (47 loc) · 1.23 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
#
# make clean
# make
# make publish
#
# TODO: add tests.
#
CATEGORIES_JSON = ./blastradius/server/static/js/categories.json
CATEGORIES_JS = ./blastradius/server/static/js/categories.js
GOPATH = $(CURDIR)/blastradius
export GOPATH
.PHONY: clean
clean:
-find . -type d -name __pycache__ -exec rm -r {} \+
-rm $(CATEGORIES_JSON)
-rm $(CATEGORIES_JS)
-rm -rf hcl2json
# install
.PHONY: install
install: hcl2json
pipenv install
# build hcl2json binary
.PHONY: hcl2json
hcl2json:
-go get github.com/tmccombs/hcl2json
# build pypi package
.PHONY: dist
dist:
-python3 setup.py sdist
# build docker image
.PHONY: docker
docker:
-docker build -t 28mm/blast-radius .
# push pypi and docker images to public repos
.PHONY: publish
publish:
-twine upload dist/*
-docker push 28mm/blast-radius:latest
# rebuild categories.js from upstream docs
.PHONY: categories
categories: $(CATEGORIES_JS)
$(CATEGORIES_JSON):
-./utilities/providers/provider-category-json.py > $(CATEGORIES_JSON).new && mv $(CATEGORIES_JSON).new $(CATEGORIES_JSON)
$(CATEGORIES_JS): $(CATEGORIES_JSON)
-sed -e '1s/{/resource_groups \= {/' $(CATEGORIES_JSON) > $(CATEGORIES_JS).new && mv $(CATEGORIES_JS).new $(CATEGORIES_JS)
# probably best to clean 1st
all: categories dist docker