@@ -4,12 +4,6 @@ let Extensions = ../../Lib/Extensions.dhall
44
55let join = Extensions. join
66
7- let Optional / map = Prelude.Optional. map
8-
9- let Optional / default = Prelude.Optional. default
10-
11- let List / map = Prelude.List. map
12-
137let Artifacts = ../../ Constants / Artifacts. dhall
148
159let Size = ../../ Command / Size. dhall
@@ -28,13 +22,11 @@ let DebianRepo = ../../Constants/DebianRepo.dhall
2822
2923let DockerRepo = ../../ Constants / DockerRepo. dhall
3024
31- let ContainerImages = ../../ Constants / ContainerImages. dhall
32-
3325let Command = ../ Base. dhall
3426
3527let Cmd = ../../ Lib / Cmds. dhall
3628
37- let Mina = ../ Mina . dhall
29+ let WithPermissions = ../ WithPermissions . dhall
3830
3931let Artifact = ../../ Constants / Artifacts. dhall
4032
@@ -108,16 +100,6 @@ let publish
108100 " \\ \${GITTAG}"
109101 " \\ \$(date \" +%Y%m%d\" )"
110102
111- let target_version =
112- spec. target_version
113- DebianVersions.DebVersion. Bullseye
114- spec. channel
115- spec. branch
116- spec. profile
117- " \\ \${GIT_COMMIT}"
118- " \\ \${GITTAG}"
119- " \\ \$(date \" +%Y%m%d\" )"
120-
121103 let artifacts = join " ," (Artifacts. dockerNames spec. artifacts)
122104
123105 let networks =
@@ -142,139 +124,49 @@ let publish
142124 spec. codenames
143125 )
144126
145- let maybeKey =
146- Optional / map
147- Text
148- Text
149- (\ (repo : Text ) -> " --debian-sign-key " ++ repo)
150- (DebianRepo. keyId spec. debian_repo)
151-
152- let keyArg = Optional / default Text " " maybeKey
153-
154127 let indexedAdditionalTags = Prelude.List. indexed Text additional_tags
155128
156- let architectures =
157- join
158- " ,"
159- ( List / map
160- Architecture. Type
161- Text
162- ( \ (architecture : Architecture. Type )
163- -> Architecture. lowerName architecture
164- )
165- spec. architectures
166- )
167-
168- let signedArg =
169- if DebianRepo. isSigned spec. debian_repo
170-
171- then " --signed-debian-repo "
172-
173- else " "
174-
175- let commands =
176- [ Cmd. runInDocker
177- Cmd. Docker:: {
178- , image = ContainerImages. minaToolchain
179- , extraEnv =
180- [ " AWS_ACCESS_KEY_ID" , " AWS_SECRET_ACCESS_KEY" ]
181- , privileged = True
182- , useRoot = True
183- }
184- ( " git config --global --add safe.directory /workdir && "
185- ++ " . ./buildkite/scripts/export-git-env-vars.sh && "
186- ++ " gpg --import /var/secrets/debian/key.gpg && "
187- ++ " mkdir -p ./cache && "
188- ++ " DEBIAN_CACHE_FOLDER=/workdir/cache ./buildkite/scripts/release/manager.sh publish "
189- ++ " --artifacts ${artifacts} "
190- ++ " --networks ${networks} "
191- ++ " --buildkite-build-id ${spec.build_id} "
192- ++ " --backend ${spec.backend} "
193- ++ " --channel ${DebianChannel.lowerName spec.channel} "
194- ++ " --source-version ${spec.source_version} "
195- ++ " --target-version ${target_version} "
196- ++ " --codenames ${codenames} "
197- ++ " --debian-repo ${DebianRepo.bucket_or_default
198- spec.debian_repo} "
199- ++ " --only-debians "
200- ++ " --archs ${architectures} "
201- ++ " --profile ${Profiles.lowerName spec.profile} "
202- ++ " ${keyArg}"
203- )
204- ]
205- # [ Cmd. run
206- ( " . ./buildkite/scripts/export-git-env-vars.sh && "
207- ++ " ./buildkite/scripts/release/manager.sh verify "
208- ++ " --artifacts ${artifacts} "
209- ++ " --networks ${networks} "
210- ++ " --channel ${DebianChannel.lowerName spec.channel} "
211- ++ " --version ${target_version} "
212- ++ " --codenames ${codenames} "
213- ++ " --debian-repo ${DebianRepo.bucket_or_default
214- spec.debian_repo} "
215- ++ " --profile ${Profiles.lowerName spec.profile} "
216- ++ " --only-debians "
217- ++ " --archs ${architectures} "
218- ++ " ${signedArg}"
219- )
220- ]
221-
222- in [ Command. build
223- Command. Config:: {
224- , commands =
225- [ Mina. fixPermissionsCommand
226- ContainerImages. minaToolchain
129+ in Prelude.List. map
130+ { index : Natural , value : Text }
131+ Command. Type
132+ ( \ (r : { index : Natural , value : Text })
133+ -> Command. build
134+ Command. Config:: {
135+ , commands =
136+ [ Cmd. run
137+ ( WithPermissions. withPermissions
138+ ( " ./buildkite/scripts/export-git-env-vars.sh && "
139+ ++ " ./buildkite/scripts/release/manager.sh publish "
140+ ++ " --artifacts ${artifacts} "
141+ ++ " --networks ${networks} "
142+ ++ " --buildkite-build-id ${spec.build_id} "
143+ ++ " --backend ${spec.backend} "
144+ ++ " --channel ${DebianChannel.lowerName
145+ spec.channel} "
146+ ++ " --verify "
147+ ++ " --source-version ${spec.source_version} "
148+ ++ " --target-version ${r.value} "
149+ ++ " --codenames ${codenames} "
150+ ++ " --only-dockers "
151+ ++ " --source-docker-repo ${DockerRepo.show
152+ spec.docker_repo} "
153+ ++ " --target-docker-repo ${DockerRepo.show
154+ spec.docker_repo} "
155+ ++ " --force-upload-debians "
156+ )
157+ )
227158 ]
228- # commands
229- , label = " Debian Packages Publishing"
230- , key =
231- " publish-debians-${DebianChannel.lowerName
232- spec.channel}-${Profiles.lowerName
233- spec.profile}"
234- , target = Size. Small
235- , depends_on = spec. depends_on
236- , if_ = spec. if_
237- }
238- ]
239- # Prelude.List. map
240- { index : Natural , value : Text }
241- Command. Type
242- ( \ (r : { index : Natural , value : Text })
243- -> Command. build
244- Command. Config:: {
245- , commands =
246- [ Cmd. run
247- ( " . ./buildkite/scripts/export-git-env-vars.sh && "
248- ++ " ./buildkite/scripts/release/manager.sh publish "
249- ++ " --artifacts ${artifacts} "
250- ++ " --networks ${networks} "
251- ++ " --buildkite-build-id ${spec.build_id} "
252- ++ " --backend ${spec.backend} "
253- ++ " --channel ${DebianChannel.lowerName
254- spec.channel} "
255- ++ " --verify "
256- ++ " --source-version ${spec.source_version} "
257- ++ " --target-version ${r.value} "
258- ++ " --codenames ${codenames} "
259- ++ " --only-dockers "
260- ++ " --source-docker-repo ${DockerRepo.show
261- spec.docker_repo} "
262- ++ " --target-docker-repo ${DockerRepo.show
263- spec.docker_repo} "
264- ++ " --force-upload-debians "
265- )
266- ]
267- , label = " Docker Packages Publishing"
268- , key =
269- " publish-dockers-${DebianChannel.lowerName
270- spec.channel}-${Profiles.lowerName
271- spec.profile}-${Natural/show
272- r.index}"
273- , target = Size. Small
274- , depends_on = spec. depends_on
275- , if_ = spec. if_
276- }
277- )
278- indexedAdditionalTags
159+ , label = " Docker Packages Publishing"
160+ , key =
161+ " publish-dockers-${DebianChannel.lowerName
162+ spec.channel}-${Profiles.lowerName
163+ spec.profile}-${Natural/show
164+ r.index}"
165+ , target = Size. Small
166+ , depends_on = spec. depends_on
167+ , if_ = spec. if_
168+ }
169+ )
170+ indexedAdditionalTags
279171
280172in { publish = publish, Spec = Spec }
0 commit comments