forked from mschmidt712/kubernetes-ci-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
part2.yml
38 lines (26 loc) · 2.07 KB
/
part2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
parts:
- name: Part 2
intro: In this part we will Setup Jenkins, and setup an automated pipeline to build, push and deploy our custom appliction.
steps:
- cap: Install Jenkins, which we’ll use to create our automated CI/CD pipeline. It will take the pod a minute or two to roll out.
com: kubectl apply -f manifests/jenkins.yml; kubectl rollout status deployment/jenkins
- cap: Open the Jenkins UI in a web browser.
com: minikube service jenkins
- cap: Display the Jenkins admin password with the following command, and right-click to copy it. IMPORTANT: BE CAREFUL NOT TO PRESS CTRL-C TO COPY THE PASSWORD AS THIS WILL STOP THE SCRIPT.
com: kubectl exec -it `kubectl get pods --selector=app=jenkins --output=jsonpath={.items..metadata.name}` cat /root/.jenkins/secrets/initialAdminPassword
- cap: Switch back to the Jenkins UI. Paste the Jenkins admin password in the box and click Continue. Click Install suggested plugins and wait for the process to complete.
com: echo ''
- cap: Create an admin user and credentials, and click Save and Finish. (Make sure to remember these credentials as you will need them for repeated logins.) Click Start using Jenkins.
com: echo ''
- cap: We now want to create a new pipeline for use with our Hello-Kenzan app. On the left, click New Item. Enter the item name as "Hello-Kenzan Pipeline", select Pipeline, and click OK.
com: echo ''
- cap: Under the Pipeline section at the bottom, change the Definition to be "Pipeline script from SCM".
com: echo ''
- cap: Change the SCM to Git.
com: echo ''
- cap: Change the Repository URL to be the URL of your forked Git repository, such as https://github.com/[GIT USERNAME]/kubernetes-ci-cd. Click Save. On the left, click Build Now to run the new pipeline.
com: echo ''
- cap: Now view the Hello-Kenzan application.
com: minikube service hello-kenzan
- cap: Push a change to your fork. Run job again. View the changes.
com: minikube service hello-kenzan