-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFluxFile.example
More file actions
96 lines (82 loc) · 1.83 KB
/
Copy pathFluxFile.example
File metadata and controls
96 lines (82 loc) · 1.83 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
var PROJECT = flux
var VERSION = $(shell "git describe --tags --always")
var MODE = dev
task build:
desc: Build the Go binary
deps: fmt, lint
cache: true
inputs:
cmd/**/*.go
internal/**/*.go
go.mod
outputs:
dist/${PROJECT}
env:
GO111MODULE = on
run:
go build -o dist/${PROJECT} ./cmd/flux
task fmt:
desc: Format Go code
run:
go fmt ./...
task lint:
desc: Run Go linter
run:
golangci-lint run
task test:
desc: Run all tests
run:
go test ./... -v
task ci:
desc: Run CI tasks in parallel
parallel: true
deps: test, lint, build
task dev:
desc: Watch for changes and rebuild
watch: **/*.go
ignore:
vendor/**
**/*_test.go
.git/**
run:
go run ./cmd/flux
task build-all:
desc: Cross-compile for multiple platforms
matrix:
os: linux, darwin, windows
arch: amd64, arm64
run:
GOOS=${os} GOARCH=${arch} go build -o dist/${PROJECT}-${os}-${arch} ./cmd/flux
task docker-build:
desc: Build Docker image
docker: true
run:
docker build -t ${PROJECT}:${VERSION} .
task deploy:
desc: Deploy to production (only in prod mode)
if: MODE == prod
remote: "root@server.example.com"
deps: docker-build
run:
docker pull ${PROJECT}:${VERSION}
docker compose up -d
task deploy-dev:
desc: Deploy to development environment
if: MODE == dev
run:
echo "Deploying to dev environment..."
docker compose -f docker-compose.dev.yml up -d
task clean:
desc: Remove build artifacts
run:
rm -rf dist/
rm -rf .flux/
profile dev:
env:
MODE = dev
LOG = debug
profile prod:
env:
MODE = production
LOG = error
include "plugins/docker.flux"