Skip to content

Instantly share code, notes, and snippets.

@vamsijakkula
Created June 11, 2020 08:14
Show Gist options
  • Save vamsijakkula/9da21b1dd27c698af0cabe08afa33a4b to your computer and use it in GitHub Desktop.
Save vamsijakkula/9da21b1dd27c698af0cabe08afa33a4b 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