BuildahManifest.groovy (828B)
1 // A class to describe the buildah manifest stage 2 class BuildahManifest implements Serializable { 3 private final Script script 4 5 BuildahManifest(Script script) { 6 this.script = script 7 } 8 9 void create(Map imgList = [], 10 String manifestName, 11 String stageName = 'build') { 12 13 def list = imgList.join(' ') 14 def shCmd = sprintf( 15 'buildah manifest create --amend %s %s', 16 manifestName, list) 17 18 script.stage(stageName) { 19 script.echo "Building manifest ${manifestName}..." 20 script.sh shCmd 21 } 22 } 23 24 void push(String manifestName, 25 String stageName = 'build') { 26 27 def shCmd = sprintf('buildah manifest push %s', manifestName) 28 29 script.stage(stageName) { 30 script.echo "Pushing manifest ${manifestName}..." 31 script.sh shCmd 32 } 33 } 34 }