forked from pure-fish/pure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
118 lines (99 loc) · 2.96 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
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
#!/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"
.PHONY: build-pure-on
build-pure-on: STAGE?=only-fish
build-pure-on:
docker build \
--quiet \
--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-source
dev-pure-on:
chmod o=rwx tests/fixtures/ # for migration-to-4.0.0.test.fish only
docker run \
--name dev-pure-on-${FISH_VERSION} \
--rm \
--interactive \
--tty \
--volume=$$(pwd):/home/nemo/.config/fish/pure/ \
--workdir /home/nemo/.config/fish/pure/ \
pure-${STAGE}-${FISH_VERSION} "${CMD}"
chmod o=r-x tests/fixtures/ # for migration-to-4.0.0.test.fish only
.PHONY: test-pure-on
test-pure-on: CMD?=fishtape tests/*.test.fish
test-pure-on: STAGE?=with-pure-source
test-pure-on: build-with-pure-source
docker run \
--name test-pure-on-${FISH_VERSION} \
--rm \
--tty \
pure-${STAGE}-${FISH_VERSION} "${CMD}"
.PHONY: build-with-pure-source
build-with-pure-source:
$(MAKE) build-pure-on FISH_VERSION=${FISH_VERSION} STAGE=with-pure-source
.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 migration-to-4.0.0.test.fish only
docker run \
--name dev-pure-on-${FISH_VERSION} \
--rm \
--interactive \
${TTY} \
--volume=$$(pwd):/tmp/.pure/ \
--workdir /tmp/.pure/ \
pure-${STAGE}-${FISH_VERSION} "${CMD}"
chmod o=r-x ./tests/fixtures/ # for migration-to-4.0.0.test.fish only
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: 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 tests/*.test.fish
run-pure-screenshot:
$(MAKE) dev-pure-on FISH_VERSION=${FISH_VERSION} STAGE=with-terminal-screenshot-installed CMD="${CMD}"