feat: add local test deployment helper

This commit is contained in:
Md Bayazid Bostame
2026-03-29 00:23:44 +01:00
parent 0736bebd63
commit 1864218d16
3 changed files with 86 additions and 1 deletions

View File

@@ -294,6 +294,7 @@ make backup-verify BACKUP_DIR=backups/backup_YYYYmmdd_HHMMSS</code></pre>
<li>Current production workflow file: <code>.github/workflows/deploy-prod.yml</code>.</li>
<li>GitHub Actions uploads the working tree to the server over SSH. The server does not clone from GitHub.</li>
<li>This is intentional for a private repository: it removes the need to store GitHub deploy keys on the target server.</li>
<li>However, GitHub-hosted runners cannot reach a LAN-only private IP like <code>192.168.2.55</code>. For the current local test server, the correct CD path is manual deployment from a LAN machine or a self-hosted runner inside the same network.</li>
</ul>
<h3>GitHub Environments</h3>
<ul>
@@ -382,6 +383,10 @@ make backup-verify BACKUP_DIR=backups/backup_YYYYmmdd_HHMMSS</code></pre>
<li>Wait until <code>/healthz/</code> becomes healthy</li>
</ol>
<h3>Manual deploy</h3>
<p>The preferred current test-deployment path is the local helper script from a Mac or another LAN-connected workstation:</p>
<pre><code>./scripts/deploy_test_from_mac.sh</code></pre>
<p>This script fast-forwards <code>develop</code>, syncs the repo to the server with <code>rsync</code>, runs the remote deployment, and verifies the health endpoint.</p>
<p>Direct server-side deploy is still available if the code is already on the server:</p>
<pre><code>cd /opt/workdock
RUN_DJANGO_CHECK=0 DEPLOY_HEALTH_URL="http://127.0.0.1:8088/healthz/" ./scripts/deploy_stack.sh .env.test docker-compose.prod.yml</code></pre>
<h3>Validation after deploy</h3>