-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
82 lines (68 loc) · 1.66 KB
/
justfile
File metadata and controls
82 lines (68 loc) · 1.66 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
# Print available commands
default:
@just --list
# Build a command
[group("build")]
build $cmd:
mkdir -p dist
go build -o dist/{{ cmd }} ./cmd/{{ cmd }}
# Build all backends
[group("build")]
build-backends: \
(build "standard-backups-rsync-backend") \
(build "standard-backups-restic-backend")
# Build all binaries
[group("build")]
build-all: \
build-backends \
(build "standard-backups")
# Builds distribution packages used for releases
[group("build")]
build-pkgs:
goreleaser release --snapshot --clean
# Run standard-backups
run *args: build-backends
go run ./cmd/standard-backups {{ args }}
# Run standard-backups using config in `example/config/`
run-example *args: build-backends
#!/usr/bin/env bash
XDG_DATA_DIRS="$PWD/examples/config/share" \
go run ./cmd/standard-backups \
--config examples/config/etc/standard-backups/config.yaml \
{{ args }}
# Run unit tests
[group("test")]
test:
gotestsum \
--format standard-verbose \
--packages $(go list ./... | grep -v 'standard-backups/e2e')
# Run end-to-end tests
[group("test")]
e2e filter="": build-all
gotestsum \
--format standard-verbose \
--packages $(go list ./... | grep 'standard-backups/e2e') \
{{ if filter == "" {""} else { "-- -run " + filter } }}
# Runs all tests
[group("test")]
test-all: test e2e
# Generate mocks
[group("test")]
generate-mocks:
mockery
# Run static code checks
[group("checks")]
lint:
golangci-lint run
# Apply automated fixes for static code checks
[group("checks")]
lint-fix:
golangci-lint run --fix
# Format code
[group("checks")]
fmt:
golangci-lint fmt
# Check if code is formatted
[group("checks")]
fmt-check:
golangci-lint fmt -d