Skip to content

Commit ee26f17

Browse files
committed
fix(manifest): respect registry name option
1 parent d248654 commit ee26f17

File tree

1 file changed

+32
-34
lines changed

1 file changed

+32
-34
lines changed

src/docker-manifest/default.nix

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ writeShellApplication {
4444
rm -rf "$TMPDIR"
4545
${podmanExe} manifest rm "${cfg.manifestName}" || true
4646
47-
${lib.concatMapStringsSep "\n" (registryName: ''
48-
${podmanExe} logout "${registryName}" || true
49-
${craneExe} auth logout "${registryName}" || true
50-
'') (lib.attrNames cfg.registries)}
47+
${lib.concatMapStringsSep "\n" (registry: ''
48+
${podmanExe} logout "${registry.name}" || true
49+
${craneExe} auth logout "${registry.name}" || true
50+
'') (lib.attrValues cfg.registries)}
5151
}
5252
trap cleanup EXIT
5353
@@ -85,35 +85,33 @@ writeShellApplication {
8585
8686
set -x # echo on
8787
88-
${lib.concatLines (
89-
lib.mapAttrsToList (registryName: registryParams: ''
90-
set +x # echo off
91-
92-
echo "podman login ${registryName}"
93-
${podmanExe} login \
94-
--username "${registryParams.username}" \
95-
--password "${registryParams.password}" \
96-
"${registryName}"
97-
98-
echo "crane login ${registryName}"
99-
${craneExe} auth login "${registryName}" \
100-
--username "${registryParams.username}" \
101-
--password "${registryParams.password}"
102-
103-
set -x # echo on
104-
105-
${podmanExe} manifest push \
106-
--all \
107-
--format ${cfg.format} \
108-
"${cfg.manifestName}" \
109-
"docker://${registryName}/${registryParams.repo}:${lib.head cfg.parsedTags}"
110-
111-
${lib.concatMapStringsSep "\n" (tag: ''
112-
${craneExe} tag \
113-
"${registryName}/${registryParams.repo}:${lib.head cfg.parsedTags}" \
114-
"${tag}"
115-
'') (lib.tail cfg.parsedTags)}
116-
'') cfg.registries
117-
)}
88+
${lib.concatMapStringsSep "\n" (registry: ''
89+
set +x # echo off
90+
91+
echo "podman login ${registry.name}"
92+
${podmanExe} login \
93+
--username "${registry.username}" \
94+
--password "${registry.password}" \
95+
"${registry.name}"
96+
97+
echo "crane login ${registry.name}"
98+
${craneExe} auth login "${registry.name}" \
99+
--username "${registry.username}" \
100+
--password "${registry.password}"
101+
102+
set -x # echo on
103+
104+
${podmanExe} manifest push \
105+
--all \
106+
--format ${cfg.format} \
107+
"${cfg.manifestName}" \
108+
"docker://${registry.name}/${registry.repo}:${lib.head cfg.parsedTags}"
109+
110+
${lib.concatMapStringsSep "\n" (tag: ''
111+
${craneExe} tag \
112+
"${registry.name}/${registry.repo}:${lib.head cfg.parsedTags}" \
113+
"${tag}"
114+
'') (lib.tail cfg.parsedTags)}
115+
'') (lib.attrValues cfg.registries)}
118116
'';
119117
}

0 commit comments

Comments
 (0)