Commit fb0f20b 1 parent 4a163ca commit fb0f20b Copy full SHA for fb0f20b
File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1
1
from django .shortcuts import render ,redirect
2
2
from django .http import HttpResponse
3
+ import subprocess
3
4
4
5
def index (request ) :
5
6
return render (request , 'jenkins/main.html' )
@@ -9,4 +10,30 @@ def check_model(request) :
9
10
content = request .POST .get ('content' )
10
11
scontent = sorted (set (content .split ()))
11
12
print (scontent )
13
+
14
+ command = ''
15
+ output = subprocess .check_output (command , shell = True , text = True )
16
+
17
+ # 결과 파싱하여 계정, 날짜, 커밋로그 저장
18
+ commits = []
19
+ lines = output .split ('------------------------------------------------------------------------' )
20
+
21
+ accounts = []
22
+ dates = []
23
+ commit_logs = []
24
+
25
+ for i in range (1 , len (lines )- 1 ):
26
+ line = lines [i ].split (" | " )
27
+ account = line [1 ].strip ()
28
+ date = line [2 ].strip ()
29
+ commit_log = line [- 1 ].strip ()
30
+ accounts .append (account )
31
+ dates .append (date )
32
+ commit_logs .append (commit_log )
33
+
34
+ print ("Accounts:" , accounts )
35
+ print ("Dates:" , dates )
36
+ print ("Commit Logs:" , commit_logs )
37
+
38
+
12
39
return redirect ('zimmyrabbit:index' )
You can’t perform that action at this time.
0 commit comments