-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathTaskfile.terragrunt.yml
More file actions
677 lines (615 loc) · 22.8 KB
/
Taskfile.terragrunt.yml
File metadata and controls
677 lines (615 loc) · 22.8 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
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
version: '3'
silent: true
vars:
TF_VERSION_FROM_TAG:
sh: printf "%s" "{{.VERSION}}" | sed -E 's/^tf-([0-9]+\.[0-9]+\.[0-9]+)-ot-([0-9]+\.[0-9]+\.[0-9]+)-tg-([0-9]+\.[0-9]+\.[0-9]+)$/\1/'
OT_VERSION_FROM_TAG:
sh: printf "%s" "{{.VERSION}}" | sed -E 's/^tf-([0-9]+\.[0-9]+\.[0-9]+)-ot-([0-9]+\.[0-9]+\.[0-9]+)-tg-([0-9]+\.[0-9]+\.[0-9]+)$/\2/'
TG_VERSION_FROM_TAG:
sh: printf "%s" "{{.VERSION}}" | sed -E 's/^tf-([0-9]+\.[0-9]+\.[0-9]+)-ot-([0-9]+\.[0-9]+\.[0-9]+)-tg-([0-9]+\.[0-9]+\.[0-9]+)$/\3/'
AWS_VERSION:
sh: sed -nE 's/^ARG AWS_VERSION=([0-9.]+)$/\1/p' Dockerfile | head -1
GCP_VERSION:
sh: sed -nE 's/^ARG GCP_VERSION=([0-9.]+)$/\1/p' Dockerfile | head -1
AZ_VERSION:
sh: sed -nE 's/^ARG AZ_VERSION=([0-9.]+)$/\1/p' Dockerfile | head -1
TF_VERSION:
sh: sed -nE 's/^ARG TF_VERSION=([0-9.]+)$/\1/p' Dockerfile | head -1
OT_VERSION:
sh: sed -nE 's/^ARG OT_VERSION=([0-9.]+)$/\1/p' Dockerfile | head -1
TG_VERSION:
sh: sed -nE 's/^ARG TG_VERSION=([0-9.]+)$/\1/p' Dockerfile | head -1
TFLINT_VERSION:
sh: sed -nE 's/^ARG TFLINT_VERSION=([0-9.]+)$/\1/p' Dockerfile | head -1
HCLEDIT_VERSION:
sh: sed -nE 's/^ARG HCLEDIT_VERSION=([0-9.]+)$/\1/p' Dockerfile | head -1
SOPS_VERSION:
sh: sed -nE 's/^ARG SOPS_VERSION=([0-9.]+)$/\1/p' Dockerfile | head -1
GITHUB_REF:
sh: echo "${GITHUB_REF:-refs/heads/null}"
GITHUB_SHA:
sh: echo "${GITHUB_SHA:-aabbccddeeff}"
VERSION_PREFIX:
sh: echo "${VERSION_PREFIX:-}"
GITHUB_SHORT_SHA:
sh: printf "%s" "{{.GITHUB_SHA}}" | cut -c1-7
TF_TG_VERSION: tf-{{.TF_VERSION}}-tg-{{.TG_VERSION}}
OT_TG_VERSION: ot-{{.OT_VERSION}}-tg-{{.TG_VERSION}}
FULL_VERSION: tf-{{.TF_VERSION}}-ot-{{.OT_VERSION}}-tg-{{.TG_VERSION}}
DOCKER_USERNAME:
sh: echo "${DOCKER_USERNAME:-christophshyper}"
DOCKER_ORG_NAME:
sh: echo "${DOCKER_ORG_NAME:-devopsinfra}"
DOCKER_IMAGE: docker-terragrunt
DOCKER_NAME: '{{.DOCKER_ORG_NAME}}/{{.DOCKER_IMAGE}}'
DOCKER_HUB_API: https://hub.docker.com/v2
GITHUB_USERNAME:
sh: echo "${GITHUB_USERNAME:-ChristophShyper}"
GITHUB_ORG_NAME:
sh: echo "${GITHUB_ORG_NAME:-devops-infra}"
GITHUB_NAME: ghcr.io/{{.GITHUB_ORG_NAME}}/{{.DOCKER_IMAGE}}
BUILD_DATE:
sh: date -u +"%Y-%m-%dT%H:%M:%SZ"
FLAVORS: aws azure aws-azure gcp aws-gcp azure-gcp aws-azure-gcp
LABEL_AUTHOR: Krzysztof ChristophShyper Szyper <biotyk@mail.com>
LABEL_NAME: IaaC dockerized framework for Terragrunt, Terraform and OpenTofu
LABEL_DESCRIPTION: >-
Docker image with Terragrunt v{{.TG_VERSION}}, Terraform v{{.TF_VERSION}}
or OpenTofu v{{.OT_VERSION}}, together with all needed components
to easily manage cloud infrastructure.
LABEL_REPO_URL: https://github.com/devops-infra/docker-terragrunt
LABEL_HOMEPAGE: https://shyper.pro
LABEL_VENDOR: DevOps-Infra
CI_VERSION_PREFIX:
sh: |
if [ -n "${VERSION_PREFIX:-}" ]; then
printf "%s" "${VERSION_PREFIX}"
elif [ -n "${VERSION_SUFFIX:-}" ]; then
suffix="${VERSION_SUFFIX#-}"
if [ -n "$suffix" ]; then
printf "%s-" "$suffix"
fi
fi
EFFECTIVE_PREFIX:
sh: |
if [ -n "${VERSION_PREFIX:-}" ]; then
printf "%s" "${VERSION_PREFIX}"
else
printf "%s" "{{.CI_VERSION_PREFIX}}"
fi
tasks:
terragrunt:help:
desc: Display docker-terragrunt custom tasks
cmds:
- |
echo "Terragrunt migration tasks:"
echo " build-all, build-parallel, build-slim, build-plain, build-aws"
echo " build-azure, build-aws-azure, build-gcp, build-aws-gcp"
echo " build-azure-gcp, build-aws-azure-gcp"
echo " push-parallel, push-slim, push-plain, push-aws, push-azure"
echo " push-aws-azure, push-gcp, push-aws-gcp, push-azure-gcp"
echo " push-aws-azure-gcp"
terragrunt:login:
desc: Log into all registries
cmds:
- task: docker:login
dependency:update:
desc: Check TF, OT, TG, cloud CLIs and helper binary versions
cmds:
- |
set -eu
tf_latest=$(curl -LsS https://api.github.com/repos/hashicorp/terraform/releases/latest | jq -r .tag_name | sed 's/^v//')
ot_latest=$(curl -LsS https://api.github.com/repos/opentofu/opentofu/releases/latest | jq -r .tag_name | sed 's/^v//')
tg_latest=$(curl -LsS https://api.github.com/repos/gruntwork-io/terragrunt/releases/latest | jq -r .tag_name | sed 's/^v//')
aws_latest=$(curl -LsS https://api.github.com/repos/aws/aws-cli/tags | jq -r '.[0].name')
gcp_latest=$(curl -LsS https://cloud.google.com/sdk/docs/downloads-versioned-archives \
| grep -Eo 'google-cloud-sdk-[0-9.]+' | head -1 | sed 's/google-cloud-sdk-//')
az_latest=$(curl -LsS https://pypi.org/pypi/azure-cli/json | jq -r '.info.version')
tflint_latest=$(curl -LsS https://api.github.com/repos/terraform-linters/tflint/releases/latest | jq -r .tag_name | sed 's/^v//')
hcledit_latest=$(curl -LsS https://api.github.com/repos/minamijoyo/hcledit/releases/latest | jq -r .tag_name | sed 's/^v//')
sops_latest=$(curl -LsS https://api.github.com/repos/getsops/sops/releases/latest | jq -r .tag_name | sed 's/^v//')
echo "Current Terraform: {{.TF_VERSION}} | Latest: $tf_latest"
echo "Current Terragrunt: {{.TG_VERSION}} | Latest: $tg_latest"
echo "Current OpenTofu: {{.OT_VERSION}} | Latest: $ot_latest"
echo "Current AWS CLI: {{.AWS_VERSION}} | Latest: $aws_latest"
echo "Current GCP CLI: {{.GCP_VERSION}} | Latest: $gcp_latest"
echo "Current Azure CLI: {{.AZ_VERSION}} | Latest: $az_latest"
echo "Current TFLint: {{.TFLINT_VERSION}} | Latest: $tflint_latest"
echo "Current hcledit: {{.HCLEDIT_VERSION}} | Latest: $hcledit_latest"
echo "Current sops: {{.SOPS_VERSION}} | Latest: $sops_latest"
update_file() {
file="$1"
from="$2"
to="$3"
if [ "$from" != "$to" ]; then
from_escaped=$(printf '%s\n' "$from" | sed 's/[][\\.^$*&/]/\\&/g')
to_escaped=$(printf '%s\n' "$to" | sed 's/[&/\\]/\\&/g')
{{.SED}} -i "s/${from_escaped}/${to_escaped}/g" "$file"
fi
}
set_arg() {
file="$1"
key="$2"
value="$3"
{{.SED}} -i "s|^ARG ${key}=.*$|ARG ${key}=${value}|g" "$file"
}
set_arg Dockerfile TF_VERSION "$tf_latest"
set_arg Dockerfile OT_VERSION "$ot_latest"
set_arg Dockerfile TG_VERSION "$tg_latest"
set_arg Dockerfile AWS_VERSION "$aws_latest"
set_arg Dockerfile GCP_VERSION "$gcp_latest"
set_arg Dockerfile AZ_VERSION "$az_latest"
set_arg Dockerfile TFLINT_VERSION "$tflint_latest"
set_arg Dockerfile HCLEDIT_VERSION "$hcledit_latest"
set_arg Dockerfile SOPS_VERSION "$sops_latest"
update_file README.md "{{.TF_VERSION}}" "$tf_latest"
update_file README.md "{{.TG_VERSION}}" "$tg_latest"
update_file README.md "{{.OT_VERSION}}" "$ot_latest"
version_tag=""
[ "{{.TF_VERSION}}" = "$tf_latest" ] || version_tag="$version_tag tf-$tf_latest"
[ "{{.TG_VERSION}}" = "$tg_latest" ] || version_tag="$version_tag tg-$tg_latest"
[ "{{.OT_VERSION}}" = "$ot_latest" ] || version_tag="$version_tag ot-$ot_latest"
[ "{{.AWS_VERSION}}" = "$aws_latest" ] || version_tag="$version_tag aws-$aws_latest"
[ "{{.GCP_VERSION}}" = "$gcp_latest" ] || version_tag="$version_tag gcp-$gcp_latest"
[ "{{.AZ_VERSION}}" = "$az_latest" ] || version_tag="$version_tag az-$az_latest"
version_tag=$(echo "$version_tag" | sed 's/^ *//')
version_branch=$(echo "$version_tag" | sed 's/ /-/g')
if [ -n "${GITHUB_ENV:-}" ]; then
echo "VERSION_TAG=$version_tag" >> "$GITHUB_ENV"
echo "VERSION_BRANCH=$version_branch" >> "$GITHUB_ENV"
fi
terragrunt:build:_variant:
internal: true
requires:
vars: [FLAVOR, TOOL]
cmds:
- |
set -eu
flavor='{{.FLAVOR}}'
tool='{{.TOOL}}'
push='{{default "false" .PUSH}}'
prefix='{{.EFFECTIVE_PREFIX}}'
tf_tg='{{.TF_TG_VERSION}}'
ot_tg='{{.OT_TG_VERSION}}'
full_version='{{.FULL_VERSION}}'
if [ "$tool" = "tf" ]; then
tf_install='yes'
ot_install='no'
combo_version="$tf_tg"
tool_latest='tf-latest'
else
tf_install='no'
ot_install='yes'
combo_version="$ot_tg"
tool_latest='ot-latest'
fi
args=()
case "$flavor" in
slim)
args+=(--build-arg SLIM=yes)
tag_prefix='slim-'
include_global_latest='yes'
;;
plain)
tag_prefix='plain-'
include_global_latest='yes'
;;
aws)
args+=(--build-arg AWS=yes)
tag_prefix='aws-'
include_global_latest='yes'
;;
azure)
args+=(--build-arg AZURE=yes)
tag_prefix='azure-'
include_global_latest='yes'
;;
aws-azure)
args+=(--build-arg AWS=yes)
args+=(--build-arg AZURE=yes)
tag_prefix='aws-azure-'
include_global_latest='yes'
;;
gcp)
args+=(--build-arg GCP=yes)
tag_prefix='gcp-'
include_global_latest='yes'
;;
aws-gcp)
args+=(--build-arg AWS=yes)
args+=(--build-arg GCP=yes)
tag_prefix='aws-gcp-'
include_global_latest='yes'
;;
azure-gcp)
args+=(--build-arg AZURE=yes)
args+=(--build-arg GCP=yes)
tag_prefix='azure-gcp-'
include_global_latest='yes'
;;
aws-azure-gcp)
args+=(--build-arg AWS=yes)
args+=(--build-arg AZURE=yes)
args+=(--build-arg GCP=yes)
tag_prefix='aws-azure-gcp-'
include_global_latest='yes'
;;
*)
echo "Unknown flavor: $flavor"
exit 1
;;
esac
cmd=(docker buildx build --platform linux/amd64,linux/arm64 --file Dockerfile)
cmd+=(--annotation "index:org.label-schema.build-date={{.BUILD_DATE}}")
cmd+=(--annotation "index:org.label-schema.name={{.LABEL_NAME}}")
cmd+=(--annotation "index:org.label-schema.description={{.LABEL_DESCRIPTION}}")
cmd+=(--annotation "index:org.label-schema.usage={{.LABEL_REPO_URL}}/blob/{{.GITHUB_SHA}}/README.md")
cmd+=(--annotation "index:org.label-schema.url={{.LABEL_HOMEPAGE}}")
cmd+=(--annotation "index:org.label-schema.vcs-url={{.LABEL_REPO_URL}}")
cmd+=(--annotation "index:org.label-schema.vcs-ref={{.GITHUB_SHORT_SHA}}")
cmd+=(--annotation "index:org.label-schema.vendor={{.LABEL_VENDOR}}")
cmd+=(--annotation "index:org.label-schema.version=$full_version")
cmd+=(--annotation "index:org.label-schema.schema-version=1.0")
cmd+=(--annotation "index:org.opencontainers.image.created={{.BUILD_DATE}}")
cmd+=(--annotation "index:org.opencontainers.image.authors={{.LABEL_AUTHOR}}")
cmd+=(--annotation "index:org.opencontainers.image.url={{.LABEL_HOMEPAGE}}")
cmd+=(--annotation "index:org.opencontainers.image.documentation={{.LABEL_REPO_URL}}/blob/{{.GITHUB_SHA}}/README.md")
cmd+=(--annotation "index:org.opencontainers.image.source={{.LABEL_REPO_URL}}")
cmd+=(--annotation "index:org.opencontainers.image.version=$full_version")
cmd+=(--annotation "index:org.opencontainers.image.revision={{.GITHUB_SHORT_SHA}}")
cmd+=(--annotation "index:org.opencontainers.image.vendor={{.LABEL_VENDOR}}")
cmd+=(--annotation "index:org.opencontainers.image.licenses=MIT")
cmd+=(--annotation "index:org.opencontainers.image.title={{.LABEL_NAME}}")
cmd+=(--annotation "index:org.opencontainers.image.description={{.LABEL_DESCRIPTION}}")
cmd+=(--label "org.label-schema.build-date={{.BUILD_DATE}}")
cmd+=(--label "org.label-schema.name={{.LABEL_NAME}}")
cmd+=(--label "org.label-schema.description={{.LABEL_DESCRIPTION}}")
cmd+=(--label "org.label-schema.usage={{.LABEL_REPO_URL}}/blob/{{.GITHUB_SHA}}/README.md")
cmd+=(--label "org.label-schema.url={{.LABEL_HOMEPAGE}}")
cmd+=(--label "org.label-schema.vcs-url={{.LABEL_REPO_URL}}")
cmd+=(--label "org.label-schema.vcs-ref={{.GITHUB_SHORT_SHA}}")
cmd+=(--label "org.label-schema.vendor={{.LABEL_VENDOR}}")
cmd+=(--label "org.label-schema.version=$full_version")
cmd+=(--label "org.label-schema.schema-version=1.0")
cmd+=(--label "org.opencontainers.image.created={{.BUILD_DATE}}")
cmd+=(--label "org.opencontainers.image.authors={{.LABEL_AUTHOR}}")
cmd+=(--label "org.opencontainers.image.url={{.LABEL_HOMEPAGE}}")
cmd+=(--label "org.opencontainers.image.documentation={{.LABEL_REPO_URL}}/blob/{{.GITHUB_SHA}}/README.md")
cmd+=(--label "org.opencontainers.image.source={{.LABEL_REPO_URL}}")
cmd+=(--label "org.opencontainers.image.version=$full_version")
cmd+=(--label "org.opencontainers.image.revision={{.GITHUB_SHORT_SHA}}")
cmd+=(--label "org.opencontainers.image.vendor={{.LABEL_VENDOR}}")
cmd+=(--label "org.opencontainers.image.licenses=MIT")
cmd+=(--label "org.opencontainers.image.title={{.LABEL_NAME}}")
cmd+=(--label "org.opencontainers.image.description={{.LABEL_DESCRIPTION}}")
cmd+=(--label "maintainer={{.LABEL_AUTHOR}}")
cmd+=(--label "repository={{.LABEL_REPO_URL}}")
if [ "$push" = "true" ]; then
cmd+=(--push)
fi
cmd+=("${args[@]}")
cmd+=(--build-arg TF="$tf_install" --build-arg OT="$ot_install" --build-arg TG=yes)
docker_username='{{.DOCKER_USERNAME}}'
github_username='{{.GITHUB_USERNAME}}'
has_dockerhub=false
has_ghcr=false
if [ "$push" = "true" ]; then
if [ -n "$docker_username" ] && [ -n "${DOCKER_TOKEN:-}" ]; then
has_dockerhub=true
fi
if [ -n "$github_username" ] && [ -n "${GITHUB_TOKEN:-}" ]; then
has_ghcr=true
fi
if [ "$has_dockerhub" = false ] && [ "$has_ghcr" = false ]; then
echo "❌ No registry credentials provided. Set DOCKER_USERNAME/DOCKER_TOKEN or GITHUB_USERNAME/GITHUB_TOKEN."
exit 1
fi
else
if [ -n "$docker_username" ]; then
has_dockerhub=true
fi
if [ -n "$github_username" ]; then
has_ghcr=true
fi
fi
if [ "$has_dockerhub" = true ]; then
cmd+=(--tag "{{.DOCKER_NAME}}:${prefix}${tag_prefix}${combo_version}")
cmd+=(--tag "{{.DOCKER_NAME}}:${prefix}${tag_prefix}${tool_latest}")
fi
if [ "$has_ghcr" = true ]; then
cmd+=(--tag "{{.GITHUB_NAME}}:${prefix}${tag_prefix}${combo_version}")
cmd+=(--tag "{{.GITHUB_NAME}}:${prefix}${tag_prefix}${tool_latest}")
fi
if [ "$include_global_latest" = "yes" ] && [ "$tool" = "tf" ]; then
if [ "$has_dockerhub" = true ]; then
cmd+=(--tag "{{.DOCKER_NAME}}:${prefix}${tag_prefix}latest")
fi
if [ "$has_ghcr" = true ]; then
cmd+=(--tag "{{.GITHUB_NAME}}:${prefix}${tag_prefix}latest")
fi
fi
if [ "$flavor" = "plain" ]; then
if [ "$has_dockerhub" = true ]; then
cmd+=(--tag "{{.DOCKER_NAME}}:${prefix}${combo_version}")
cmd+=(--tag "{{.DOCKER_NAME}}:${prefix}${tool_latest}")
fi
if [ "$has_ghcr" = true ]; then
cmd+=(--tag "{{.GITHUB_NAME}}:${prefix}${combo_version}")
cmd+=(--tag "{{.GITHUB_NAME}}:${prefix}${tool_latest}")
fi
if [ "$tool" = "tf" ]; then
if [ "$has_dockerhub" = true ]; then
cmd+=(--tag "{{.DOCKER_NAME}}:${prefix}latest")
fi
if [ "$has_ghcr" = true ]; then
cmd+=(--tag "{{.GITHUB_NAME}}:${prefix}latest")
fi
fi
fi
cmd+=(.)
docker buildx create --use || true
docker buildx inspect --bootstrap >/dev/null 2>&1 || true
printf 'Building %s (%s)\n' "$flavor" "$tool"
"${cmd[@]}"
terragrunt:build:_flavor:
internal: true
requires:
vars: [FLAVOR]
cmds:
- task: terragrunt:build:_variant
vars:
FLAVOR: '{{.FLAVOR}}'
TOOL: tf
PUSH: '{{default "false" .PUSH}}'
- task: terragrunt:build:_variant
vars:
FLAVOR: '{{.FLAVOR}}'
TOOL: ot
PUSH: '{{default "false" .PUSH}}'
terragrunt:build:all:
desc: Build all Docker images one by one
cmds:
- task terragrunt:build:slim
- task terragrunt:build:plain
- task terragrunt:build:aws
- task terragrunt:build:azure
- task terragrunt:build:aws-azure
- task terragrunt:build:gcp
- task terragrunt:build:aws-gcp
- task terragrunt:build:azure-gcp
- task terragrunt:build:aws-azure-gcp
terragrunt:build:parallel:
desc: Build all images in parallel
cmds:
- task terragrunt:build:slim
- task terragrunt:build:plain
- |
set -eu
for fl in {{.FLAVORS}}; do
task "terragrunt:build:${fl}" &
done
wait
terragrunt:build:slim:
desc: Build slim image without cloud CLIs
cmds:
- task: terragrunt:build:_flavor
vars:
FLAVOR: slim
terragrunt:build:plain:
desc: Build image without cloud CLIs
cmds:
- task: terragrunt:build:_flavor
vars:
FLAVOR: plain
terragrunt:build:aws:
desc: Build image with AWS CLI
cmds:
- task: terragrunt:build:_flavor
vars:
FLAVOR: aws
terragrunt:build:azure:
desc: Build image with Azure CLI
cmds:
- task: terragrunt:build:_flavor
vars:
FLAVOR: azure
terragrunt:build:aws-azure:
desc: Build image with AWS and Azure CLIs
cmds:
- task: terragrunt:build:_flavor
vars:
FLAVOR: aws-azure
terragrunt:build:gcp:
desc: Build image with GCP CLI
cmds:
- task: terragrunt:build:_flavor
vars:
FLAVOR: gcp
terragrunt:build:aws-gcp:
desc: Build image with AWS and GCP CLIs
cmds:
- task: terragrunt:build:_flavor
vars:
FLAVOR: aws-gcp
terragrunt:build:azure-gcp:
desc: Build image with Azure and GCP CLIs
cmds:
- task: terragrunt:build:_flavor
vars:
FLAVOR: azure-gcp
terragrunt:build:aws-azure-gcp:
desc: Build image with AWS, Azure and GCP CLIs
cmds:
- task: terragrunt:build:_flavor
vars:
FLAVOR: aws-azure-gcp
terragrunt:push:parallel:
desc: Push all images in parallel
deps:
- task: terragrunt:login
cmds:
- task terragrunt:push:slim
- task terragrunt:push:plain
- |
set -eu
for fl in {{.FLAVORS}}; do
task "terragrunt:push:${fl}" &
done
wait
terragrunt:push:_flavor:
internal: true
requires:
vars: [FLAVOR]
deps:
- task: terragrunt:login
cmds:
- task: terragrunt:build:_flavor
vars:
FLAVOR: '{{.FLAVOR}}'
PUSH: true
terragrunt:push:slim:
desc: Push slim image
cmds:
- task: terragrunt:push:_flavor
vars:
FLAVOR: slim
terragrunt:push:plain:
desc: Push plain image
cmds:
- task: terragrunt:push:_flavor
vars:
FLAVOR: plain
terragrunt:push:aws:
desc: Push image with AWS CLI
cmds:
- task: terragrunt:push:_flavor
vars:
FLAVOR: aws
terragrunt:push:azure:
desc: Push image with Azure CLI
cmds:
- task: terragrunt:push:_flavor
vars:
FLAVOR: azure
terragrunt:push:aws-azure:
desc: Push image with AWS and Azure CLIs
cmds:
- task: terragrunt:push:_flavor
vars:
FLAVOR: aws-azure
terragrunt:push:gcp:
desc: Push image with GCP CLI
cmds:
- task: terragrunt:push:_flavor
vars:
FLAVOR: gcp
terragrunt:push:aws-gcp:
desc: Push image with AWS and GCP CLIs
cmds:
- task: terragrunt:push:_flavor
vars:
FLAVOR: aws-gcp
terragrunt:push:azure-gcp:
desc: Push image with Azure and GCP CLIs
cmds:
- task: terragrunt:push:_flavor
vars:
FLAVOR: azure-gcp
terragrunt:push:aws-azure-gcp:
desc: Push image with AWS, Azure and GCP CLIs
cmds:
- task: terragrunt:push:_flavor
vars:
FLAVOR: aws-azure-gcp
help-terragrunt:
desc: Show docker-terragrunt custom task help
cmds:
- task terragrunt:help
login:
desc: Log into Docker Hub and GHCR
cmds:
- task terragrunt:login
build-all:
desc: Build all Docker images one by one
cmds:
- task terragrunt:build:all
build-parallel:
desc: Build all images in parallel
cmds:
- task terragrunt:build:parallel
build-slim:
desc: Build slim image without cloud CLIs
cmds:
- task terragrunt:build:slim
build-plain:
desc: Build image without cloud CLIs
cmds:
- task terragrunt:build:plain
build-aws:
desc: Build image with AWS CLI
cmds:
- task terragrunt:build:aws
build-azure:
desc: Build image with Azure CLI
cmds:
- task terragrunt:build:azure
build-aws-azure:
desc: Build image with AWS and Azure CLIs
cmds:
- task terragrunt:build:aws-azure
build-gcp:
desc: Build image with GCP CLI
cmds:
- task terragrunt:build:gcp
build-aws-gcp:
desc: Build image with AWS and GCP CLIs
cmds:
- task terragrunt:build:aws-gcp
build-azure-gcp:
desc: Build image with Azure and GCP CLIs
cmds:
- task terragrunt:build:azure-gcp
build-aws-azure-gcp:
desc: Build image with AWS, Azure and GCP CLIs
cmds:
- task terragrunt:build:aws-azure-gcp
push-parallel:
desc: Push all images in parallel
cmds:
- task terragrunt:push:parallel
push-slim:
desc: Push slim image
cmds:
- task terragrunt:push:slim
push-plain:
desc: Push plain image
cmds:
- task terragrunt:push:plain
push-aws:
desc: Push image with AWS CLI
cmds:
- task terragrunt:push:aws
push-azure:
desc: Push image with Azure CLI
cmds:
- task terragrunt:push:azure
push-aws-azure:
desc: Push image with AWS and Azure CLIs
cmds:
- task terragrunt:push:aws-azure
push-gcp:
desc: Push image with GCP CLI
cmds:
- task terragrunt:push:gcp
push-aws-gcp:
desc: Push image with AWS and GCP CLIs
cmds:
- task terragrunt:push:aws-gcp
push-azure-gcp:
desc: Push image with Azure and GCP CLIs
cmds:
- task terragrunt:push:azure-gcp
push-aws-azure-gcp:
desc: Push image with AWS, Azure and GCP CLIs
cmds:
- task terragrunt:push:aws-azure-gcp