-
Notifications
You must be signed in to change notification settings - Fork 339
Expand file tree
/
Copy pathmise.toml
More file actions
95 lines (81 loc) · 2.92 KB
/
mise.toml
File metadata and controls
95 lines (81 loc) · 2.92 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
[settings]
unix_default_inline_shell_args = "bash -c -o errexit -o pipefail"
[tasks.dev]
description = "Run lint, test, and build"
depends = ["lint", "test", "build"]
[tasks.build]
description = "Build the application binary"
sources = ["**/*.go", "**/*.template", "**/*.txt", "**/*.yml", "**/*.yaml", "go.mod", "go.sum"]
run = ".mise/scripts/build.sh"
outputs = ["bin/docker-agent"]
[tasks.deploy-local]
description = "Deploy the cli-plugin"
depends = ["build"]
run = [
"mkdir -p ${HOME}/.docker/cli-plugins",
"/bin/ln -sf $(pwd)/bin/docker-agent ${HOME}/.docker/cli-plugins/docker-agent",
]
[tasks.lint]
description = "Run the linters"
sources = ["**/*.go", ".golangci.yml", "go.mod", "go.sum"]
run = [
"golangci-lint run",
"go run ./lint .",
"go mod tidy --diff >/dev/null || (echo 'go.mod/go.sum files are not tidy' && exit 1)",
]
[tasks.format]
description = "Format code"
sources = ["**/*.go", ".golangci.yml"]
run = "golangci-lint fmt"
[tasks.test]
description = "Run tests"
run = "go test ./..."
[tasks.test.env]
_.file = ".env.test"
[tasks.test-binary]
description = "Run tests on build binary"
depends = ["deploy-local"]
run = "go test -tags=binary_required ./e2e/binary/..."
[tasks.test-binary.env]
_.file = ".env.test"
[tasks.build-local]
description = "Build binaries for local host platform"
run = """
. .mise/helpers/git-env.sh
docker build --target=local --build-arg GIT_TAG="${GIT_TAG}" --build-arg GIT_COMMIT="${GIT_COMMIT}" --platform local --output=./dist .
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
mv ./dist/docker-agent ./dist/docker-agent.exe
fi
"""
[tasks.cross]
description = "Build binaries for multiple platforms"
run = """
. .mise/helpers/git-env.sh
docker buildx build --target=cross --build-arg GIT_TAG="${GIT_TAG}" --build-arg GIT_COMMIT="${GIT_COMMIT}" --platform linux/amd64,linux/arm64,darwin/amd64,darwin/arm64,windows/amd64,windows/arm64 --output=./dist .
"""
[tasks.build-image]
description = "Build Docker image"
run = """
. .mise/helpers/git-env.sh
docker build -t docker/docker-agent --build-arg GIT_TAG="${GIT_TAG}" --build-arg GIT_COMMIT="${GIT_COMMIT}" .
"""
[tasks.push-image]
description = "Build and Push Docker image"
run = """
. .mise/helpers/git-env.sh
docker buildx build --push --platform linux/amd64,linux/arm64 -t docker/docker-agent --build-arg GIT_TAG="${GIT_TAG}" --build-arg GIT_COMMIT="${GIT_COMMIT}" .
"""
[tasks.docs-serve]
description = "Preview the Jekyll documentation site locally"
dir = "docs"
run = [
"docker build -t docker-agent-docs .",
"docker run --rm -v $(cd .. && pwd)/docs:/srv/jekyll -e JEKYLL_ENV=development -p 4000:4000 docker-agent-docs jekyll serve --host 0.0.0.0 --config _config.yml,_config.dev.yml --livereload",
]
[tasks.docs-check-links]
description = "Build the documentation site and check for broken links"
dir = "docs"
run = "../.mise/scripts/docs-check-links.sh"
[tasks.record-demo]
description = "Record demo gif"
run = "vhs ./docs/recordings/demo.tape"