-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (71 loc) · 2.92 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
SHELL := /bin/bash
.PHONY: test
ROOT_DIR := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJECT_DIR := $(notdir $(patsubst %/,%,$(dir $(ROOT_DIR))))
PROJECT := $(lastword $(PROJECT_DIR))
VERSION_FILE = VERSION
VERSION = `cat $(VERSION_FILE)`
package-ui: clean-ui bundle-js
update-ui:
git submodule update --remote -- ancilla-ui
build-ui: update-ui package-ui
build-rpi:
$(eval LK_COMMIT=$(shell git --git-dir=./.git rev-parse --short HEAD))
ANCILLA_COMMIT=${LK_COMMIT} docker-compose build ancilla
push-rpi-production:
$(eval LK_COMMIT=$(shell git --git-dir=./.git rev-parse --short HEAD))
docker tag localhost/ancilla:${LK_COMMIT} layerkeep/ancilla:${LK_COMMIT}
docker tag localhost/ancilla:${LK_COMMIT} layerkeep/ancilla:latest
docker push layerkeep/ancilla:${LK_COMMIT}
docker push layerkeep/ancilla:latest
push-rpi-staging:
$(eval LK_COMMIT=$(shell git --git-dir=./.git rev-parse --short HEAD))
docker tag localhost/ancilla:${LK_COMMIT} layerkeep/ancilla:staging-${LK_COMMIT}
docker tag localhost/ancilla:${LK_COMMIT} layerkeep/ancilla:staging-latest
docker push layerkeep/ancilla:staging-${LK_COMMIT}
docker push layerkeep/ancilla:staging-latest
build-rpi3:
$(eval LK_COMMIT=$(shell git --git-dir=./.git rev-parse --short HEAD))
ANCILLA_COMMIT=${LK_COMMIT} docker-compose build ancilla-rpi3
push-rpi3-staging:
$(eval LK_COMMIT=$(shell git --git-dir=./.git rev-parse --short HEAD))
docker tag localhost/ancilla:rpi3-${LK_COMMIT} layerkeep/ancilla:staging-rpi3-${LK_COMMIT}
docker tag localhost/ancilla:rpi3-${LK_COMMIT} layerkeep/ancilla:staging-rpi3-latest
docker push layerkeep/ancilla:staging-rpi3-${LK_COMMIT}
docker push layerkeep/ancilla:staging-rpi3-latest
build-rpi4:
$(eval LK_COMMIT=$(shell git --git-dir=./.git rev-parse --short HEAD))
ANCILLA_COMMIT=${LK_COMMIT} docker-compose build ancilla-rpi4
push_rpi4:
$(eval LK_COMMIT=$(shell git --git-dir=./.git rev-parse --short HEAD))
docker tag localhost/ancilla:rpi4-${LK_COMMIT} layerkeep/ancilla:staging-rpi4-${LK_COMMIT}
docker tag localhost/ancilla:rpi4-${LK_COMMIT} layerkeep/ancilla:staging-rpi4-latest
docker push layerkeep/ancilla:staging-rpi4-${LK_COMMIT}
docker push layerkeep/ancilla:staging-rpi4-latest
all: run
clean-docker:
docker rm $(shell docker ps -a -q)
docker rmi $(shell docker images | grep '<none>' | awk '{print $$3}')
clean-ui:
@rm -rf ancilla/ui
clean-all:
@rm -rf *.ipc \
&& rm -rf dist \
&& rm -rf __pycache__ \
&& rm -rf ancilla-ui/dist \
&& rm -rf macOS \
&& rm -rf ancilla-ui/.cache \
&& rm -rf ~/.ancilla
run:
@RUN_ENV=DEV cd ancilla && python -m ancilla
bundle-js:
@cd ancilla-ui \
&& yarn install --check-files \
&& ./node_modules/.bin/parcel build src/index.html --public-url '/static' --out-dir ../ancilla/ancilla/ui/dist
# && npm run build
package_python:
@RUN_ENV=PROD python setup.py macos -s && \
mkdir dist && \
mv macOS dist/
package: bundle-js package_python
# package: clean bundle_js package_python