====== 7. CI/CD ======
In questo capitolo imparerete come automatizzare il build di OpenSSL.
----
===== Cos'è CI/CD? =====
**CI** = Continuous Integration (Integrazione Continua)
**CD** = Continuous Delivery/Deployment
Sviluppatore → Git Push → Build → Test → Artefatto → Deployment
└─────── automatico ──────────────────┘
==== Perché Automatizzare? ====
| Manuale | Automatico |
|---------|------------|
| L'umano fa errori | Sempre lo stesso processo |
| "Funziona sul mio PC" | Build riproducibili |
| Aspettare chi fa i build | Subito disponibile |
| Nessuna documentazione | Cronologia Git come prova |
----
===== Panoramica =====
| Piattaforma | Descrizione | Pagina |
|-------------|-------------|--------|
| GitHub Actions | Gratuito per repo pubblici | [[.:github-actions]] |
| Azure DevOps | Enterprise, Self-Hosted possibile | [[.:azure-devops]] |
| GitLab CI | Self-Hosted popolare | - |
| Jenkins | Self-Hosted, molto flessibile | - |
----
===== Concetto Semplice =====
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ TRIGGER │────▶│ BUILD │────▶│ ARTEFATTO │
│ │ │ │ │ │
│ - Git Push │ │ - Checkout │ │ - DLL │
│ - Scheduled │ │ - Configure │ │ - NuGet │
│ - Manuale │ │ - nmake │ │ - File Share │
└──────────────┘ └──────────────┘ └──────────────┘
----
===== Avvio Rapido: GitHub Actions =====
# .github/workflows/build-openssl.yml
name: Build OpenSSL
on:
push:
branches: [ main ]
workflow_dispatch: # Avvio manuale
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Perl
run: choco install strawberryperl -y
- name: Install NASM
run: choco install nasm -y
- name: Build OpenSSL
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd src
perl Configure VC-WIN64A --prefix=%cd%\..\bin
nmake
nmake install_sw
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: openssl-win-x64
path: bin/
→ [[.:github-actions|Guida completa]]
----
===== Prerequisiti per CI/CD =====
| Requisito | GitHub Actions | Azure DevOps |
|-----------|----------------|--------------|
| Account | Account GitHub | Account Azure |
| Repository | Sì | Sì |
| Runner | Hosted (gratuito) | Hosted o Self-Hosted |
| Build Windows | ✓ windows-latest | ✓ windows-latest |
| Build Linux | ✓ ubuntu-latest | ✓ ubuntu-latest |
----
===== Continua con =====
* [[.:github-actions|GitHub Actions - Passo dopo passo]]
* [[.:azure-devops|Pipeline Azure DevOps]]
* [[.:.:start|Torna alla panoramica]]
----
//Wolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional//