-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (32 loc) · 1.24 KB
/
Makefile
File metadata and controls
40 lines (32 loc) · 1.24 KB
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
image_name ?= hugo-dev
hugo_port ?= 1313
# BUILD COMMANDS
build_docker_shell:
docker build -t ${image_name}-shell -f ./docker/dockerfile_shell . --no-cache
build_docker_serve:
docker build -t ${image_name}-serve -f ./docker/dockerfile_serve . --no-cache
build_docker_build:
docker build -t ${image_name}-build -f ./docker/dockerfile_build . --no-cache
shell: clean build_docker_shell
docker run --name ${image_name}-shell \
--mount type=bind,source=./src,target=/src \
--mount type=bind,source=./blog_build,target=/build \
-it ${image_name}-shell
serve: clean build_docker_serve
docker run --name ${image_name}-serve \
--mount type=bind,source=./src,target=/src \
--mount type=bind,source=./blog_build,target=/build \
-it -p ${hugo_port}:${hugo_port} ${image_name}-serve
build: clean build_docker_build
docker run --name ${image_name}-serve \
--mount type=bind,source=./src,target=/src \
--mount type=bind,source=./blog_build,target=/build \
-p ${hugo_port}:${hugo_port} ${image_name}-build
clean:
docker rm --force ${image_name}-shell
docker rm --force ${image_name}-serve
docker rm --force ${image_name}-build
mv ./blog_build/.gitignore ./.blog_gitignore
rm -rf ./blog_build/
mkdir ./blog_build/
mv ./.blog_gitignore ./blog_build/.gitignore