From d3b5d8314fe20e6cf06db07022ef7295674da88e Mon Sep 17 00:00:00 2001 From: Samuel Nunes Sergio Date: Sat, 17 Feb 2024 04:21:34 -0300 Subject: [PATCH 1/8] Add check-application --- .github/workflows/CI.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c56fa6c..99f3fc6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,9 +1,7 @@ name: CI - on: [push] - jobs: - build: + check-application: runs-on: ubuntu-latest steps: From e6f42c0b5146523d3e07013a414a5acb2ec088db Mon Sep 17 00:00:00 2001 From: Samuel Nunes Sergio Date: Sat, 17 Feb 2024 04:29:58 -0300 Subject: [PATCH 2/8] Add new steps --- .github/workflows/CI.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 99f3fc6..e6bd39e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,5 +1,8 @@ name: CI -on: [push] +on: + pull_request: + branches: + - develop jobs: check-application: runs-on: ubuntu-latest @@ -17,3 +20,22 @@ jobs: - name: Run tests run: npm test + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: false + tags: wesleywillians/fc2.0-ci-go:latest From ccc936c5d39c0a92180f25309048d65b4c42a7bb Mon Sep 17 00:00:00 2001 From: Samuel Nunes Sergio Date: Sat, 17 Feb 2024 04:33:04 -0300 Subject: [PATCH 3/8] Add correct tags --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e6bd39e..d150a08 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,7 +20,7 @@ jobs: - name: Run tests run: npm test - + - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -38,4 +38,4 @@ jobs: uses: docker/build-push-action@v2 with: push: false - tags: wesleywillians/fc2.0-ci-go:latest + tags: sfourm/continuous-integration:latest From 0f5b0c3e66b738d33dcd9b6300977c19007f03e8 Mon Sep 17 00:00:00 2001 From: Samuel Nunes Sergio Date: Sat, 17 Feb 2024 04:54:43 -0300 Subject: [PATCH 4/8] Test push image to docker hub --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index a0746d8..10b5508 100644 --- a/app.js +++ b/app.js @@ -2,7 +2,7 @@ const express = require('express') const app = express() app.get('/', (req, res) => { - res.status(202).send({ message: 'Hello World!' }) + res.status(202).send({ message: 'Hello World!'}) }) module.exports = app From f68ce6456c7518406f9b2e52a082af22868e4d50 Mon Sep 17 00:00:00 2001 From: Samuel Nunes Sergio Date: Sat, 17 Feb 2024 04:58:12 -0300 Subject: [PATCH 5/8] Test push image to docker hub --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 10b5508..a0746d8 100644 --- a/app.js +++ b/app.js @@ -2,7 +2,7 @@ const express = require('express') const app = express() app.get('/', (req, res) => { - res.status(202).send({ message: 'Hello World!'}) + res.status(202).send({ message: 'Hello World!' }) }) module.exports = app From 6454e954d3308d9a8f704873dcc384f0f5538ff3 Mon Sep 17 00:00:00 2001 From: Samuel Nunes Sergio Date: Sat, 17 Feb 2024 05:07:48 -0300 Subject: [PATCH 6/8] Add keys from SonarCloud --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 8196944..8dadc39 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=pedrofurtado_fullcycle-3.0-integracao-continua-desafios-pipeline-ci-com-sonarcloud -sonar.organization=pedro-furtado +sonar.projectKey=sfourm_continuous-integration +sonar.organization=sfourm # This is the name and version displayed in the SonarCloud UI. #sonar.projectName=fullcycle-3.0-integracao-continua-desafios-pipeline-ci-com-sonarcloud From 3959f56d0226927f11eb3051bae1da5b2df0cfe6 Mon Sep 17 00:00:00 2001 From: Samuel Nunes Sergio Date: Sat, 17 Feb 2024 05:11:54 -0300 Subject: [PATCH 7/8] Add keys from SonarCloud --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 8dadc39..b0590b6 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,7 +2,7 @@ sonar.projectKey=sfourm_continuous-integration sonar.organization=sfourm # This is the name and version displayed in the SonarCloud UI. -#sonar.projectName=fullcycle-3.0-integracao-continua-desafios-pipeline-ci-com-sonarcloud +#sonar.projectName=continuous-integration #sonar.projectVersion=1.0 @@ -10,4 +10,4 @@ sonar.organization=sfourm #sonar.sources=. # Encoding of the source code. Default is default system encoding -#sonar.sourceEncoding=UTF-8 +#sonar.sourceEncoding=UTF-8 \ No newline at end of file From f206b07b283e04a4cc07bbece40fef13612cc2d4 Mon Sep 17 00:00:00 2001 From: Samuel Nunes Sergio Date: Sat, 17 Feb 2024 05:23:08 -0300 Subject: [PATCH 8/8] Add Action Main --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d150a08..f28219d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,6 +3,7 @@ on: pull_request: branches: - develop + - main jobs: check-application: runs-on: ubuntu-latest