-
Notifications
You must be signed in to change notification settings - Fork 0
/
.dague.reference.yml
117 lines (111 loc) · 3.37 KB
/
.dague.reference.yml
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
# Any variables you need to define all the other content
vars:
# It can be a static value
IMAGE_NAME: my_image
# Or any output of a shell script if starting with 'shell'
HOST_GOCACHE: shell go env GOCACHE
# Go related configuration
go:
# Base image used to build and run tools
image:
# Source of the image
src: golang:1.19.4-alpine3.17
# APK packages to install, if alpine based
apkPackages:
- build-base
- git
# APT packages to install, if debian based
aptPackages:
- gcc
# Go packages to install
goPackages:
- mvdan.cc/gofumpt@latest
# Caches to use
caches:
- target: /go/pkg
# Mount points
mounts:
# Key can be expanded using env variables or top level variables
${HOST_GOCACHE}: /cache/go
# Environment variables for the base images
env:
GOCACHE: /cache/go
# Directory to mount files
appDir: /go/src
# Configuration of formatters
fmt:
# Choice of the formatter. Default if gofmt, but you can install others like gofumpt as package in go.image.goPackages
# and then configure it here
formatter: gofumpt
# Configuration of goimports tool, that is run before the formatter
goimports:
# Configuration of locals to group them after 3rd party imports
locals:
- github.com/docker
- github.com/eunomie/dague
# Configuration of linters
lint:
# Govulncheck, can be enabled or disabled
govulncheck:
enable: true
# Golangci-lint, can be enabled or disabled
golangci:
enable: true
# Golangci-lint image to use
image: golangci/golangci-lint:v1.50.1
# Build configuration
build:
# List of targets to build by their name
targets:
local: &dague-build # This identifier will be re-used to avoid duplication (optional)
# Relative path to build
path: ./cmd/docker-dague
# Relative folder to put the generate files
out: ./dist
# List of environment variables
env:
# Could be a static value
CGO_ENABLED: 0
# Or a shell command to execute, if starts with shell
GIT_COMMIT: shell git describe --tags | cut -c 2-
# Ldflags to use to build. Environment variable will be expanded.
ldflags: -s -w -X 'github.com/eunomie/dague/internal.Version=${GIT_COMMIT:-dev}'
cross:
<< : *dague-build # Copy all from above target and specify some values
# Defines the list of platforms to build
platforms:
- linux/amd64
- linux/arm64
- darwin/amd64
- darwin/arm64
- windows/amd64
- windows/arm64
# Run arbitrary commands from the inside of the build container
exec:
# Map of targets to run, with a shell script to exec
info:
# Dependencies to run before
deps:
- tasks info
# Script to run inside the build container
cmds: |
uname -a > info.txt
go version >> info.txt
# Export files to the host
export:
pattern: "info.txt"
path: "."
# Run arbitrary tasks
tasks:
# Map of targets with a shell script to run
name:
cmds: echo this is a task
info:
# Dependencies to run before this task
deps:
- go:exec info
# Commands can use the file exported by the go:exec task in dependency
cmds: |
uname -a
cat info.txt
rm -f info.txt