Created
June 11, 2020 08:14
-
-
Save vamsijakkula/9da21b1dd27c698af0cabe08afa33a4b to your computer and use it in GitHub Desktop.
Jenkins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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