Skip to content

Instantly share code, notes, and snippets.

@rkamradt
Last active July 23, 2020 20:01
Show Gist options
  • Save rkamradt/3eed20ba7e3a7c6995bdd7fbf16f10f9 to your computer and use it in GitHub Desktop.
Save rkamradt/3eed20ba7e3a7c6995bdd7fbf16f10f9 to your computer and use it in GitHub Desktop.
Build Step with Kaniko
pipeline {
agent any
stages {
stage('Build') {
agent {
kubernetes {
label 'kaniko'
idleMinutes 5
yamlFile 'kaniko-pod.yaml'
defaultContainer 'kaniko'
}
}
steps {
git 'https://github.com/rkamradt/myfirstrepository'
container(name: 'kaniko') {
sh "/kaniko/executor \
--dockerfile `pwd`/Dockerfile \
--context `pwd` \
--destination=docker.io/rlkamradt/myfirstrepository:latest"
}
}
}
stage('Test') {
steps {
echo 'Testing'
}
}
stage('Deploy') {
steps {
echo 'Deploying'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment