feat: gated deploy with preview, audit log, rollback trail (stage 4)
- pulp_client: create_publication / update_distribution / wait_for_task
- GET /repos/{uuid}/deploy/confirm: 미리보기(현재→대상, 순 변화) + type-to-confirm 모달
- POST /repos/{uuid}/deploy: 검증 게이트(서버측 재확인) → publication 생성 →
distribution 교체 → 감사 로그. 2단계 실패 시 '운영망 변경 여부' 명확화
- audit.record_deploy: 누가/언제/repo/이전버전→대상버전 JSONL (롤백 추적)
- 배포 버튼은 검증 통과 + 미배포 버전만 활성, 성공 시 버전목록 OOB 갱신
- 인증은 TODO (operator placeholder, 배포 비밀번호 재확인 예정)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
41
app/templates/partials/deploy_modal.html
Normal file
41
app/templates/partials/deploy_modal.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<dialog open>
|
||||
<article>
|
||||
<header>
|
||||
<h3>이 버전을 운영망에 배포</h3>
|
||||
</header>
|
||||
|
||||
{% if error %}
|
||||
<p class="status-line status-bad">{{ error }}</p>
|
||||
{% endif %}
|
||||
|
||||
<p>운영 서버(yum/dnf)가 실제로 내려받는 버전이 바뀝니다. 신중히 확인하세요.</p>
|
||||
|
||||
{% if preview %}
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><td>현재 운영</td>
|
||||
<td class="num">{% if preview.current_version is not none %}v{{ preview.current_version }} ({{ preview.current_count }}개){% else %}없음{% endif %}</td></tr>
|
||||
<tr><td>배포 대상</td>
|
||||
<td class="num">v{{ preview.target_version }} ({{ preview.target_count }}개)</td></tr>
|
||||
<tr><td>순 변화</td>
|
||||
<td class="num">{{ preview.net_sign }}{{ preview.net }}개</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
<form hx-post="/repos/{{ uuid }}/deploy" hx-target="#modal" hx-swap="innerHTML">
|
||||
<input type="hidden" name="version_href" value="{{ version_href }}">
|
||||
<label>
|
||||
확인을 위해 저장소 이름 <strong>{{ repo_name }}</strong> 을(를) 입력하세요
|
||||
<input type="text" name="confirm_name" autocomplete="off" required
|
||||
oninput="document.getElementById('deploy-confirm-btn').disabled = (this.value !== {{ repo_name | tojson }})">
|
||||
</label>
|
||||
{# TODO(auth): 로그인 도입 시 여기서 배포 비밀번호 재확인 입력 추가 #}
|
||||
<footer>
|
||||
<button type="button" class="secondary"
|
||||
onclick="document.getElementById('modal').innerHTML=''">취소</button>
|
||||
<button type="submit" id="deploy-confirm-btn" class="danger" disabled>배포 확정</button>
|
||||
</footer>
|
||||
</form>
|
||||
</article>
|
||||
</dialog>
|
||||
20
app/templates/partials/deploy_success.html
Normal file
20
app/templates/partials/deploy_success.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{# 배포 성공: 버전 목록을 OOB 로 갱신 + flash 배너 + 모달 자리에 완료 알림 #}
|
||||
{% set oob = true %}
|
||||
{% include "partials/version_list.html" %}
|
||||
|
||||
<div id="flash" hx-swap-oob="true">
|
||||
<p class="status-line status-ok">
|
||||
배포 완료 · v{{ to_version }}{% if from_version is not none %} (이전 v{{ from_version }}){% endif %}
|
||||
{% if not audit_ok %} — ⚠ 감사 로그 기록 실패{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<dialog open>
|
||||
<article>
|
||||
<header><h3>배포 완료</h3></header>
|
||||
<p>운영 배포 버전이 <strong>v{{ to_version }}</strong> 로 교체되었습니다.</p>
|
||||
<footer>
|
||||
<button onclick="document.getElementById('modal').innerHTML=''">닫기</button>
|
||||
</footer>
|
||||
</article>
|
||||
</dialog>
|
||||
@@ -1,4 +1,4 @@
|
||||
<div id="version-list" class="table-card">
|
||||
<div id="version-list" class="table-card"{% if oob %} hx-swap-oob="true"{% endif %}>
|
||||
{% if versions %}
|
||||
<table>
|
||||
<thead>
|
||||
@@ -26,9 +26,14 @@
|
||||
<td>{% if v.gpg %}<span class="badge badge-{{ v.gpg.level }}">{{ v.gpg.label }}</span>{% endif %}</td>
|
||||
<td>{% if v.is_deployed %}<span class="badge badge-deployed">운영 배포 중</span>{% endif %}</td>
|
||||
<td>
|
||||
{% if not v.is_deployed %}
|
||||
<!-- 배포 버튼 활성화/확인 모달은 단계4에서 연결 -->
|
||||
<button class="secondary" disabled>이 버전 배포</button>
|
||||
{% if v.is_deployed %}
|
||||
{# 배포 상태 칸에 배지 표시 #}
|
||||
{% elif v.deployable %}
|
||||
<button class="secondary"
|
||||
hx-get="/repos/{{ uuid }}/deploy/confirm?version_href={{ v.href | urlencode }}"
|
||||
hx-target="#modal" hx-swap="innerHTML">이 버전 배포</button>
|
||||
{% else %}
|
||||
<button class="secondary" disabled title="검증을 통과하지 못해 배포할 수 없습니다">이 버전 배포</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
<section>
|
||||
<h2>{{ repo_name }} · 버전</h2>
|
||||
<div id="flash"></div>
|
||||
|
||||
{% if error %}
|
||||
<p class="status-line status-bad">버전 목록을 불러오지 못했습니다: {{ error }}</p>
|
||||
@@ -21,4 +22,7 @@
|
||||
{% include "partials/version_list.html" %}
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
<!-- 배포 확인 모달이 여기에 로드된다 -->
|
||||
<div id="modal"></div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user