-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
166 lines (141 loc) · 3.33 KB
/
Jenkinsfile
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
node {
stage('Stage0') {
echo "Git Fetch"
git url: 'https://github.com/kunaljha5/script_html.git'
}
}
parallel Dev_Deploy: {
node {
stage('Deploy_env') {
echo 'Transfering dependent scripts to remote node1'
sh './script5.sh'
}
}
},
Python: {
node {
stage ('py_Node1') {
echo 'Checking Python avaibility on remote node1 and installing'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script1.sh"'
}
}
},
Http: {
node {
stage ('http_Node1') {
echo 'Checking apache2 and installing on remote node1'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script2.sh"'
}
}
},
Html: {
node {
stage ('html_Node1') {
echo 'Deploying remote node1 html page'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script3.sh"'
}
}
},
Testing: {
node {
stage ('test_Node1') {
echo 'Testing the remote node1 content as per thier node type'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script4.sh"'
}
}
}
node {
stage('dev_result') {
echo 'Development Node1 Build, Deployment, Test Completed'
}
}
parallel Test_Deploy: {
node {
stage('Deploy_env') {
echo 'Transfering dependent scripts to remote node2'
sh './script5.sh'
}
}
},
Python: {
node {
stage ('py_Node2') {
echo 'Checking Python avaibility on remote node2 and installing'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script1.sh"'
}
}
},
Http: {
node {
stage ('http_Node2') {
echo 'Checking apache2 and installing on remote node2'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script2.sh"'
}
}
},
Html: {
node {
stage ('html_Node2') {
echo 'Deploying remote node2 html page'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script3.sh"'
}
}
},
Tesing: {
node {
stage ('test_Node2') {
echo 'Testing the remote node2 content as per thier node type'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script4.sh"'
}
}
}
node {
stage('test_result') {
echo 'Development Node2 Build, Deployment, Test Completed'
}
}
parallel Prod_Deploy: {
node {
stage('Deploy_env') {
echo 'Transfering dependent scripts to remote node3'
sh './script5.sh'
}
}
},
Python: {
node {
stage ('py_Node3') {
echo 'Checking Python avaibility on remote node3 and installing'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script1.sh"'
}
}
},
Http: {
node {
stage ('http_Node3') {
echo 'Checking apache2 and installing on remote node1'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script2.sh"'
}
}
},
Html: {
node {
stage ('html_Node3') {
echo 'Deploying remote node3 html page'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script3.sh"'
}
}
},
Tesing: {
node {
stage ('test_Node3') {
echo 'Testing the remote node3 content as per thier node type'
sh 'ssh -i /var/lib/jenkins/secrets/learning1.pem ubuntu@172.31.76.181 "./script4.sh"'
}
}
}
node {
stage('prod_result') {
echo 'Development Node3 Build, Deployment, Test Completed'
}
}