Skip to content

Instantly share code, notes, and snippets.

@iocanel
Last active September 15, 2016 03:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iocanel/3422fc4546f23256eb49 to your computer and use it in GitHub Desktop.
Save iocanel/3422fc4546f23256eb49 to your computer and use it in GitHub Desktop.
Example of using kubernetes workflow to build, tag, push images to the docker registry.
node {
git 'https://github.com/rawlingsj/node-example.git'
if (!fileExists ('Dockerfile')) {
writeFile file: 'Dockerfile', text: 'FROM node:5.3-onbuild'
}
kubernetes.image().withName("example").build().fromPath(".")
kubernetes.image().withName("example").tag().inRepository("172.30.101.121:5000/default/example").withTag("1.0")
kubernetes.image().withName("172.30.101.121:5000/default/example").push().withTag("1.0").toRegistry()
}
@kaoruu
Copy link

kaoruu commented Sep 15, 2016

how to set credentials when pushing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment