-
-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathmakefile
More file actions
130 lines (111 loc) · 3.67 KB
/
makefile
File metadata and controls
130 lines (111 loc) · 3.67 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/make -sf
# force use of Bash
SHELL := /usr/bin/env bash
INTERACTIVE=true
.PHONY: default
default: usage
usage:
@printf "usage:"
@printf "\tmake build-pure-on FISH_VERSION=3.3.1\t# build container\n"
@printf "\tmake test-pure-on FISH_VERSION=3.3.1\t# run tests\n"
@printf "\tmake dev-pure-on FISH_VERSION=3.3.1\t# dev in container\n"
@printf "\tmake update-changelog\t\t\t# update changelog from GitHub releases\n"
.PHONY: build-pure-on
build-pure-on: STAGE?=with-pure-installed
build-pure-on:
docker build \
--file ./docker/Dockerfile \
--target ${STAGE} \
--build-arg FISH_VERSION=${FISH_VERSION} \
--tag=pure-${STAGE}-${FISH_VERSION} \
--load \
./
.PHONY: dev-pure-on
dev-pure-on: CMD?=fish
dev-pure-on: STAGE?=with-pure-installed
dev-pure-on: TTY_FLAG?=$(shell [ -z "$$CI" ] && echo "--tty" || echo "")
dev-pure-on: USER_FLAG?=$(shell [ -z "$$CI" ] && echo "--user $$(id -u):$$(id -g)" || echo "")
dev-pure-on: build-with-pure-installed
chmod o=rwx tests/fixtures/ # for tests constants
docker run \
--name dev-pure-on-${FISH_VERSION} \
--rm \
--interactive \
$(TTY_FLAG) \
$(USER_FLAG) \
--env HOME=/home/nemo \
--env XDG_CONFIG_HOME=/home/nemo/.config \
--env XDG_DATA_HOME=/home/nemo/.local/share \
--volume=$$(pwd):/home/nemo/.config/fish/pure/ \
--workdir /home/nemo/.config/fish/pure/ \
pure-${STAGE}-${FISH_VERSION} "fish --version && ${CMD}"
chmod o=r-x tests/fixtures/ # for tests constants
.PHONY: test-pure-on
test-pure-on: CMD?=fishtape tests/*.test.fish
test-pure-on: STAGE?=with-pure-installed
test-pure-on: build-with-pure-installed
docker run \
--name test-pure-on-${FISH_VERSION} \
--rm \
--tty \
pure-${STAGE}-${FISH_VERSION} "fish --version && ${CMD}"
.PHONY: build-with-pure-installed
build-with-pure-installed:
$(MAKE) build-pure-on FISH_VERSION=${FISH_VERSION} STAGE=with-pure-installed
.PHONY: dev-with-pure-installed
dev-with-pure-installed:
$(MAKE) build-pure-on FISH_VERSION=${FISH_VERSION} STAGE=with-pure-installed
$(MAKE) dev-pure-on FISH_VERSION=${FISH_VERSION} STAGE=with-pure-installed
build-pure-on-nix: STAGE?=nix
build-pure-on-nix:
docker build \
--file ./docker/${STAGE}.Dockerfile \
--build-arg FISH_VERSION=${FISH_VERSION} \
--tag=pure-${STAGE}-${FISH_VERSION} \
--load \
./
dev-pure-on-nix: STAGE?=nix
dev-pure-on-nix: CMD?=fish
dev-pure-on-nix: TTY?=--tty
dev-pure-on-nix:
chmod o=rwx ./tests/fixtures/ # for tests constants
docker run \
--name dev-pure-on-${FISH_VERSION} \
--rm \
--interactive \
${TTY} \
--volume=$$(pwd):/tmp/.pure/ \
--workdir /tmp/.pure/ \
pure-${STAGE}-${FISH_VERSION} "fish --version && ${CMD}"
chmod o=r-x ./tests/fixtures/ # for tests constants
test-pure-on-nix: CMD?=fishtape tests/*.test.fish
test-pure-on-nix:
$(MAKE) dev-pure-on-nix CMD="${CMD}" TTY=
build-pure-doc:
docker build \
--file ./docker/doc.Dockerfile \
--tag=pure-doc \
--load \
./
serve-pure-doc:
docker run \
--name mkdocs \
--tty \
--interactive \
--rm \
--publish 8000:8000 \
--volume=$$(pwd):/docs \
pure-doc
.PHONY: update-changelog
update-changelog:
bash tools/update_changelog.bash
.PHONY: build-pure-screenshot
build-pure-screenshot:
$(MAKE) build-pure-on FISH_VERSION=${FISH_VERSION} STAGE=with-terminal-screenshot-installed
.PHONY: run-pure-screenshot
run-pure-screenshot: CMD?=fishtape tools/screenshot.fish
run-pure-screenshot:
mkdir --parents ./docs/assets/screenshots
chmod a+rwx ./docs/assets/screenshots # because Github user `runner` is not `nemo` we have permissions issue
rm --recursive --force ./docs/assets/screenshots/*.png
$(MAKE) dev-pure-on FISH_VERSION=${FISH_VERSION} STAGE=with-terminal-screenshot-installed CMD="CI=true ${CMD}"