-
Notifications
You must be signed in to change notification settings - Fork 11
/
cicd.sh
97 lines (73 loc) · 2.27 KB
/
cicd.sh
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
vim Dockerfile
from jenkins/jenkins:2.60.3
# Distributed Builds plugins
RUN /usr/local/bin/install-plugins.sh ssh-slaves
# install Notifications and Publishing plugins
RUN /usr/local/bin/install-plugins.sh email-ext
RUN /usr/local/bin/install-plugins.sh mailer
RUN /usr/local/bin/install-plugins.sh slack
# Artifacts
RUN /usr/local/bin/install-plugins.sh htmlpublisher
# UI
RUN /usr/local/bin/install-plugins.sh greenballs
RUN /usr/local/bin/install-plugins.sh simple-theme-plugin
# Scaling
RUN /usr/local/bin/install-plugins.sh kubernetes
# install Maven
USER root
RUN apt-get update && apt-get install -y maven
USER jenkins
docker build -t isnuryusuf/jenkins-imange:2.60.3 .
docker login
docker push isnuryusuf/jenkins-imange:2.60.3
jenkins-deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jenkins
spec:
replicas: 1
template:
metadata:
labels:
app: jenkins
spec:
containers:
- name: jenkins
image: isnuryusuf/jenkins-image:2.121.2
env:
- name: JAVA_OPTS
value: -Djenkins.install.runSetupWizard=false
ports:
- name: http-port
containerPort: 8080
- name: jnlp-port
containerPort: 50000
volumeMounts:
- name: jenkins-home
mountPath: /var/jenkins_home
volumes:
- name: jenkins-home
emptyDir: {}
kubectl apply -f jenkins-deployment.yaml
jenkins-service.yaml
apiVersion: v1
kind: Service
metadata:
name: jenkins
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
selector:
app: jenkins
kubectl create -f jenkins-service.yaml
kubectl get pod ; kubectl get svc
#######################################################
wget https://raw.githubusercontent.com/isnuryusuf/kubernetes-istio-cicd/master/cicd-jenkins.yml
wget https://raw.githubusercontent.com/isnuryusuf/kubernetes-istio-cicd/master/cicd-service-account.yml
kubectl apply -f https://raw.githubusercontent.com/isnuryusuf/kubernetes-istio-cicd/master/cicd-jenkins.yml
kubectl create -f https://raw.githubusercontent.com/isnuryusuf/kubernetes-istio-cicd/master/cicd-service-account.yml
kubectl cluster-info | grep master
cat /root/.kube/config | grep certificate-authority-data