Skip to content

Commit

Permalink
Moving build job to kaniko (#687)
Browse files Browse the repository at this point in the history
Co-authored-by: Miguel Arias <[email protected]>
  • Loading branch information
arias-m and Miguel Arias authored Oct 16, 2023
1 parent 7fe2240 commit dc88474
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ pipeline {
agent {
kubernetes {
label 'worker-apibuilder-generator'
inheritFrom 'default'

containerTemplates([
containerTemplate(name: 'helm', image: "flowcommerce/k8s-build-helm2:0.0.50", command: 'cat', ttyEnabled: true),
containerTemplate(name: 'docker', image: 'docker:18', resourceRequestCpu: '1', resourceRequestMemory: '2Gi', command: 'cat', ttyEnabled: true)
])
inheritFrom 'kaniko-slim'
}
}

Expand Down Expand Up @@ -46,14 +41,15 @@ pipeline {
stage('Build and push docker image release') {
when { branch 'main' }
steps {
container('docker') {
container('kaniko') {
script {
semver = VERSION.printable()

docker.withRegistry('https://index.docker.io/v1/', 'jenkins-dockerhub') {
db = docker.build("$ORG/apibuilder-generator:$semver", '--network=host -f Dockerfile .')
db.push()
}
sh """
/kaniko/executor -f `pwd`/api/Dockerfile -c `pwd` \
--snapshot-mode=redo --use-new-run \
--destination ${env.ORG}/apibuilder-generator:$semver
"""

}
}
Expand Down Expand Up @@ -91,8 +87,7 @@ pipeline {
}
}
}
}

}
}
}
}
Expand Down

0 comments on commit dc88474

Please sign in to comment.