apuntes:cicd
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| apuntes:cicd [2024/10/13 11:41] – created Santiago Faci | apuntes:cicd [2025/03/25 00:33] (current) – [Publicar una imagen docker en Docker Hub] Santiago Faci | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Integración y despliegue continuo de una aplicación ====== | ====== Integración y despliegue continuo de una aplicación ====== | ||
| + | |||
| + | < | ||
| + | {{ github_actions_logo.png? | ||
| + | </ | ||
| + | |||
| + | ===== Testing ====== | ||
| + | |||
| + | Workflow: **Node.js** | ||
| + | |||
| + | <code yaml> | ||
| + | name: Unit and integration tests | ||
| + | |||
| + | on: | ||
| + | push: | ||
| + | branches: [ " | ||
| + | pull_request: | ||
| + | branches: [ " | ||
| + | |||
| + | jobs: | ||
| + | build: | ||
| + | |||
| + | runs-on: ubuntu-20.04 | ||
| + | |||
| + | strategy: | ||
| + | matrix: | ||
| + | node-version: | ||
| + | |||
| + | steps: | ||
| + | - uses: actions/ | ||
| + | - name: Use Node.js ${{ matrix.node-version }} | ||
| + | uses: actions/ | ||
| + | with: | ||
| + | node-version: | ||
| + | cache: ' | ||
| + | - run: npm install | ||
| + | - run: docker compose -f docker-compose.dev.yaml up -d | ||
| + | - run: sleep 3 | ||
| + | - run: npm run unit-test | ||
| + | - run: npm run integration-test | ||
| + | </ | ||
| + | |||
| + | ===== Crear una imagen docker ====== | ||
| + | |||
| + | Workflow: **Docker Image** | ||
| + | |||
| + | <code yaml> | ||
| + | name: Docker Image CI | ||
| + | |||
| + | on: | ||
| + | push: | ||
| + | branches: [ " | ||
| + | pull_request: | ||
| + | branches: [ " | ||
| + | |||
| + | jobs: | ||
| + | |||
| + | build: | ||
| + | |||
| + | runs-on: ubuntu-latest | ||
| + | |||
| + | steps: | ||
| + | - uses: actions/ | ||
| + | - name: Build the Docker image | ||
| + | run: docker build . --file Dockerfile --tag cities: | ||
| + | </ | ||
| + | |||
| + | ===== Publicar una imagen docker en Docker Hub ====== | ||
| + | |||
| + | Workflow: **Docker Image** | ||
| + | |||
| + | <code yaml> | ||
| + | </ | ||
| + | |||
| + | ===== Lanzar un análisis de código con Sonarqube ====== | ||
| + | |||
| + | Workflow: **SonarQube** | ||
| + | |||
| + | <code yaml> | ||
| + | name: Sonarqube | ||
| + | on: | ||
| + | push: | ||
| + | branches: | ||
| + | - main | ||
| + | pull_request: | ||
| + | types: [opened, synchronize, | ||
| + | jobs: | ||
| + | sonarqube: | ||
| + | name: SonarQube | ||
| + | runs-on: ubuntu-latest | ||
| + | steps: | ||
| + | - uses: actions/ | ||
| + | with: | ||
| + | fetch-depth: | ||
| + | - name: SonarQube Scan | ||
| + | uses: SonarSource/ | ||
| + | env: | ||
| + | SONAR_TOKEN: | ||
| + | </ | ||
| ---- | ---- | ||
apuntes/cicd.1728819703.txt.gz · Last modified: by Santiago Faci
