This repository has been archived by the owner on Jun 5, 2024. It is now read-only.
generated from fastai/fastpages
-
Notifications
You must be signed in to change notification settings - Fork 417
/
Makefile
58 lines (46 loc) · 1.67 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
help:
cat Makefile
# start (or restart) the services
server: .FORCE
docker-compose down --remove-orphans || true;
docker-compose up
# start (or restart) the services in detached mode
server-detached: .FORCE
docker-compose down || true;
docker-compose up -d
# build or rebuild the services WITHOUT cache
build: .FORCE
docker-compose stop || true; docker-compose rm || true;
docker build -t hamelsmu/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile .
docker-compose build --force-rm --no-cache
# rebuild the services WITH cache
quick-build: .FORCE
docker-compose stop || true;
docker build -t hamelsmu/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile .
docker-compose build
# convert word & nb without Jekyll services
convert: .FORCE
docker-compose up converter
# stop all containers
stop: .FORCE
docker-compose stop
# remove all containers
remove: .FORCE
docker-compose stop || true; docker-compose rm || true;
# get shell inside the notebook converter service (Must already be running)
bash-nb: .FORCE
docker-compose exec watcher /bin/bash
# get shell inside jekyll service (Must already be running)
bash-jekyll: .FORCE
docker-compose exec jekyll /bin/bash
# restart just the Jekyll server
restart-jekyll: .FORCE
docker-compose restart jekyll
.FORCE:
# updates a notebook from a given py script file to a similarly named ipynb file
# usage: make script-to-notebook SCRIPT='path/to/script.py"
SCRIPT_BASENAME=$(shell basename -s ".py" "$(SCRIPT)")
script-to-notebook:
cd "$(shell dirname $(SCRIPT))" && \
jupytext -o "$(SCRIPT_BASENAME).ipynb" "$(SCRIPT_BASENAME).py" && \
papermill --kernel python3 "$(SCRIPT_BASENAME).ipynb" "$(SCRIPT_BASENAME).ipynb"