-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
56 lines (43 loc) · 1.64 KB
/
GNUmakefile
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
ifneq (,$(wildcard .env))
include .env
export
endif
.env:
cp .env.template .env
.PHONY: build
build:
docker build -t renater/simplescalevm:${PROVIDER}-test --build-arg provider=${PROVIDER} .
cloud-init.sh:
cp cloud-init.sh.example cloud-init.sh
scaler.cloud-init.sh:
cp cloud-init.sh.example scaler.cloud-init.sh
env:
virtualenv env
.PHONY: install
install: env
env/bin/python3 -m pip install -r requirements.txt
if [ -f src/providers/${PROVIDER}/requirements.txt ]; then env/bin/python3 -m pip install -r src/providers/${PROVIDER}/requirements.txt; fi
.PHONY: lint
lint:
env/bin/pylint --ignore-patterns=env/* .
.PHONY: mock
mock: tests/mock.env
python3 tests/mock.py
.PHONY: release
release: build
docker tag renater/simplescalevm:${PROVIDER}-test renater/simplescalevm:${PROVIDER}-latest
docker tag renater/simplescalevm:${PROVIDER}-test renater/simplescalevm:${PROVIDER}-${VERSION}
docker tag renater/simplescalevm:${PROVIDER}-test renater/simplescalevm:${PROVIDER}-${shell echo ${VERSION} | cut -d '.' -f -2}
docker tag renater/simplescalevm:${PROVIDER}-test renater/simplescalevm:${PROVIDER}-${shell echo ${VERSION} | cut -d '.' -f -1}
docker push renater/simplescalevm:${PROVIDER}-latest
docker push renater/simplescalevm:${PROVIDER}-${VERSION}
docker push renater/simplescalevm:${PROVIDER}-${shell echo ${VERSION} | cut -d '.' -f -2}
docker push renater/simplescalevm:${PROVIDER}-${shell echo ${VERSION} | cut -d '.' -f -1}
.PHONY: start
start:
env/bin/python3 src/main.py
.PHONY: start-docker
start-docker: build cloud-init.sh scaler.cloud-init.sh
docker-compose up -d
tests/mock.env:
cp tests/mock.env.template tests/mock.env