Entornos de desarrollo

1º DAM/DAW - Curso 2026-2027

User Tools

Site Tools


apuntes:cicd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
apuntes:cicd [2025/03/23 17:46] – Santiago Faciapuntes:cicd [2026/09/27 22:39] (current) – [Publicar una imagen docker en Docker Hub] Santiago Faci
Line 4: Line 4:
 {{ github_actions_logo.png?200 }} {{ github_actions_logo.png?200 }}
 </figure> </figure>
 +
 +===== Testing ======
 +
 +Workflow: **Node.js**
  
 <code yaml> <code yaml>
Line 36: Line 40:
     - run: npm run integration-test     - run: npm run integration-test
 </code> </code>
 +
 +===== Crear una imagen docker ======
 +
 +Workflow: **Docker Image**
  
 <code yaml> <code yaml>
Line 57: Line 65:
       run: docker build . --file Dockerfile --tag cities:$(date +%s)       run: docker build . --file Dockerfile --tag cities:$(date +%s)
 </code> </code>
 +
 +===== Publicar una imagen docker en Docker Hub ======
 +
 +Workflow: **Publish Docker Image**
 +
 +<code yaml>
 +name: Publish docker image
 +
 +on:
 +  push:
 +    branches:
 +      - main
 +
 +jobs:
 +  publish-docker-image:
 +    runs-on: ubuntu-latest
 +    steps:
 +      - uses: docker/login-action@v4
 +        with:
 +          username: ${{ secrets.DOCKER_HUB_USERNAME }}
 +          password: ${{ secrets.DOCKER_HUB_PASSWORD }}
 +      - uses: actions/checkout@master
 +      - uses: actions/setup-java@v5
 +        with:
 +          distribution: 'temurin'
 +          java-version: '21'
 +      - run: mvn package
 +      - run: docker build -t sfaci/games .
 +      - run: docker compose up -d
 +      - run: npm install -g newman
 +      - run: newman run games.postman_collection.json -e local.postman_environment.json
 +      - run: docker push sfaci/games
 +</code>
 +
 +===== Lanzar un análisis de código con Sonarqube ======
 +
 +Workflow: **SonarQube**
  
 <code yaml> <code yaml>
apuntes/cicd.1742751973.txt.gz · Last modified: by Santiago Faci