-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
garden.yaml
153 lines (146 loc) · 4.6 KB
/
garden.yaml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# examples:
# garden build -- --offline
# garden -D prefix=/usr/local install
# garden -D prefix=/usr/local install-doc
# garden -vv check
# garden doc
#
# Variables can be set externally. e.g.:
# garden -D DESTDIR=/tmp/stage -D prefix=/usr/local install-doc
variables:
DESTDIR: ""
prefix: ~/.cargo
bindir: ${prefix}/bin
docdir: ${prefix}/share/doc/garden
target: x86_64-unknown-linux-musl
pkg: ${GARDEN_CONFIG_DIR}/pkg
debdir: ${pkg}/deb
fetch: ""
disable-fetch: $ test -n "${fetch}" || printf '%s' --disable-fetch
no-fetch: $ test -n "${fetch}" || printf '%s' --no-fetch
# usage:
# garden <cmd> [<tree-query>] [-- [<args>]]
commands:
bench: cargo bench "$@"
build: cargo build "$@"
check>:
- check/fmt
- check/audit
- check/clippy
- check/deny
- test
check/audit: |
if type cargo-audit >/dev/null 2>&1
then
cargo audit ${no-fetch} "$@"
fi
check/clippy: cargo clippy --all "$@" -- -D warnings
check/deny: |
if type cargo-deny >/dev/null 2>&1
then
cargo deny check ${disable-fetch} "$@"
fi
check/fmt: cargo fmt --check "$@"
clean: cargo clean "$@"
commit: git commit "$@"
coverage: cargo kcov "$@"
diff: git diff "$@"
diffs: git diff --staged "$@"
doc: |
env RUSTDOCFLAGS='-D warnings' \
cargo doc --no-deps --document-private-items --workspace
cd ./doc
mdbook build --dest-dir book.new
rsync -r --delete --exclude=.git book.new/ book/
rm -rf book.new
fix: cargo clippy --all --fix "$@" -- -D warnings
fmt: cargo fmt "$@"
git: git "$@"
install: cargo install --path . --root "${DESTDIR}${prefix}"
install-doc<: doc
install-doc: |
mkdir -p "${DESTDIR}${docdir}"
rsync -r --exclude=.git doc/book/ "${DESTDIR}${docdir}/"
pkg/deb>:
- pkg/deb/build
- pkg/deb/completion
- pkg/deb/doc
- pkg/deb/package
pkg/deb/build: |
cargo build --profile deb --target "${target}"
pkg/deb/completion: |
mkdir -p "${debdir}/completion"
"$0" completion bash >"${debdir}/completion/garden.bash"
"$0" completion fish >"${debdir}/completion/garden.fish"
"$0" completion zsh >"${debdir}/completion/_garden"
pkg/deb/doc: mdbook build --dest-dir "${debdir}/userguide" doc
pkg/deb/package: cargo deb --profile deb --target "${target}"
push: git push "$@"
setup: |
git fetch -q pages 2>/dev/null || (
cat <<-\EOF
error: The "pages" remote is not available.
To fix this, run this command and try again:
garden grow .
EOF
return 1
)
garden ${GARDEN_CMD_VERBOSE} grow doc
garden ${GARDEN_CMD_VERBOSE} grow homebrew
stage: git add --update "$@"
stat: git status --short "$@"
status: git status "$@"
test: cargo test "$@"
update: cargo update "$@"
watch: cargo watch --shell "garden ${GARDEN_CMD_VERBOSE} build && garden ${GARDEN_CMD_VERBOSE} check"
# Trees define named repositories where commands are run.
trees:
garden:
description: Garden grows and cultivates collections of Git trees
path: ${GARDEN_CONFIG_DIR}
url: "[email protected]:garden-rs/garden.git"
remotes:
davvid: "[email protected]:davvid/garden.git"
github: "[email protected]:garden-rs/garden.git"
jordilin: "[email protected]:jordilin/garden.git"
jtietema: "[email protected]:jtietema/garden.git"
slackline: "[email protected]:slackline/garden.git"
pages: "[email protected]:garden-rs/garden-rs.gitlab.io.git"
gitconfig:
remote.origin.pushurl:
- "[email protected]:garden-rs/garden.git"
- "[email protected]:garden-rs/garden.git"
branch.pages.remote: pages
remote.pages.pushurl:
- "[email protected]:garden-rs/garden-rs.gitlab.io.git"
- "[email protected]:garden-rs/garden.git"
links:
- "https://garden-rs.gitlab.io"
- "https://crates.io/crates/garden-tools"
- "https://docs.rs/garden-tools/latest/garden/"
- "https://lib.rs/crates/garden-tools"
- "https://gitlab.com/garden-rs/garden"
- "https://github.com/garden-rs/garden"
doc:
description: Prebuilt garden user manual for garden-rs.gitlab.io
path: doc/book
worktree: garden
branch: pages
branches:
pages: pages/pages
homebrew:
description: Homebrew tap for installing Garden on macOS
url: "[email protected]:garden-rs/homebrew-garden.git"
remotes:
github: "[email protected]:garden-rs/homebrew-garden.git"
gitconfig:
remote.origin.pushurl:
- "[email protected]:garden-rs/homebrew-garden.git"
- "[email protected]:garden-rs/homebrew-garden.git"
links:
- "https://gitlab.com/garden-rs/homebrew-garden"
groups:
all:
- garden
- doc
- homebrew