jenkins-lib

Jenkins shared library
git clone https://git.in0rdr.ch/jenkins-lib.git
Log | Files | Refs | Pull requests |Archive | README

BuildahPush.groovy (569B)


      1 // A class to describe the buildah push stage
      2 class BuildahPush implements Serializable {
      3 	private final Script script
      4 
      5 	BuildahPush(Script script) {
      6 		this.script = script
      7   }
      8 
      9   void execute(String imgName,
     10                String imgTag = 'latest',
     11                String imgRegistry = 'haproxy.lan:5000',
     12                String stageName = 'push') {
     13 
     14       def shCmd = sprintf('buildah push %s/%s:%s', imgRegistry, imgName, imgTag)
     15 
     16 		script.stage(stageName) {
     17       script.echo "Building image ${imgRegistry}/${imgName}:${imgTag}..."
     18       script.sh shCmd
     19     }
     20   }
     21 }