chore: initial commit local CI/CD system (e2e verified, production-ready)

Sistema CI locale basato su VMware Workstation + Gitea Actions + act_runner.
Testato e2e con nsis-plugin-nsinnounp (MSBuild + Python, 4 configurazioni parallele).

- scripts/: Invoke-CIJob, Invoke-RemoteBuild, New/Remove-BuildVM, Wait-VMReady, Get-BuildArtifacts
- runner/: act_runner config (windows-build label, capacity 4)
- gitea/workflows/: build-nsis.yml (template per progetti MSBuild/Python)
- template/: script di provisioning template VM (VS BuildTools 2026, .NET SDK 10, Python 3.13)
- docs/: ARCHITECTURE, CI-FLOW, OPTIMIZATION, BEST-PRACTICES, Setup-GiteaSSH

Verificato: e2e-009 SUCCESS in 02:09, cleanup automatico VM confermato.
This commit is contained in:
Simone
2026-05-08 23:25:50 +02:00
commit dd238121b3
21 changed files with 3574 additions and 0 deletions
+101
View File
@@ -0,0 +1,101 @@
# Configurazione accesso SSH a Gitea
**Target**: clone da `git@gitea.emulab.it:Simone/nsis-plugin-nsinnounp.git`
**Gitea**: `http://10.10.20.11:3100` / `https://gitea.emulab.it`
---
## 1. Genera la chiave SSH sull'host Windows
```powershell
# Da PowerShell normale (non admin necessario)
ssh-keygen -t ed25519 -C "ci-build@WS1-W11" -f "$env:USERPROFILE\.ssh\id_ci_gitea"
```
- Passphrase: **lascia vuota** (il CI gira non-interattivo)
- Produce due file:
- `~\.ssh\id_ci_gitea` — chiave privata (non condividere mai)
- `~\.ssh\id_ci_gitea.pub` — chiave pubblica da aggiungere a Gitea
---
## 2. Aggiungi la chiave pubblica a Gitea
1. Apri `http://10.10.20.11:3100` → Login come **Simone**
2. Menu utente (in alto a destra) → **Settings****SSH / GPG Keys**
3. Clicca **Add Key**
4. Incolla il contenuto di `~\.ssh\id_ci_gitea.pub`:
```powershell
Get-Content "$env:USERPROFILE\.ssh\id_ci_gitea.pub" | clip
```
5. **Key Name**: `WS1-CI-Host`
6. Salva → **Add Key**
---
## 3. Configura SSH client sull'host
> **Attenzione**: `10.10.20.11` è già usato nel file `~\.ssh\config` con `User root` (entry `HomeAssistant`).
> Non usare `Host 10.10.20.11` direttamente — usare un alias dedicato `gitea-ci`.
Aggiungi in fondo a `~\.ssh\config`:
```powershell
$entry = @"
Host gitea-ci
HostName 10.10.20.11
Port 2222
User git
IdentityFile $env:USERPROFILE\.ssh\id_ci_gitea
IdentitiesOnly yes
"@
Add-Content "$env:USERPROFILE\.ssh\config" $entry
```
---
## 4. Verifica connessione
```powershell
ssh -T gitea-ci
```
Risposta attesa:
```
Hi there, Simone! You've successfully authenticated with the key named ci-build@WS1-W11, but Gitea does not provide shell access.
```
> **Nota**: exit code 1 è **normale** — Gitea non fornisce shell, ma l'autenticazione è avvenuta.
---
## 5. ~~Trova la porta SSH di Gitea~~
**Porta confermata: 2222** (verificata con `Test-NetConnection -ComputerName 10.10.20.11 -Port 2222`).
---
## 6. URL SSH da usare in Invoke-CIJob.ps1
Usare l'alias `gitea-ci` definito in `~\.ssh\config`:
```powershell
-RepoUrl 'ssh://gitea-ci/Simone/nsis-plugin-nsinnounp.git'
```
Oppure con IP/porta espliciti (equivalente):
```powershell
-RepoUrl 'ssh://git@10.10.20.11:2222/Simone/nsis-plugin-nsinnounp.git'
```
---
## 7. Aggiungi host a known_hosts (evita prompt interattivo)
```powershell
ssh-keyscan -p 2222 10.10.20.11 >> "$env:USERPROFILE\.ssh\known_hosts"
```