-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
executable file
·349 lines (277 loc) · 12.2 KB
/
index.php
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>DevOps Assessment Tool</title>
<!-- Bootstrap stuff -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://raw.githubusercontent.com/daneden/animate.css/master/animate.css">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">DevOps Assessment Tools</a>
</div>
</nav>
</div>
<div class="container">
<!--<div class="table-responsive">-->
<table cellpadding="0" cellspacing="0" border="0">
<thead class="tbl-header">
<tr>
<th><span>Levels</span></th>
<td></td>
<th>Continuous Integration</th>
<td></td>
<th>Automation</th>
<td></td>
<th>Continuous Deployment</th>
<td></td>
<th>Monitoring</th>
</tr>
</thead>
<tbody id="myTable">
<tr>
<th scope="row">4</th>
<td><input id="c1" type="checkbox" name="ci_check[]" value="07" /></td>
<td>Piplelined enabled for Build Platform </td>
<td><input id="c1" type="checkbox" name="au_check[]" value="07" /></td>
<td>Code Coverage Meets build promotion Criteteria (Eg.85%) </td>
<td><input id="c1" type="checkbox" name="cd_check[]" value="07" /></td>
<td>One Click Roll back to the previous stable release version</td>
<td><input id="c1" type="checkbox" name="mo_check[]" value="07" /></td>
<td>Has "Self-Healing" Capability in Pre-prod</td>
</tr>
<tr>
<th scope="row">3</th>
<td><input id="c1" type="checkbox" name="ci_check[]" value="06"/></td>
<td>Completely adheres to the "Continuous Delivery Principles" </td>
<td><input id="c1" type="checkbox" name="au_check[]" value="06"/></td>
<td>90% of the existing functional test cases are integrated with automated deployments </td>
<td><input id="c1" type="checkbox" name="cd_check[]" value="06"/></td>
<td>Automated Dpeloyment for Configs ,Properities and DB scripts in All Environment</td>
<td><input id="c1" type="checkbox" name="mo_check[]" value="06"/></td>
<td>Log Moniroting available for both Pre-Prod & Prod Apps</td>
</tr>
<tr>
<th scope="row">2</th>
<td><input id="c1" type="checkbox" name="ci_check[]" value="05"/></td>
<td>Each Commit/Merge to Git triggers a Build and creates Deployable artifacts in Nexus </td>
<td><input id="c1" type="checkbox" name="au_check[]" value="05"/></td>
<td>Automated regression test suites and are run during E2E testing phase</td>
<td><input id="c1" type="checkbox" name="cd_check[]" value="05"/></td>
<td>Automated Dpeloyment for Code in All Enviroment</td>
<td><input id="c1" type="checkbox" name="mo_check[]" value="05"/></td>
<td>Availability or performance or Monitoring is available in All Pre-Prod App/DB servers</td>
</tr>
<tr>
<th scope="row">1</th>
<td><input id="c1" type="checkbox" name="ci_check[]" value="05"/></td>
<td>We maintain Centrailized version control system for code and Dependencis in GIT</td>
<td><input id="c1" type="checkbox" name="au_check[]" value="05"/></td>
<td>Functional test are Developed and Integrated with existing test suites for stories in each sprint</td>
<td><input id="c1"type="checkbox" name="cd_check[]" value="05"/></td>
<td>Code Deployment is automated through Jenkins / Ansible</td>
<td><input id="c1" type="checkbox" name="mo_check[]" value="05"/></td>
<td>Functional / Performance Monitoring is available in Production</td>
</tr>
<tr>
<th scope="row">0</th>
<td><input id="c1" type="checkbox" name="ci_check[]" value="01" class="check"/></td>
<td>Not on Recommanded centralized Repo (GIT) and Centrailized Build Platform</td>
<td><input id="c1" type="checkbox" name="au_check[]" value="01" class="check"/></td>
<td>Automated Unit tests exists and excercised. </td>
<td><input id="c1" type="checkbox" name="cd_check[]" value="01" class="check"/></td>
<td>We do a Manual code Deployment</td>
<td><input id="c1" type="checkbox" name="mo_check[]" value="05" class="check"/></td>
<td>Production Health Monitoring is available</td>
</tr>
</tbody>
</table>
<div class="text-right">
<div class="message" id="message"></div>
<br>
<button type="button" id="calculate" class="btn btn-success" data-toggle="modal" data-target="#myModal" >Calculate Score</button>
<button type="button" id="reset" onclick="handleChange()" class="btn btn-warning">Reset</button>
<button type="button" id="save" class="btn btn-info">Submit Result</button>
<button type="button" id="retrive" class="btn btn-primary">Prevous Results</button>
</div>
<p>
<br>
<h4 style="color: #00FF30;">Note:</h4>
<p style="color: white;">1. If any of the objectives are not in scope,you earn full ponts for that level<br>
2. When Successfully achieve an objective, The weight of the objective is added to your score<br>
3. The Total score is the cumulative sum of all the scores in each objective at different level<br>
</p>
</p>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal modal-wide" id="myModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
<div class="modal-dialog ezCustTrans">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Score and Badge</h4>
</div>
<div class="modal-body">
<div class= "contaner-fluid">
<div class="row">
<div class="col-md-5"></div>
<div class="col-md-4"><p><h2 id="noofscore"></h2></p></div>
</div>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4"> <img id="myimage" src="img/star.png" width="150" height="150"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div></div></table>
<script type="text/javascript">
function handleChange(cb) {
var allCB = document.querySelectorAll("input[id='c1']");
for(var i=0; i< allCB.length; i++){
allCB[i].checked=false;
}
}
</script>
<script>
$(document).ready(function(){
//alert("hii");
$("#calculate").click(function(){
var cal=00;
var ci=00;
var checked = []
$("input[name='ci_check[]']:checked").each(function ()
{
checked.push(parseInt($(this).val()));
ci=ci + Number($(this).val());
});
var au=0;
var checked_au = []
$("input[name='au_check[]']:checked").each(function ()
{
checked_au.push(parseInt($(this).val()));
au = au + Number($(this).val());
});
var cd=0;
var checked_cd = []
$("input[name='cd_check[]']:checked").each(function ()
{
checked_cd.push(parseInt($(this).val()));
cd = cd + Number($(this).val());
});
var mo=0;
var checked_mo = []
$("input[name='mo_check[]']:checked").each(function ()
{
checked_mo.push(parseInt($(this).val()));
mo = mo + Number($(this).val());
});
cal = ci+au+cd+mo;
if ( cal <= 15 )
{
document.getElementById('myimage').src = 'img/bronze.png';
$("#noofscore").html(cal);
}
else if (cal >=16 && cal <=25)
{
$("#noofscore").html(cal);
document.getElementById('myimage').src = 'img/bronze.png';
}
else if( cal >= 26 && cal <= 60)
{
$("#noofscore").html(cal);
document.getElementById('myimage').src = 'img/silver.png';
}
else if (cal >= 61 && cal <=80)
{
$("#noofscore").html(cal);
document.getElementById('myimage').src = 'img/gold.png';
}
else if (cal >= 81 && cal <=100)
{
$("#noofscore").html(cal);
document.getElementById('myimage').src = 'img/star.png';
}
else
{
$("#noofscore").html(cal);
document.getElementById('myimage').src = 'img/sar.png';
}
});
});
</script>
<script>
$(document).ready(function(){
//alert("hii");
$("#save").click(function(){
var ci=0;
var checked = []
$("input[name='ci_check[]']:checked").each(function ()
{
checked.push(parseInt($(this).val()));
ci=ci + Number($(this).val());
});
var au=0;
var checked_au = []
$("input[name='au_check[]']:checked").each(function ()
{
checked_au.push(parseInt($(this).val()));
au = au + Number($(this).val());
});
var cd=0;
var checked_cd = []
$("input[name='cd_check[]']:checked").each(function ()
{
checked_cd.push(parseInt($(this).val()));
cd = cd + Number($(this).val());
});
var mo=0;
var checked_mo = []
$("input[name='mo_check[]']:checked").each(function ()
{
checked_mo.push(parseInt($(this).val()));
mo = mo + Number($(this).val());
});
$.ajax({
type: "POST",
url: "save_ajax.php",
data: "ci="+ci+"&au="+au+"&cd="+cd+"&mo="+mo,
success: function(html){
$("#message").html(html);
}
});
return false;
});
});
</script>
</body>
</html>