Commit a783a45 1 parent 352e034 commit a783a45 Copy full SHA for a783a45
File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 16
16
from .serializers import BuildHistSerializer
17
17
from .models import BuildHist
18
18
19
-
19
+ # main page
20
20
def index (request ) :
21
21
return render (request , 'jenkins/main.html' )
22
22
23
-
23
+ # commit log check
24
24
def check_model (request ) :
25
25
jsonObject = json .loads (request .body )
26
26
@@ -69,6 +69,7 @@ def check_model(request) :
69
69
70
70
return JsonResponse (all_contexts , safe = False )
71
71
72
+ # request build to jenkins
72
73
def request_build (request ):
73
74
jsonObject = json .loads (request .body )
74
75
@@ -104,15 +105,16 @@ def request_build(request):
104
105
105
106
return JsonResponse ({'error' : '빌드 실패' })
106
107
107
-
108
+ # build status check
108
109
def wait_for_build_completion (build_job , build_number , headers ) :
109
110
# 빌드가 완료될 때까지 주기적으로 빌드 상태를 확인하는 함수
110
111
while True :
111
112
build_status = get_build_status (build_job , build_number , headers )
112
113
if build_status is not None :
113
114
return build_status
114
115
time .sleep (5 ) # 5초마다 빌드 상태를 확인
115
-
116
+
117
+ # build info
116
118
def get_build_status (build_job , build_number , headers ):
117
119
# 빌드 상태 확인을 위한 Jenkins 빌드 정보 API 호출
118
120
api_url = f'{ os .environ .get ("JENKINS_ADDRESS" )} { build_job } /{ build_number } /api/json'
You can’t perform that action at this time.
0 commit comments