blob: 7237361c9ae2e16f4a91ff3fab38dbffcba45a6c [file] [log] [blame]
Mohammed Naser37694382024-04-02 21:11:31 -04001variable "REGISTRY" {
2 default = "registry.atmosphere.dev/library"
3}
4
5variable "CACHE_REGISTRY" {
6 default = "registry.atmosphere.dev/cache"
7}
8
9variable "PUSH_TO_CACHE" {
10 default = false
11}
12
13function "cache_from" {
14 params = [image]
15 result = ["type=registry,ref=${CACHE_REGISTRY}/${image}"]
16}
17
18function "cache_to" {
19 params = [image]
20 result = PUSH_TO_CACHE ? [format("%s,%s", cache_from(image)[0], "mode=max,image-manifest=true,oci-mediatypes=true,compression=zstd")] : []
21}
22
Mohammed Naser37694382024-04-02 21:11:31 -040023target "barbican" {
24 name = "barbican-${release.tgt}"
Mohammed Naser682ba512024-04-03 13:56:18 -040025
26 context = "."
27 target = "barbican"
Mohammed Naser37694382024-04-02 21:11:31 -040028
29 cache-from = cache_from("barbican:${release.name}")
30 cache-to = cache_to("barbican:${release.name}")
31
32 tags = [
33 "${REGISTRY}/barbican:${release.name}",
34 "${REGISTRY}/barbican:${release.ref}"
35 ]
36
37 matrix = {
38 release = [
39 {
40 tgt = "bobcat",
41 name = "2023.2",
42 ref = "a00fcade4138ffc52cd9c84b5999297966f019b5"
43 }
44 ]
45 }
46
Mohammed Naser37694382024-04-02 21:11:31 -040047 args = {
48 RELEASE = release.name
Mohammed Naser682ba512024-04-03 13:56:18 -040049 BRANCH = format("stable/%s", release.name)
Mohammed Naser37694382024-04-02 21:11:31 -040050 PROJECT = "barbican"
51 BARBICAN_GIT_REF = release.ref
52 }
53}
54
Mohammed Naseree1ff232024-04-05 13:52:18 -040055target "magnum" {
56 name = "magnum-${release.tgt}"
57
58 context = "."
59 target = "magnum"
60
61 cache-from = cache_from("magnum:${release.name}")
62 cache-to = cache_to("magnum:${release.name}")
63
64 tags = [
65 "${REGISTRY}/magnum:${release.name}",
66 "${REGISTRY}/magnum:${release.ref}"
67 ]
68
69 matrix = {
70 release = [
71 {
72 tgt = "zed",
73 name = "zed",
74 ref = "0ee979099a01ae2c8b1b5d6757897a8993e4e34c"
75 },
76 {
77 tgt = "bobcat",
78 name = "2023.2",
79 ref = "5f921a72d22d7e96fb3584c4906a39de9a085a41"
80 }
81 ]
82 }
83
84 args = {
85 RELEASE = release.name
86 BRANCH = format("stable/%s", release.name)
87 PROJECT = "magnum"
88 MAGNUM_GIT_REF = release.ref
89 }
90}
91
92
Mohammed Naser37694382024-04-02 21:11:31 -040093group "default" {
94 targets = [
Mohammed Naseree1ff232024-04-05 13:52:18 -040095 "barbican",
96 "magnum"
Mohammed Naser37694382024-04-02 21:11:31 -040097 ]
98}