Gitlab Pipeline
Pipeline CI/CD dla repozytorium flows/gitlab (tego repozytorium). Obsługuje walidację statyczną, testy jednostkowe szablonów CI za pomocą conftest i deployment pipeline’ów na środowiska GitLab.
Użycie
Section titled “Użycie”W projekcie dodaj do .gitlab-ci.yml:
Joby i stagi
Section titled “Joby i stagi”Przepływ CI (branch != main)
Section titled “Przepływ CI (branch != main)”Przepływ CD (źródło: api/push/web)
Section titled “Przepływ CD (źródło: api/push/web)”Tabela jobów
Section titled “Tabela jobów”| Job | Nazwa emoji | Stage | CI | CD |
|---|---|---|---|---|
| versioning (Set Version) | 🕵 Set Version | .pre | ✅ | ✅ |
| environment-deployment-prepare | 🔧 Prepare Dynamic Deployment | .pre | ❌ | ✅ |
| conventional-commits | 🔍 Analyze Conventional Commits | validate | ✅ | ❌ |
| yamllint | 🕵 yamllint | validate | ✅* | ❌ |
| shellcheck | 🐚 shellcheck | validate | ✅* | ❌ |
| dependency | 📦 dependency | dependency | ❌ | ❌ |
| build | 🚀 build | build | ❌ | ❌ |
| trigger-deployment | 🚀 Trigger Deployment | deployment | ❌ | ✅ |
| deployment | 💥 deployment | deployment | ❌ | ✅** |
| unit-test | 🧪 unit-test | tests | ✅ | ❌ |
| publish | 🌐 publish | publish | ❌ | ❌ |
| versioning (Publish Version) | 📍 Publish Version | publish | ✅ | ❌ |
* tylko gdy zmienił się odpowiedni typ pliku względem main
** uruchamia się w child pipeline (CI_PIPELINE_SOURCE == "parent_pipeline")
Joby
dependency,buildipublishmająwhen: never.
Pipeline-specyficzny job
Section titled “Pipeline-specyficzny job”🧪 unit-test (tests)
Section titled “🧪 unit-test (tests)”Testy jednostkowe szablonów GitLab CI przy użyciu conftest (Open Policy Agent):
Obraz: registry.gitlab.com/pl.rachuna-net/artifacts/containers/conftest:1.1.0
Zależności 📍 Publish Version
Section titled “Zależności 📍 Publish Version”| Job | Wymagany |
|---|---|
🕵 Set Version | ✅ (artifacts) |
🧪 unit-test | ✅ (artifacts) |