From 829caa6b84114238cb2928069e439c266b18d32a Mon Sep 17 00:00:00 2001 From: Micah Abbott Date: Thu, 20 Sep 2018 16:11:55 -0400 Subject: [PATCH] pipeline-utils: add prep_container_storage() This re-implements some of what is contained in `scripts/pull-mount-oscontainer` to allow parts of the pipeline to pull container images from inside another container. --- pipeline-utils.groovy | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pipeline-utils.groovy b/pipeline-utils.groovy index d3d33464e..03ac6fc0f 100644 --- a/pipeline-utils.groovy +++ b/pipeline-utils.groovy @@ -143,6 +143,17 @@ def registry_login(username, password, registry) { sh "podman login -u '${username}' -p '${password}' ${registry}" } +// re-implementation of some functionality from scripts/pull-mount-oscontainer +// sets up local container storage so the pipeline can pull container images +// from inside another container +def prep_container_storage(hostStorage, localStorage) { + sh """ + rm -rf ${localStorage} + mkdir -p ${localStorage} + rm -rf ${hostStorage} && mkdir -p ${hostStorage} + mount --bind ${localStorage} ${hostStorage} + """ +} // Substitute secrets from credentials into files in the git repo def prepare_configuration() { withCredentials([