-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmise.toml
More file actions
135 lines (116 loc) · 2.81 KB
/
mise.toml
File metadata and controls
135 lines (116 loc) · 2.81 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
[tools]
aws = "2"
"cargo:cargo-deny" = "0.19"
"cargo:cargo-llvm-cov" = "0.8"
"npm:@stoplight/spectral-cli" = "6"
[env]
_.file = ".env.local"
[tasks.build]
run = '''
cargo build --all-features
'''
[tasks.ci]
depends = ["lint*", "test", "check"]
[tasks.lint]
depends = ["build"]
run = '''
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
'''
[tasks.lint-oas]
run = '''
spectral lint public/api/openapi.yaml
'''
[tasks.test]
depends = ["build"]
run = '''
cargo test --all
'''
[tasks.test-coverage]
depends = ["build"]
run = '''
cargo llvm-cov test --lcov --output-path ./target/lcov.info
'''
[tasks.test-coverage-watch]
run = '''
cargo watch -x 'llvm-cov test --lcov --output-path ./target/lcov.info' -w src
'''
[tasks.check]
depends = ["build"]
run = '''
cargo deny check
'''
[tasks."api:publish"]
run = '''
aws --version
aws s3 sync ./public/api s3://${AWS_S3_BUCKET}/ \
--exclude "*.DS_Store" \
--delete
curl -X POST "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE_ID}/purge_cache" \
-H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \
-H "Content-Type: application/json" \
--data "{\"hosts\":[\"${CLOUDFLARE_HOST}\"]}"
'''
[tasks."fetch"]
run = '''
cargo run -- fetch
'''
[tasks."fetch:vendor"]
usage = '''
arg <vendor> "Vendor to fetch (e.g. temurin)"
complete "vendor" run="cargo run -- ls vendor"
'''
run = '''
cargo run -- fetch {{arg(name="vendor")}}
'''
[tasks."export:mise"]
run = '''
cargo run -- export release-type \
--pretty \
-o 'linux,macosx,windows' \
-a 'aarch64,arm32,i686,x86_64' \
-e 'architecture,checksum_url,filename,os,release_type,size' \
-f 'file_type=tar.gz,tar.xz,zip&image_type=jre,jdk&features=!certified,!debug,!fastdebug,!freetype'
'''
[tasks."export:release-type"]
run = '''
cargo run -- export release-type \
--pretty \
-o linux,macosx,windows \
-a aarch64,arm32,i686,x86_64
'''
[tasks."export:vendor"]
run = '''
cargo run -- export vendor \
--pretty \
-o linux,macosx,windows \
-a aarch64,arm32,i686,x86_64
'''
[tasks."db:dump"]
run = '''
if ! command -v pg_dump &> /dev/null; then
echo "pg_dump not found, please install it (brew install libpq)"
exit 1
fi
pg_dump \
--host=$ROAST_DB_HOST \
--port=$ROAST_DB_PORT \
--username=$ROAST_DB_USR \
--dbname=$ROAST_DB_NAME \
--format=plain | gzip > backup/"$(date -u +"%Y-%m-%dT%H.%M.%SZ")-roast.sql.gz"
'''
[tasks."db:restore"]
usage = '''
arg <file> "Backup .sql.gz file to restore"
complete "file" run="ls backup/*.sql.gz | sort -r"
'''
run = '''
if ! command -v psql &> /dev/null; then
echo "psql not found, please install it (brew install libpq)"
exit 1
fi
gunzip -c {{arg(name="file")}} | \
psql postgresql://$ROAST_DB_HOST:$ROAST_DB_PORT/$ROAST_DB_NAME \
--username=$ROAST_DB_USR \
--password
'''