Skip to content

Commit

Permalink
Jenkisnfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lianghuang committed Oct 28, 2019
1 parent 6f0e32c commit d391bae
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Jenkinsfile
@@ -0,0 +1,18 @@
podTemplate(yaml: './podTemplate.yaml') {
node(POD_LABEL) {
//pull down the source code
git url: 'https://github.com/sameyes911/azure-vote-sam', branch: 'master', credentialsId: "cf748a1ea72c51e5f98f8324059dae4ee355a403"

container('docker') {
//build image
sh 'docker build -t rancherlbacr.azurecr.io/azure-vote-front:latest ./azure-vote'
// docker login
sh 'docker login rancherlbacr.azurecr.io -u rancherlbacr -p c=b5Vc7lhdqkKR7xME0Rqq9pggSrW6KZ'
// docker image push
sh 'docker push rancherlbacr.azurecr.io/azure-vote-front:latest'
}
// trigger deployment
build 'bookinfo-productpage-deployment'
}

}
20 changes: 20 additions & 0 deletions podTemplate.yaml
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Pod
spec:
containers:
- name: docker
image: docker:19.03.1
command:
- sleep
args:
- 99d
env:
- name: DOCKER_HOST
value: tcp://localhost:2375
- name: docker-daemon
image: docker:19.03.1-dind
securityContext:
privileged: true
env:
- name: DOCKER_TLS_CERTDIR
value: ""

0 comments on commit d391bae

Please sign in to comment.