From 2342b9a6fc1f7927ba93938b0233092c1fe1f844 Mon Sep 17 00:00:00 2001 From: Giles Bradshaw Date: Sat, 24 Oct 2020 12:13:30 +0100 Subject: [PATCH] feat: destination_registry parameter for save --- save.libsonnet | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/save.libsonnet b/save.libsonnet index 05e5689..c6f157a 100644 --- a/save.libsonnet +++ b/save.libsonnet @@ -40,6 +40,7 @@ function(config) 'registry_domain', 'registry_port', 'registry_password', + 'destination_registry' ], script +: [ login, @@ -50,12 +51,12 @@ function(config) out: std.strReplace(def.save, '/', '_'), } ), - 'echo "docker load %(out)s.tar" >> /%(root)s/.images/%(name)s/load.sh' % ( + 'echo "docker load < %(out)s.tar" >> /%(root)s/.images/%(name)s/load.sh' % ( config + { out: std.strReplace(def.save, '/', '_'), } ), - 'echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/%(root)s/%(name)s/%(pull)s /%(root)s/DOLLAR1/%(pull)s" >> /%(root)s/.images/%(name)s/load.sh' % ( + 'echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/%(root)s/%(name)s/%(pull)s $${DESTINATION_REGISTRY}/%(root)s/%(name)s/%(pull)s" >> /%(root)s/.images/%(name)s/load.sh' % ( config + { pull: def.save, @@ -77,6 +78,7 @@ function(config) 'registry_domain', 'registry_port', 'registry_password', + 'destination_registry', ], script +: [ login, @@ -93,7 +95,7 @@ function(config) out: std.strReplace(def, '/', '_'), } ), - 'echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/%(root)s/%(name)s/%(pull)s /%(root)s/DOLLAR1/%(pull)s" >> /%(root)s/.images/%(name)s/built/load.sh' % ( + 'echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/%(root)s/%(name)s/%(pull)s ${DESINATION_REGISTRY}/%(root)s/%(name)s/%(pull)s" >> /%(root)s/.images/%(name)s/built/load.sh' % ( config + { pull: def,