Skip to content

Commit a783a45

Browse files
committed
function별 주석 추가
1 parent 352e034 commit a783a45

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

zimmyrabbit/zimmyrabbit/views.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
from .serializers import BuildHistSerializer
1717
from .models import BuildHist
1818

19-
19+
# main page
2020
def index(request) :
2121
return render(request, 'jenkins/main.html')
2222

23-
23+
# commit log check
2424
def check_model(request) :
2525
jsonObject = json.loads(request.body)
2626

@@ -69,6 +69,7 @@ def check_model(request) :
6969

7070
return JsonResponse(all_contexts, safe=False)
7171

72+
# request build to jenkins
7273
def request_build(request):
7374
jsonObject = json.loads(request.body)
7475

@@ -104,15 +105,16 @@ def request_build(request):
104105

105106
return JsonResponse({'error': '빌드 실패'})
106107

107-
108+
# build status check
108109
def wait_for_build_completion(build_job, build_number, headers) :
109110
# 빌드가 완료될 때까지 주기적으로 빌드 상태를 확인하는 함수
110111
while True:
111112
build_status = get_build_status(build_job, build_number, headers)
112113
if build_status is not None:
113114
return build_status
114115
time.sleep(5) # 5초마다 빌드 상태를 확인
115-
116+
117+
# build info
116118
def get_build_status(build_job, build_number, headers):
117119
# 빌드 상태 확인을 위한 Jenkins 빌드 정보 API 호출
118120
api_url = f'{os.environ.get("JENKINS_ADDRESS")}{build_job}/{build_number}/api/json'

0 commit comments

Comments
 (0)