-
Notifications
You must be signed in to change notification settings - Fork 7.1k
/
docker-bake.hcl
174 lines (151 loc) · 3.15 KB
/
docker-bake.hcl
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
variable "HUGO_ENV" {
default = "development"
}
variable "DOCS_URL" {
default = "https://docs.docker.com"
}
variable "DOCS_SITE_DIR" {
default = "public"
}
group "default" {
targets = ["release"]
}
target "index" {
# generate a new local search index
target = "index"
output = ["type=local,dest=static/pagefind"]
provenance = false
}
target "release" {
args = {
HUGO_ENV = HUGO_ENV
DOCS_URL = DOCS_URL
}
target = "release"
output = [DOCS_SITE_DIR]
provenance = false
}
group "validate" {
targets = ["lint", "test", "unused-media", "test-go-redirects", "dockerfile-lint", "path-warnings"]
}
target "test" {
target = "test"
output = ["type=cacheonly"]
provenance = false
}
target "lint" {
target = "lint"
output = ["type=cacheonly"]
provenance = false
}
target "unused-media" {
target = "unused-media"
output = ["type=cacheonly"]
provenance = false
}
target "test-go-redirects" {
target = "test-go-redirects"
output = ["type=cacheonly"]
provenance = false
}
target "dockerfile-lint" {
call = "check"
}
target "path-warnings" {
target = "path-warnings"
output = ["type=cacheonly"]
}
#
# releaser targets are defined in _releaser/Dockerfile
# and are used for AWS S3 deployment
#
target "releaser-build" {
context = "_releaser"
target = "releaser"
output = ["type=cacheonly"]
provenance = false
}
variable "AWS_REGION" {
default = ""
}
variable "AWS_S3_BUCKET" {
default = ""
}
variable "AWS_S3_CONFIG" {
default = ""
}
variable "AWS_CLOUDFRONT_ID" {
default = ""
}
variable "AWS_LAMBDA_FUNCTION" {
default = ""
}
target "_common-aws" {
args = {
AWS_REGION = AWS_REGION
AWS_S3_BUCKET = AWS_S3_BUCKET
AWS_S3_CONFIG = AWS_S3_CONFIG
AWS_CLOUDFRONT_ID = AWS_CLOUDFRONT_ID
AWS_LAMBDA_FUNCTION = AWS_LAMBDA_FUNCTION
}
secret = [
"id=AWS_ACCESS_KEY_ID,env=AWS_ACCESS_KEY_ID",
"id=AWS_SECRET_ACCESS_KEY,env=AWS_SECRET_ACCESS_KEY",
"id=AWS_SESSION_TOKEN,env=AWS_SESSION_TOKEN"
]
provenance = false
}
target "aws-s3-update-config" {
inherits = ["_common-aws"]
context = "_releaser"
target = "aws-s3-update-config"
no-cache-filter = ["aws-update-config"]
output = ["type=cacheonly"]
}
target "aws-lambda-invoke" {
inherits = ["_common-aws"]
context = "_releaser"
target = "aws-lambda-invoke"
no-cache-filter = ["aws-lambda-invoke"]
output = ["type=cacheonly"]
}
target "aws-cloudfront-update" {
inherits = ["_common-aws"]
context = "_releaser"
target = "aws-cloudfront-update"
contexts = {
sitedir = DOCS_SITE_DIR
}
no-cache-filter = ["aws-cloudfront-update"]
output = ["type=cacheonly"]
}
variable "VENDOR_MODULE" {
default = null
}
target "vendor" {
target = "vendor"
args = {
MODULE = VENDOR_MODULE
}
output = ["."]
provenance = false
}
variable "UPSTREAM_MODULE_NAME" {
default = null
}
variable "UPSTREAM_REPO" {
default = null
}
variable "UPSTREAM_COMMIT" {
default = null
}
target "validate-upstream" {
args {
UPSTREAM_MODULE_NAME = UPSTREAM_MODULE_NAME
UPSTREAM_REPO = UPSTREAM_REPO
UPSTREAM_COMMIT = UPSTREAM_COMMIT
}
target = "validate-upstream"
output = ["type=cacheonly"]
provenance = false
}