-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
96 lines (82 loc) · 3.65 KB
/
Makefile.toml
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
[tasks.localstack-setup]
script = [
"docker run --rm -it -d --name localstack -p 4566:4566 -e SERVICES=sts,s3 localstack/localstack",
"sleep 5",
]
[tasks.localstack-teardown]
command = "docker"
args = ["kill", "localstack"]
[tasks.create-bucket]
env = { AWS_SECRET_ACCESS_KEY = "dummy", AWS_DEFAULT_REGION = "us-east-1" }
script = [
"AWS_ACCESS_KEY_ID='012345678901' aws --endpoint-url=http://localhost:4566 s3 mb s3://foo.example.com",
"AWS_ACCESS_KEY_ID='012345678901' aws --endpoint-url=http://localhost:4566 s3 sync ./tests/data s3://foo.example.com",
"AWS_ACCESS_KEY_ID='012345678901' aws --endpoint-url=http://localhost:4566 s3 mb s3://bar.example.net",
"AWS_ACCESS_KEY_ID='012345678901' aws --endpoint-url=http://localhost:4566 s3 sync ./tests/data s3://bar.example.net",
"AWS_ACCESS_KEY_ID='123456789012' aws --endpoint-url=http://localhost:4566 s3 mb s3://foobar.example.com",
"AWS_ACCESS_KEY_ID='123456789012' aws --endpoint-url=http://localhost:4566 s3 sync ./tests/data s3://foobar.example.com",
]
[tasks.create-bucket.windows]
env = { AWS_SECRET_ACCESS_KEY = "dummy", AWS_DEFAULT_REGION = "us-east-1" }
script = [
"set AWS_ACCESS_KEY_ID='012345678901'",
"aws --endpoint-url=http://localhost:4566 s3 mb s3://foo.example.com",
"aws --endpoint-url=http://localhost:4566 s3 sync ./tests/data s3://foo.example.com",
"aws --endpoint-url=http://localhost:4566 s3 mb s3://bar.example.net",
"aws --endpoint-url=http://localhost:4566 s3 sync ./tests/data s3://bar.example.net",
"set AWS_ACCESS_KEY_ID='123456789012'",
"aws --endpoint-url=http://localhost:4566 s3 mb s3://foobar.example.com",
"aws --endpoint-url=http://localhost:4566 s3 sync ./tests/data s3://foobar.example.com",
]
[tasks.local-setup]
run_task = { name = [
"localstack-setup",
"create-bucket",
], fork = true }
[tasks.local-teardown]
run_task = { name = [
"localstack-teardown",
], fork = true }
[tasks.test-build]
install_crate = "cargo-zigbuild"
script = [
"cargo auditable zigbuild --target ${CARGO_MAKE_RUST_TARGET_ARCH}-unknown-linux-gnu --features __tests",
"cp target/${CARGO_MAKE_RUST_TARGET_ARCH}-unknown-linux-gnu/debug/storage-gateway target/debug/storage-gateway",
]
[tasks.test-build.windows]
install_crate = "cargo-zigbuild"
script = [
"cargo auditable zigbuild --target x86_64-unknown-linux-gnu --features __tests",
"copy .\\target\\x86_64-unknown-linux-gnu\\debug\\storage-gateway .\\target\\debug\\storage-gateway",
]
[tasks.test-container-build]
dependencies = ["test-build"]
command = "docker"
args = ["build", "-t", "test-storage-gateway", "-f", "test.Dockerfile", "."]
[tasks.integration-test]
command = "cargo"
args = ["test", "--test", "integration_test", "--", "--ignored"]
[tasks.unit-test]
command = "cargo"
args = ["test", "--all", "--", "--nocapture"]
[tasks.local-integration-test]
run_task = { name = [
"test-container-build",
"local-setup",
"integration-test",
], fork = true, cleanup_task = "local-teardown" }
[tasks.aarch64-build]
command = "cargo"
install_crate = "cargo-zigbuild"
args = ["auditable", "zigbuild", "--target", "aarch64-unknown-linux-musl", "--release"]
[tasks.x86_64-build]
command = "cargo"
install_crate = "cargo-zigbuild"
args = ["auditable", "zigbuild", "--target", "x86_64-unknown-linux-musl", "--release"]
[tasks.container-build-and-push]
dependencies = ["aarch64-build", "x86_64-build"]
script = [
"docker buildx create --use --name builder",
"docker buildx build --push --platform linux/arm64,linux/amd64 -t ghcr.io/takenoko-gohan/storage-gateway:v${CARGO_MAKE_CRATE_VERSION} -t ghcr.io/takenoko-gohan/storage-gateway:latest -f release.Dockerfile .",
"docker buildx rm builder",
]