jenkins-lib

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

buildah.groovy (782B)


      1 def call(String imgContext,
      2          String imgName,
      3          String imgArch = 'arm64/v8',
      4          String imgTag = 'latest',
      5          String imgRegistry = 'host.docker.internal:5000') {
      6 
      7     def shCmd = sprintf(
      8         'buildah bud --no-cache --arch=%s -t %s/%s:%s %s',
      9         imgArch, imgRegistry, imgName, imgTag, imgContext)
     10 
     11     pipeline {
     12         agent {
     13             label 'nomad'
     14         }
     15 
     16         stages {
     17             stage('build') {
     18                 steps {
     19                     sh shCmd
     20                 }
     21             }
     22             //stage('publish') {
     23             //    steps {
     24             //        script {
     25             //            sh 'buildah push -t ${imgRegistry}/${imgName}:${imgTag}'
     26             //        }
     27             //    }
     28             //}
     29         }
     30     }
     31 }