diff --git a/TODO.md b/TODO.md index 0a228490..af42a1a5 100644 --- a/TODO.md +++ b/TODO.md @@ -2,5 +2,5 @@ - [ ] Test with helm chart - [x] Play With Docker generation - [x] Custom app compose and dockerfile examples -- [ ] Add v13 v12 tags -- [ ] Use &\* feature of yaml to describe backends +- [x] Add v13 v12 tags +- [x] Use &\* feature of yaml to describe backends diff --git a/docker-bake.hcl b/docker-bake.hcl index 64744ed4..687d8503 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -43,8 +43,12 @@ group "default" { function "tag" { params = [repo, version] - # If `version` parameter is develop (development build) then use tag `latest` - result = ["${version}" == "develop" ? "${USERNAME}/${repo}:latest" : "${USERNAME}/${repo}:${version}"] + result = [ + # If `version` param is develop (development build) then use tag `latest` + "${version}" == "develop" ? "${USERNAME}/${repo}:latest" : "${USERNAME}/${repo}:${version}", + # Make short tag for major version if possible. For example, from v13.16.0 make v13. + can(regex("(v[0-9]+)[.]", "${version}")) ? "${USERNAME}/${repo}:${regex("(v[0-9]+)[.]", "${version}")[0]}" : "", + ] } target "default-args" {