-
Notifications
You must be signed in to change notification settings - Fork 17
/
makefile
63 lines (51 loc) · 1.9 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
# clean Remove (!) all untracked and ignored files.
.PHONY: clean
clean:
git clean -xdff
# ---------------------------------------------------------------------------
# The following commands must be run OUTSIDE the development environment.
# ---------------------------------------------------------------------------
.PHONY: requirements
requirements:
poetry export --without-hashes --format=requirements.txt > requirements.txt
# docker Builds the development image from scratch.
.PHONY: docker
docker:
docker build -t gretelxai/gretel:dev-latest .
# pull Pull the development image.
.PHONY: pull
pull:
docker pull gretelxai/gretel:dev-latest
# push Push the development image to Docker Hub.
.PHONY: push
push:
docker push gretelxai/gretel:dev-latest
# shell Opens a shell in the development image.
.PHONY: shell
shell:
docker-compose run gretel bash
# demo Run the demo in the development image.
.PHONY: demo
demo:
docker-compose run gretel
# ---------------------------------------------------------------------------
# The following commands must be run INSIDE the development environment.
# ---------------------------------------------------------------------------
.PHONY: ensure-dev
ensure-dev:
echo ${BUILD_ENVIRONMENT} | grep "development" >> /dev/null
# format Format all source code inplace using `black`.
.PHONY: format
format: ensure-dev
(git status | grep "nothing to commit") && sudo black autogoal/ tests/ || echo "(!) REFUSING TO REFORMAT WITH UNCOMMITED CHANGES" && exit
git status
# env Setup the development environment.
.PHONY: env
env: ensure-dev
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
ln -s ${HOME}/.poetry/bin/poetry /usr/bin/poetry
poetry config virtualenvs.create false
# install Install all the development dependencies.
.PHONY: install
install: ensure-dev
poetry install