-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
19 lines (19 loc) · 813 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
.PHONY: run
run:
@echo "Deleting the _site folder..."
rm -rf _site
@if docker ps -aq --filter "name=premkumar-masilamani-blog" | grep -q .; then \
echo "Stopping existing container..."; \
docker stop premkumar-masilamani-blog && docker rm premkumar-masilamani-blog; \
fi
echo "Starting new container: premkumar-masilamani-blog"; \
docker run --name premkumar-masilamani-blog \
-e JEKYLL_ENV=docker \
-e PAGES_REPO_NWO=premkumar-masilamani/premkumar-masilamani.github.io \
-p 4000:4000 \
-v $${PWD}:/srv/jekyll \
jekyll/jekyll:4.2.0 \
jekyll serve --config _local-config.yml --watch --incremental --drafts & \
container_pid=$$!; \
trap "echo 'Stopping container...'; docker stop premkumar-masilamani-blog && docker rm premkumar-masilamani-blog; exit 0" INT TERM; \
wait $$container_pid