Last active
July 17, 2018 21:33
-
-
Save pandeybk/eb226a2e636a6b138dfc636579d57419 to your computer and use it in GitHub Desktop.
Container-template-Jenkinsfile
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
podTemplate(label: 'kube-node', yaml: """ | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: docker | |
labels: | |
role: kube-node | |
spec: | |
hostNetwork: true | |
containers: | |
- name: docker | |
image: docker | |
command: | |
- cat | |
tty: true | |
volumeMounts: | |
- mountPath: /var/run/docker.sock | |
name: docker-volume | |
volumes: | |
- name: docker-volume | |
hostPath: | |
path: /var/run/docker.sock | |
""") { | |
node('kube-node') { | |
checkout scm | |
stage ('Create Bootkube Image') { | |
container ('docker') { | |
sh "apk add --no-cache make git" | |
sh "cd bootkube && make" | |
withDockerRegistry([credentialsId: 'quay-jenkins-ci', url: 'https://quay.io/goglides/demo']) { | |
sh "docker push quay.io/goglides/demo" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment