From 64999984c12f649fcf88830964096c4998019d5f Mon Sep 17 00:00:00 2001 From: rpinoga <34929141+rpinoga@users.noreply.github.com> Date: Wed, 26 Oct 2022 16:15:47 -0300 Subject: [PATCH 01/12] Delete .github/workflows directory --- .github/workflows/maven.yml | 42 ------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index 5f18d712..00000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,42 +0,0 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Build with Maven - run: mvn -B package --file pom.xml - - name: Install Octopus CLI 馃悪 - uses: OctopusDeploy/install-octopus-cli-action@v1.1.6 - with: - version: latest - - name: Push a package to Octopus Deploy 馃悪 - uses: OctopusDeploy/push-package-action@v1.0.1 - with: - api_key: ${{ secrets.OCTOPUS_APIKEY }} - server: ${{ secrets.OCTOPUS_SERVER }} - packages: "build/DevOpsUsach2020-0.0.1.jar" - - name: Create a release in Octopus Deploy 馃悪 - uses: OctopusDeploy/create-release-action@v1.0.2 - with: - api_key: ${{ secrets.OCTOPUS_APIKEY }} - server: ${{ secrets.OCTOPUS_SERVER }} - project: "test-bci" - deploy_to: "QA" From 7b82f3eeb71c584798d84cd80ea44534360fa403 Mon Sep 17 00:00:00 2001 From: danilo2311 Date: Tue, 8 Nov 2022 23:15:39 -0300 Subject: [PATCH 02/12] Update Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b67037b..43fbe323 100644 --- a/README.md +++ b/README.md @@ -43,4 +43,4 @@ # Uso - Agregar archivo **_Jenkinsfile_** en la ra铆z de la rama del proyecto a procesar (s贸lo como pivote al c贸digo del pipeline). - Registrar Pipeline en **_Jenkins -> Administrar Jenkins -> Configuraci贸n Global -> Global Pipeline Libraries_** bajo el nombre **_pipeline_** -- Configurar _Multibranch Pipeline Job_ o _Pipeline Job_ en Jenkins con el repositorio del proyecto a procesar. +- Configurar _Multibranch Pipeline Job_ o _Pipeline Job_ en Jenkins con el repositorio del proyecto a procesar..... From 1472743a74c29ad420e687726723b1e06e5d2468 Mon Sep 17 00:00:00 2001 From: danilo2311 Date: Tue, 8 Nov 2022 23:20:20 -0300 Subject: [PATCH 03/12] add Jenkinsfile --- Jenkinsfile | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..2571f4ff --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,75 @@ +pipeline { + agent any + stages { + stage('Build'){ + steps{ + echo 'Building...' + slackSend color: "warning", message: "Building..." + sh './mvnw clean compile -e' + + } + post { + success { + echo 'Build Success' + slackSend color: "good", message: "Build Success" + } + failure { + echo 'Build Failed' + slackSend color: "danger", message: "Build Failed" + } + } + } + stage('Test'){ + steps{ + echo 'Testing...' + slackSend color: "warning", message: "Testing..." + sh './mvnw test -e' + } + post { + success { + echo 'Test Success' + slackSend color: "good", message: "Test Success" + } + failure { + echo 'Test Failed' + slackSend color: "danger", message: "Test Failed" + } + } + } + stage('Package'){ + steps{ + echo 'Packaging...' + slackSend color: "warning", message: "Packaging..." + sh './mvnw package -e' + } + post { + success { + echo 'Package Success' + slackSend color: "good", message: "Package Success" + } + failure { + echo 'Package Failed' + slackSend color: "danger", message: "Package Failed" + } + } + } + stage('Run'){ + steps{ + echo 'Running...' + slackSend color: "warning", message: "Running..." + sh '#./mvnw spring-boot:run -e' + } + post { + success { + echo 'Run Success' + slackSend color: "good", message: "Run Success" + cleanWs() + } + failure { + echo 'Run Failed' + slackSend color: "danger", message: "Run Failed" + } + } + } + } +} From b796753d13d6c9c13ffcd6e7717fe246a45a38f9 Mon Sep 17 00:00:00 2001 From: paburtor <114960234+paburtor@users.noreply.github.com> Date: Wed, 9 Nov 2022 00:01:50 -0300 Subject: [PATCH 04/12] Update RestData.java --- .../com/devopsusach2020/rest/RestData.java | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/devopsusach2020/rest/RestData.java b/src/main/java/com/devopsusach2020/rest/RestData.java index e06ca00f..dc9366a3 100644 --- a/src/main/java/com/devopsusach2020/rest/RestData.java +++ b/src/main/java/com/devopsusach2020/rest/RestData.java @@ -23,13 +23,32 @@ public class RestData { private final static Logger LOGGER = Logger.getLogger("devops.subnivel.Control"); - @GetMapping(path = "/test", produces = MediaType.APPLICATION_JSON_VALUE) - public @ResponseBody Pais getData(@RequestParam(name = "msg") String message){ - - LOGGER.log(Level.INFO, "Proceso exitoso de prueba"); - - Pais response = new Pais(); - response.setMensaje("Mensaje Recibido: " + message); - return response; - } +@GetMapping (path = "/estadoPais", produces = MediaType. APPLICATION_JSON_VALUE) +public @ResponseBody Pais getTotalPais (@RequestParam(name = "pais") String message) { +RestTemplate restTemplate = new RestTemplate(); +ResponseEntity call= rest Template.getForEntity("https://api.covid19api.com/live/country/" + message, String.class); + + LOGGER.log(Level.INFO, "Consulta por pais"); + Pais response = new Pais(); + int confirmed = 0; + int death = 0; + int recovered = 0; + Gson gson = new Gson(); + Pais[] estados = gson. fromJson(call.getBody().toLowerCase(), Pais[].class); + +for(Pais estado : estados) { + response.setDate(estado.getDate()); + response.setActive(estado.getActive()); + confirmed += estado.getConfirmed(); + death += estado.getDeaths(); + recovered += estado.getRecovered(); +} + + response. setConfirmed (confirmed); + response.setDeaths (death); + response. setRecovered (recovered); + response.setCountry(message); + response.setMensaje("ok"); +return response; +} } From 13ffb133191e95230944788e5aae89a07f6d51b0 Mon Sep 17 00:00:00 2001 From: Danilo Vidal Date: Wed, 9 Nov 2022 00:15:11 -0300 Subject: [PATCH 05/12] fix --- src/main/java/com/devopsusach2020/rest/RestData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/devopsusach2020/rest/RestData.java b/src/main/java/com/devopsusach2020/rest/RestData.java index dc9366a3..99b9ced7 100644 --- a/src/main/java/com/devopsusach2020/rest/RestData.java +++ b/src/main/java/com/devopsusach2020/rest/RestData.java @@ -26,7 +26,7 @@ public class RestData { @GetMapping (path = "/estadoPais", produces = MediaType. APPLICATION_JSON_VALUE) public @ResponseBody Pais getTotalPais (@RequestParam(name = "pais") String message) { RestTemplate restTemplate = new RestTemplate(); -ResponseEntity call= rest Template.getForEntity("https://api.covid19api.com/live/country/" + message, String.class); +ResponseEntity call= restTemplate.getForEntity("https://api.covid19api.com/live/country/" + message, String.class); LOGGER.log(Level.INFO, "Consulta por pais"); Pais response = new Pais(); From 9227cffc77ea2bdce51063efa83720804d1c9471 Mon Sep 17 00:00:00 2001 From: Danilo Vidal Date: Fri, 11 Nov 2022 23:09:38 -0300 Subject: [PATCH 06/12] Revert "add Jenkinsfile" This reverts commit 1472743a74c29ad420e687726723b1e06e5d2468. --- Jenkinsfile | 75 ----------------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 2571f4ff..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,75 +0,0 @@ -pipeline { - agent any - stages { - stage('Build'){ - steps{ - echo 'Building...' - slackSend color: "warning", message: "Building..." - sh './mvnw clean compile -e' - - } - post { - success { - echo 'Build Success' - slackSend color: "good", message: "Build Success" - } - failure { - echo 'Build Failed' - slackSend color: "danger", message: "Build Failed" - } - } - } - stage('Test'){ - steps{ - echo 'Testing...' - slackSend color: "warning", message: "Testing..." - sh './mvnw test -e' - } - post { - success { - echo 'Test Success' - slackSend color: "good", message: "Test Success" - } - failure { - echo 'Test Failed' - slackSend color: "danger", message: "Test Failed" - } - } - } - stage('Package'){ - steps{ - echo 'Packaging...' - slackSend color: "warning", message: "Packaging..." - sh './mvnw package -e' - } - post { - success { - echo 'Package Success' - slackSend color: "good", message: "Package Success" - } - failure { - echo 'Package Failed' - slackSend color: "danger", message: "Package Failed" - } - } - } - stage('Run'){ - steps{ - echo 'Running...' - slackSend color: "warning", message: "Running..." - sh '#./mvnw spring-boot:run -e' - } - post { - success { - echo 'Run Success' - slackSend color: "good", message: "Run Success" - cleanWs() - } - failure { - echo 'Run Failed' - slackSend color: "danger", message: "Run Failed" - } - } - } - } -} From 186100bdccc3fb3834e69bb8bab36c2557299fd0 Mon Sep 17 00:00:00 2001 From: Danilo Vidal Date: Fri, 11 Nov 2022 23:15:47 -0300 Subject: [PATCH 07/12] add Jenkinsfile --- Jenkinsfile | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..2571f4ff --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,75 @@ +pipeline { + agent any + stages { + stage('Build'){ + steps{ + echo 'Building...' + slackSend color: "warning", message: "Building..." + sh './mvnw clean compile -e' + + } + post { + success { + echo 'Build Success' + slackSend color: "good", message: "Build Success" + } + failure { + echo 'Build Failed' + slackSend color: "danger", message: "Build Failed" + } + } + } + stage('Test'){ + steps{ + echo 'Testing...' + slackSend color: "warning", message: "Testing..." + sh './mvnw test -e' + } + post { + success { + echo 'Test Success' + slackSend color: "good", message: "Test Success" + } + failure { + echo 'Test Failed' + slackSend color: "danger", message: "Test Failed" + } + } + } + stage('Package'){ + steps{ + echo 'Packaging...' + slackSend color: "warning", message: "Packaging..." + sh './mvnw package -e' + } + post { + success { + echo 'Package Success' + slackSend color: "good", message: "Package Success" + } + failure { + echo 'Package Failed' + slackSend color: "danger", message: "Package Failed" + } + } + } + stage('Run'){ + steps{ + echo 'Running...' + slackSend color: "warning", message: "Running..." + sh '#./mvnw spring-boot:run -e' + } + post { + success { + echo 'Run Success' + slackSend color: "good", message: "Run Success" + cleanWs() + } + failure { + echo 'Run Failed' + slackSend color: "danger", message: "Run Failed" + } + } + } + } +} From 4d0983a9b157599560144c49c82dbe5fe729e1c1 Mon Sep 17 00:00:00 2001 From: Danilo Vidal Date: Fri, 11 Nov 2022 23:33:37 -0300 Subject: [PATCH 08/12] add get estado-pais --- src/main/java/com/devopsusach2020/rest/RestData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/devopsusach2020/rest/RestData.java b/src/main/java/com/devopsusach2020/rest/RestData.java index 99b9ced7..df7b1cb6 100644 --- a/src/main/java/com/devopsusach2020/rest/RestData.java +++ b/src/main/java/com/devopsusach2020/rest/RestData.java @@ -34,7 +34,7 @@ public class RestData { int death = 0; int recovered = 0; Gson gson = new Gson(); - Pais[] estados = gson. fromJson(call.getBody().toLowerCase(), Pais[].class); + Pais[] estados = gson. fromJson(call.getBody().toLowerCase(), Pais[].class); for(Pais estado : estados) { response.setDate(estado.getDate()); From d9b5140b47c1bd927c5ff86369d37a04d4ea7090 Mon Sep 17 00:00:00 2001 From: Danilo Vidal Date: Fri, 11 Nov 2022 23:36:31 -0300 Subject: [PATCH 09/12] add branch jenkisfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2571f4ff..60d744ef 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { stage('Build'){ steps{ echo 'Building...' - slackSend color: "warning", message: "Building..." + slackSend color: "warning", message: "Building... branch: ${GIT_BRANCH}" sh './mvnw clean compile -e' } From 2b5cc30354a40d85ead31e2f908147bc3ba03b45 Mon Sep 17 00:00:00 2001 From: Danilo Vidal Date: Sat, 12 Nov 2022 00:30:39 -0300 Subject: [PATCH 10/12] add get estado mundial --- .../java/com/devopsusach2020/rest/RestData.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/com/devopsusach2020/rest/RestData.java b/src/main/java/com/devopsusach2020/rest/RestData.java index df7b1cb6..b7e1e238 100644 --- a/src/main/java/com/devopsusach2020/rest/RestData.java +++ b/src/main/java/com/devopsusach2020/rest/RestData.java @@ -51,4 +51,21 @@ public class RestData { response.setMensaje("ok"); return response; } + +@GetMapping (path = "/estadoMundial", produces = MediaType. APPLICATION_JSON_VALUE) + public @ResponseBody Mundial getTotalMundial(){ + + LOGGER.log(Level.INFO, "Consulta mundial"); + + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity call= restTemplate.getForEntity("https://api.covid19api.com/world/total", String.class); + Mundial response = new Mundial(); + Gson gson = new Gson(); + Mundial estado = gson.fromJson(call.getBody().toLowerCase(), Mundial.class); + response.setTotalConfirmed(estado.getTotalConfirmed()); + response.setTotalDeaths(estado.getTotalDeaths()); + response.setTotalRecovered(estado.getTotalRecovered()); + return response; +} + } From 70fc7e292279eb946c24c0065e404f542199c8e9 Mon Sep 17 00:00:00 2001 From: Oscar Reyes Hevia Date: Mon, 28 Nov 2022 23:42:30 -0300 Subject: [PATCH 11/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 43fbe323..3e52a329 100644 --- a/README.md +++ b/README.md @@ -43,4 +43,4 @@ # Uso - Agregar archivo **_Jenkinsfile_** en la ra铆z de la rama del proyecto a procesar (s贸lo como pivote al c贸digo del pipeline). - Registrar Pipeline en **_Jenkins -> Administrar Jenkins -> Configuraci贸n Global -> Global Pipeline Libraries_** bajo el nombre **_pipeline_** -- Configurar _Multibranch Pipeline Job_ o _Pipeline Job_ en Jenkins con el repositorio del proyecto a procesar..... +- Configurar _Multibranch Pipeline Job_ o _Pipeline Job_ en Jenkins con el repositorio del proyecto a procesar... From 3a8665ab1081b587f4817a67cc09d2ab784ea93c Mon Sep 17 00:00:00 2001 From: Oscar Reyes Hevia Date: Mon, 28 Nov 2022 23:51:32 -0300 Subject: [PATCH 12/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 43fbe323..9b67037b 100644 --- a/README.md +++ b/README.md @@ -43,4 +43,4 @@ # Uso - Agregar archivo **_Jenkinsfile_** en la ra铆z de la rama del proyecto a procesar (s贸lo como pivote al c贸digo del pipeline). - Registrar Pipeline en **_Jenkins -> Administrar Jenkins -> Configuraci贸n Global -> Global Pipeline Libraries_** bajo el nombre **_pipeline_** -- Configurar _Multibranch Pipeline Job_ o _Pipeline Job_ en Jenkins con el repositorio del proyecto a procesar..... +- Configurar _Multibranch Pipeline Job_ o _Pipeline Job_ en Jenkins con el repositorio del proyecto a procesar.