180 lines
17 KiB
Plaintext
180 lines
17 KiB
Plaintext
<mxfile host="draw.io" modified="2026-02-12" agent="Claude Code" type="device">
|
|
<diagram id="a4-cicd" name="Pipeline Wdrożeniowy">
|
|
<mxGraphModel dx="1600" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1800" pageHeight="800" math="0" shadow="0">
|
|
<root>
|
|
<mxCell id="0"/>
|
|
<mxCell id="1" parent="0"/>
|
|
|
|
<mxCell id="title" value="NordaBiz — Pipeline Wdrożeniowy (CI/CD)" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=22;fontStyle=1;fontColor=#1a1a2e;" vertex="1" parent="1">
|
|
<mxGeometry x="500" y="15" width="520" height="36" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="subtitle" value="git push → staging → test → produkcja → migracje → restart → weryfikacja" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=11;fontColor=#888;" vertex="1" parent="1">
|
|
<mxGeometry x="480" y="48" width="540" height="20" as="geometry"/>
|
|
</mxCell>
|
|
|
|
<!-- KROK 1: DEV -->
|
|
<mxCell id="s1_bg" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#E8F5E9;strokeColor=#4CAF50;shadow=1;" vertex="1" parent="1">
|
|
<mxGeometry x="40" y="90" width="200" height="280" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s1_num" value="<b style="font-size:22px;color:#fff">1</b>" style="ellipse;whiteSpace=wrap;html=1;fillColor=#4CAF50;strokeColor=#2E7D32;" vertex="1" parent="1">
|
|
<mxGeometry x="55" y="95" width="36" height="36" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s1_title" value="<b style="font-size:13px">Rozwój (DEV)</b>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#2E7D32;" vertex="1" parent="1">
|
|
<mxGeometry x="95" y="98" width="120" height="28" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s1_d1" value="<font style="font-size:10px">💻 macOS localhost<br>Flask dev server :5000<br>Docker PostgreSQL :5433</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff;strokeColor=#4CAF50;fontSize=10;align=left;spacingLeft=6;" vertex="1" parent="1">
|
|
<mxGeometry x="55" y="140" width="170" height="55" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s1_d2" value="<font style="font-size:10px">python -m py_compile app.py<br>pytest tests/unit/ -v</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#4CAF50;fontSize=10;fontFamily=monospace;" vertex="1" parent="1">
|
|
<mxGeometry x="55" y="205" width="170" height="40" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s1_d3" value="<font style="font-size:10px">git add &amp;&amp; git commit</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#4CAF50;fontSize=10;fontFamily=monospace;" vertex="1" parent="1">
|
|
<mxGeometry x="55" y="255" width="170" height="30" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s1_d4" value="<font style="font-size:9px;color:#555">Aktualizuj release_notes w app.py!</font>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
|
<mxGeometry x="55" y="295" width="190" height="18" as="geometry"/>
|
|
</mxCell>
|
|
|
|
<!-- STRZAŁKA 1→2 -->
|
|
<mxCell id="a12" value="git push" style="shape=flexArrow;endArrow=classic;html=1;fillColor=#4CAF50;strokeColor=#2E7D32;fontSize=10;fontColor=#2E7D32;fontStyle=1;" edge="1" parent="1">
|
|
<mxGeometry relative="1" as="geometry">
|
|
<mxPoint x="250" y="230" as="sourcePoint"/>
|
|
<mxPoint x="310" y="230" as="targetPoint"/>
|
|
</mxGeometry>
|
|
</mxCell>
|
|
|
|
<!-- KROK 2: GIT REPOS -->
|
|
<mxCell id="s2_bg" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ECEFF1;strokeColor=#78909C;shadow=1;" vertex="1" parent="1">
|
|
<mxGeometry x="320" y="90" width="200" height="280" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s2_num" value="<b style="font-size:22px;color:#fff">2</b>" style="ellipse;whiteSpace=wrap;html=1;fillColor=#78909C;strokeColor=#546E7A;" vertex="1" parent="1">
|
|
<mxGeometry x="335" y="95" width="36" height="36" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s2_title" value="<b style="font-size:13px">Repozytoria</b>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#546E7A;" vertex="1" parent="1">
|
|
<mxGeometry x="375" y="98" width="110" height="28" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s2_d1" value="<font style="font-size:10px"><b>GitHub</b> (origin)<br>pienczyn/nordabiz<br>Cloud backup + CI/CD</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff;strokeColor=#78909C;fontSize=10;align=left;spacingLeft=6;" vertex="1" parent="1">
|
|
<mxGeometry x="335" y="140" width="170" height="55" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s2_d2" value="<font style="font-size:10px"><b>Gitea</b> (inpi)<br>10.22.68.180<br>Wewnętrzny, deploy source</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff;strokeColor=#78909C;fontSize=10;align=left;spacingLeft=6;" vertex="1" parent="1">
|
|
<mxGeometry x="335" y="205" width="170" height="55" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s2_d3" value="<font style="font-size:10px">.github/workflows/test.yml<br>unit → e2e → smoke</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ECEFF1;strokeColor=#78909C;fontSize=10;fontFamily=monospace;" vertex="1" parent="1">
|
|
<mxGeometry x="335" y="270" width="170" height="40" as="geometry"/>
|
|
</mxCell>
|
|
|
|
<!-- STRZAŁKA 2→3 -->
|
|
<mxCell id="a23" value="git pull" style="shape=flexArrow;endArrow=classic;html=1;fillColor=#FF8F00;strokeColor=#E65100;fontSize=10;fontColor=#E65100;fontStyle=1;" edge="1" parent="1">
|
|
<mxGeometry relative="1" as="geometry">
|
|
<mxPoint x="530" y="230" as="sourcePoint"/>
|
|
<mxPoint x="590" y="230" as="targetPoint"/>
|
|
</mxGeometry>
|
|
</mxCell>
|
|
|
|
<!-- KROK 3: STAGING -->
|
|
<mxCell id="s3_bg" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF8E1;strokeColor=#FF8F00;shadow=1;" vertex="1" parent="1">
|
|
<mxGeometry x="600" y="90" width="200" height="280" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s3_num" value="<b style="font-size:22px;color:#fff">3</b>" style="ellipse;whiteSpace=wrap;html=1;fillColor=#FF8F00;strokeColor=#E65100;" vertex="1" parent="1">
|
|
<mxGeometry x="615" y="95" width="36" height="36" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s3_title" value="<b style="font-size:13px">Staging</b>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#E65100;" vertex="1" parent="1">
|
|
<mxGeometry x="655" y="98" width="80" height="28" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s3_d1" value="<font style="font-size:10px">VM 248 | 10.22.68.248<br>staging.nordabiznes.pl<br>Flask + Gunicorn :5000</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff;strokeColor=#FF8F00;fontSize=10;align=left;spacingLeft=6;" vertex="1" parent="1">
|
|
<mxGeometry x="615" y="140" width="170" height="55" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s3_d2" value="<font style="font-size:10px">sudo -u www-data git pull<br>sudo systemctl restart nordabiznes</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFE082;strokeColor=#FF8F00;fontSize=10;fontFamily=monospace;" vertex="1" parent="1">
|
|
<mxGeometry x="615" y="205" width="170" height="40" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s3_d3" value="<font style="font-size:10px">🧪 TEST MANUALNY<br>(OBOWIĄZKOWY!)</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=11;fontStyle=1;" vertex="1" parent="1">
|
|
<mxGeometry x="615" y="255" width="170" height="40" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s3_d4" value="<font style="font-size:9px;color:#555">curl -I https://staging.nordabiznes.pl/health</font>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontFamily=monospace;" vertex="1" parent="1">
|
|
<mxGeometry x="600" y="305" width="220" height="18" as="geometry"/>
|
|
</mxCell>
|
|
|
|
<!-- STRZAŁKA 3→4 -->
|
|
<mxCell id="a34" value="OK?" style="shape=flexArrow;endArrow=classic;html=1;fillColor=#1565C0;strokeColor=#0D47A1;fontSize=10;fontColor=#0D47A1;fontStyle=1;" edge="1" parent="1">
|
|
<mxGeometry relative="1" as="geometry">
|
|
<mxPoint x="810" y="230" as="sourcePoint"/>
|
|
<mxPoint x="870" y="230" as="targetPoint"/>
|
|
</mxGeometry>
|
|
</mxCell>
|
|
|
|
<!-- KROK 4: PRODUKCJA -->
|
|
<mxCell id="s4_bg" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;shadow=1;" vertex="1" parent="1">
|
|
<mxGeometry x="880" y="90" width="200" height="280" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s4_num" value="<b style="font-size:22px;color:#fff">4</b>" style="ellipse;whiteSpace=wrap;html=1;fillColor=#1565C0;strokeColor=#0D47A1;" vertex="1" parent="1">
|
|
<mxGeometry x="895" y="95" width="36" height="36" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s4_title" value="<b style="font-size:13px">Produkcja</b>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#0D47A1;" vertex="1" parent="1">
|
|
<mxGeometry x="935" y="98" width="100" height="28" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s4_d1" value="<font style="font-size:10px">VM 249 | 10.22.68.249<br>nordabiznes.pl<br>Flask + Gunicorn :5000</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff;strokeColor=#6c8ebf;fontSize=10;align=left;spacingLeft=6;" vertex="1" parent="1">
|
|
<mxGeometry x="895" y="140" width="170" height="55" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s4_d2" value="<font style="font-size:10px">sudo -u www-data git pull</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D4E1F5;strokeColor=#6c8ebf;fontSize=10;fontFamily=monospace;" vertex="1" parent="1">
|
|
<mxGeometry x="895" y="205" width="170" height="28" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s4_d3" value="<font style="font-size:10px">run_migration.py (jeśli SQL)</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=10;fontFamily=monospace;" vertex="1" parent="1">
|
|
<mxGeometry x="895" y="243" width="170" height="28" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s4_d4" value="<font style="font-size:10px">sudo systemctl restart nordabiznes</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#D4E1F5;strokeColor=#6c8ebf;fontSize=10;fontFamily=monospace;" vertex="1" parent="1">
|
|
<mxGeometry x="895" y="281" width="170" height="28" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s4_warn" value="<font style="font-size:9px;color:#b85450">⚠️ Migracja PRZED restartem!</font>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
|
<mxGeometry x="895" y="318" width="170" height="18" as="geometry"/>
|
|
</mxCell>
|
|
|
|
<!-- STRZAŁKA 4→5 -->
|
|
<mxCell id="a45" value="" style="shape=flexArrow;endArrow=classic;html=1;fillColor=#2E7D32;strokeColor=#1B5E20;fontSize=10;" edge="1" parent="1">
|
|
<mxGeometry relative="1" as="geometry">
|
|
<mxPoint x="1090" y="230" as="sourcePoint"/>
|
|
<mxPoint x="1150" y="230" as="targetPoint"/>
|
|
</mxGeometry>
|
|
</mxCell>
|
|
|
|
<!-- KROK 5: WERYFIKACJA -->
|
|
<mxCell id="s5_bg" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;shadow=1;" vertex="1" parent="1">
|
|
<mxGeometry x="1160" y="90" width="200" height="280" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s5_num" value="<b style="font-size:22px;color:#fff">5</b>" style="ellipse;whiteSpace=wrap;html=1;fillColor=#2E7D32;strokeColor=#1B5E20;" vertex="1" parent="1">
|
|
<mxGeometry x="1175" y="95" width="36" height="36" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s5_title" value="<b style="font-size:13px">Weryfikacja</b>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#1B5E20;" vertex="1" parent="1">
|
|
<mxGeometry x="1215" y="98" width="110" height="28" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s5_d1" value="<font style="font-size:10px">curl -sI nordabiznes.pl/health<br>→ HTTP 200 OK</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff;strokeColor=#82b366;fontSize=10;fontFamily=monospace;" vertex="1" parent="1">
|
|
<mxGeometry x="1175" y="140" width="170" height="40" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s5_d2" value="<font style="font-size:10px">Smoke tests (GitHub Actions)<br>pytest tests/smoke/</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#C8E6C9;strokeColor=#82b366;fontSize=10;" vertex="1" parent="1">
|
|
<mxGeometry x="1175" y="190" width="170" height="40" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s5_d3" value="<font style="font-size:10px">Sprawdź logi:<br>journalctl -u nordabiznes -n 20</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff;strokeColor=#82b366;fontSize=10;fontFamily=monospace;" vertex="1" parent="1">
|
|
<mxGeometry x="1175" y="240" width="170" height="40" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="s5_ok" value="<b style="font-size:16px;color:#2E7D32">✅ GOTOWE</b>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
|
<mxGeometry x="1205" y="300" width="120" height="28" as="geometry"/>
|
|
</mxCell>
|
|
|
|
<!-- UWAGI NA DOLE -->
|
|
<mxCell id="notes_bg" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;opacity=30;" vertex="1" parent="1">
|
|
<mxGeometry x="40" y="400" width="1320" height="110" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="notes_title" value="<b style="font-size:12px;color:#b85450">⚠️ Uwagi krytyczne</b>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
|
|
<mxGeometry x="55" y="405" width="160" height="24" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="n1" value="<font style="font-size:10px">• <b>Migracje SQL</b> — ZAWSZE przed restartem! Bez migracji = 502<br>• <b>Git pull</b> — używaj <code>sudo -u www-data git pull</code> (www-data ma klucze SSH)<br>• <b>NPM port</b> — Forward port MUSI być 5000, nie 80! (pętla przekierowań)<br>• <b>SSH timeout</b> — NIE oznacza że komenda nie została wykonana! Sprawdź <code>ps aux</code><br>• <b>502 po restarcie</b> — poczekaj 3-5 sekund i sprawdź ponownie</font>" style="text;html=1;align=left;verticalAlign=top;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#333;" vertex="1" parent="1">
|
|
<mxGeometry x="55" y="430" width="530" height="80" as="geometry"/>
|
|
</mxCell>
|
|
<mxCell id="n2" value="<font style="font-size:10px"><b>Komendy deploy (produkcja):</b><br><code>ssh maciejpi@10.22.68.249<br>cd /var/www/nordabiznes<br>sudo -u www-data git pull<br>venv/bin/python3 scripts/run_migration.py database/migrations/XXX.sql<br>sudo systemctl restart nordabiznes<br>curl -sI https://nordabiznes.pl/health | head -3</code></font>" style="text;html=1;align=left;verticalAlign=top;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#333;" vertex="1" parent="1">
|
|
<mxGeometry x="700" y="405" width="400" height="100" as="geometry"/>
|
|
</mxCell>
|
|
|
|
</root>
|
|
</mxGraphModel>
|
|
</diagram>
|
|
</mxfile>
|