Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
188 lines (152 loc) · 4.35 KB
/
Copy pathjustfile
File metadata and controls
188 lines (152 loc) · 4.35 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
watch +args='lcheck':
cargo watch --clear --exec '{{ args }}'
clippy: (watch 'lclippy --tests --all --all-targets -- --deny warnings')
check: (watch 'lcheck --tests --all --all-targets')
test *args: (watch f'ltest --all --all-targets {{args}}')
lib *args: (watch f'ltest --lib {{args}}')
ci: lint
cargo ltest --workspace
cargo lrun --package generate
mdbook build book
build:
cargo lbuild
serve: build
./target/debug/filepack serve --address localhost --http-port 8000
open:
open http://localhost:8000
install:
cargo install --locked --path .
[arg('branch', long)]
deploy branch='master' remote='casey/filepack' domain='filepack.com':
ssh root@{{domain}} '\
export DEBIAN_FRONTEND=noninteractive \
&& mkdir -p deploy \
&& apt-get update --yes \
&& apt-get upgrade --yes \
&& apt-get install --yes git rsync'
rsync -avz deploy/checkout root@{{domain}}:deploy/checkout
ssh root@{{domain}} 'cd deploy && ./checkout {{branch}} {{remote}} {{domain}}'
log unit='filepack' domain='filepack.com':
ssh root@{{domain}} 'journalctl -fu {{unit}}'
lint:
cargo lclippy --workspace --all-targets -- --deny warnings
./bin/forbid
cargo fmt --all -- --check
outdated:
cargo outdated --workspace --root-deps-only
unused:
cargo +nightly udeps --workspace
coverage:
cargo +nightly llvm-cov --branch --html
open target/llvm-cov/html/index.html
update-changelog:
echo >> CHANGELOG.md
git log --pretty='format:- %s' >> CHANGELOG.md
update-contributors:
changeling update-contributors
doc package='':
#!/usr/bin/env zsh
set -euo pipefail
if [ {{ package }} ]; then
cargo doc --package {{ package }} --open
else
cargo doc --all --open
fi
tmp:
rm -rf tmp
mkdir tmp
example: tmp
cp README.md tmp
mkdir tmp/src
cp src/main.rs tmp/src
cargo run create tmp
cargo run sign --time tmp
cat tmp/manifest.filepack | jq | pbcopy
publish: tmp
#!/usr/bin/env bash
set -euxo pipefail
git clone git@github.com:casey/filepack.git tmp
cd tmp
VERSION=`bin/version`
git tag -a $VERSION -m "Release $VERSION"
git push origin $VERSION
cargo publish --workspace
test-release-workflow:
-git tag -d test-release
-git push origin :test-release
git tag test-release
git push origin test-release
shellcheck-install-script:
shellcheck static/install.sh
test-install-script:
rm -rf tmp
static/install.sh --to tmp
list-package:
cargo package --list --allow-dirty
commit-release:
git commit --edit --file release-commit-message.txt
test-progress-bar: tmp
#!/usr/bin/env bash
head -c 1073741824 /dev/urandom > tmp/data0
for i in {1..9}; do
cp tmp/data0 tmp/data$i
done
cargo run --release create tmp
rm tmp/data*
sign-release: tmp
#!/usr/bin/env bash
set -euxo pipefail
VERSION=`bin/version`
gh release download \
--repo casey/filepack \
--pattern manifest.filepack \
--dir tmp \
$VERSION
cargo run sign tmp/manifest.filepack
gh release upload \
--clobber \
--repo casey/filepack \
$VERSION \
tmp/manifest.filepack
verify-release: tmp
#!/usr/bin/env bash
set -euxo pipefail
VERSION=`bin/version`
gh release download \
--repo casey/filepack \
--pattern '*' \
--dir tmp \
$VERSION
cargo run verify tmp --key 3c977ea3a31cd37f0b540f02f33eab158f2ed7449f42b05613c921181aa95b79
profile:
cargo flamegraph --test integration --profile dev
languages:
brew install iso-codes
jq -r \
'.["639-3"][] \
| select(.["alpha_2"] != null) \
| "(\"\( .["alpha_2"] )\", \"\( .name | gsub(" \\([^)]*\\)"; "") )\"),"' \
/opt/homebrew/share/iso-codes/json/iso_639-3.json
upload:
rm -rf tmp/upload
git clone . tmp/upload
rm -rf tmp/upload/.git
cargo build --release
./target/release/filepack create tmp/upload
./target/release/filepack upload tmp/upload/manifest.filepack --server https://filepack.com --auth master
download:
#!/usr/bin/env bash
set -euxo pipefail
rm -rf tmp/download
cargo build --release
fingerprint=`./target/release/filepack fingerprint tmp/upload/manifest.filepack`
./target/release/filepack download --server https://filepack.com --package $fingerprint tmp/download
clear-server:
rm ~/.filepack/database.redb
book:
#!/usr/bin/env bash
set -euo pipefail
cargo lrun --package generate
mdbook serve book --open &
trap 'kill $!' EXIT
cargo watch --clear --ignore book --exec 'lrun --package generate'