forked from docker/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-bake.hcl
150 lines (131 loc) · 2.7 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
variable "HUGO_ENV" {
default = "development"
}
variable "DOCS_URL" {
default = "https://docs.docker.com"
}
variable "DOCS_SITE_DIR" {
default = "public"
}
variable "DOCS_ENFORCE_GIT_LOG_HISTORY" {
default = "0"
}
group "default" {
targets = ["release"]
}
target "release" {
args = {
HUGO_ENV = HUGO_ENV
DOCS_URL = DOCS_URL
}
target = "release"
output = [DOCS_SITE_DIR]
}
group "validate" {
targets = ["lint", "test"]
}
target "test" {
target = "test"
output = ["type=cacheonly"]
}
target "lint" {
target = "lint"
output = ["type=cacheonly"]
}
#
# releaser targets are defined in _releaser/Dockerfile
# and are used for Netlify and AWS S3 deployment
#
target "releaser-build" {
context = "_releaser"
target = "releaser"
output = ["type=cacheonly"]
}
variable "NETLIFY_SITE_NAME" {
default = ""
}
target "_common-netlify" {
args = {
NETLIFY_SITE_NAME = NETLIFY_SITE_NAME
}
secret = [
"id=NETLIFY_AUTH_TOKEN,env=NETLIFY_AUTH_TOKEN"
]
}
target "netlify-remove" {
inherits = ["_common-netlify"]
context = "_releaser"
target = "netlify-remove"
no-cache-filter = ["netlify-remove"]
output = ["type=cacheonly"]
}
target "netlify-deploy" {
inherits = ["_common-netlify"]
context = "_releaser"
target = "netlify-deploy"
contexts = {
sitedir = DOCS_SITE_DIR
}
no-cache-filter = ["netlify-deploy"]
output = ["type=cacheonly"]
}
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"
]
}
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"]
}
target "vendor" {
target = "vendor"
args = {
MODULE = null
}
output = ["."]
}