This commit is contained in:
Chad Moon 2017-04-03 22:46:59 -06:00
Родитель 9abee1b6b4
Коммит 82eacd1e81
2 изменённых файлов: 34 добавлений и 5 удалений

26
Jenkinsfile поставляемый Normal file
Просмотреть файл

@ -0,0 +1,26 @@
node {
checkout scm
env.DOCKER_API_VERSION="1.23"
sh "git rev-parse --short HEAD > commit-id"
tag = readFile('commit-id').replace("\n", "").replace("\r", "")
appName = "hello-kenzan"
registryHost = "127.0.0.1:30400/"
imageName = "${registryHost}${appName}:${tag}"
env.BUILDIMG=imageName
stage "Build"
sh "docker build -t ${imageName} -f applications/hello-kenzan/Dockerfile applications/hello-kenzan/Dockerfile"
stage "Push"
sh "docker push ${imageName}"
stage "Deploy"
sh "sed 's#127.0.0.1:30400/hello-kenzan:latest#'$BUILDIMG'#' applications/hello-kenzan/k8s/deployment.yaml | kubectl apply -f -"
}

Просмотреть файл

@ -52,12 +52,15 @@ parts:
- cap: View the app
com: minikube service hello-kenzan
# - name: Part 2
# intro: In this part we will Setup Jenkins, for the repo and setup an automated Jenkins job build, push and deploy our custom appliction.
# steps:
- name: Part 2
intro: In this part we will Setup Jenkins, and setup an automated jon to build, push and deploy our custom appliction.
steps:
# - cap: Install Jenkins
# com: kubectl apply -f manifests/jenkins.yml; kubectl rollout status deployment/jenkins
- cap: Install Jenkins
com: kubectl apply -f manifests/jenkins.yml; kubectl rollout status deployment/jenkins
- cap: Configure Jenkind
com: minikube service jenkins
# - cap: View Jenkins at http://jenkins.127.0.0.1.xip.io and finish setting it up with the defaults.