Skip to content

Commit fb0f20b

Browse files
committed
svn 로그 출력
1 parent 4a163ca commit fb0f20b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

zimmyrabbit/zimmyrabbit/views.py

+27
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django.shortcuts import render,redirect
22
from django.http import HttpResponse
3+
import subprocess
34

45
def index(request) :
56
return render(request, 'jenkins/main.html')
@@ -9,4 +10,30 @@ def check_model(request) :
910
content = request.POST.get('content')
1011
scontent = sorted(set(content.split()))
1112
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+
1239
return redirect('zimmyrabbit:index')

0 commit comments

Comments
 (0)