Skip to content

Instantly share code, notes, and snippets.

@anarquias
Forked from vamsijakkula/Jenkins
Created January 4, 2021 09:12
Show Gist options
  • Save anarquias/59f645e746bcb0fc564c7b4b29b111f2 to your computer and use it in GitHub Desktop.
Save anarquias/59f645e746bcb0fc564c7b4b29b111f2 to your computer and use it in GitHub Desktop.
Jenkins
pipeline {
agent any
stages {
stage('Checkout Source') {
steps {
git url:'https://github.com/vamsijakkula/hellowhale.git', branch:'master'
}
}
stage("Build image") {
steps {
script {
myapp = docker.build("vamsijakkula/hellowhale:${env.BUILD_ID}")
}
}
}
stage("Push image") {
steps {
script {
docker.withRegistry('https://registry.hub.docker.com', 'dockerhub') {
myapp.push("latest")
myapp.push("${env.BUILD_ID}")
}
}
}
}
stage('Deploy App') {
steps {
script {
kubernetesDeploy(configs: "hellowhale.yml", kubeconfigId: "mykubeconfig")
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment