Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
79e4b8c
Primere pipeline
altheus26 May 5, 2024
e964ee0
Delete src/.github/workflows directory
altheus26 May 5, 2024
fda89a1
Pipeline ahora si
altheus26 May 5, 2024
6888e14
Cambio java 8
altheus26 May 5, 2024
8ed9737
gradle agregado
altheus26 May 5, 2024
9f53380
compilar con maven
altheus26 May 5, 2024
05a5370
Probando pruebas unitarias
altheus26 May 5, 2024
0f3d389
Cambiando mensaje de GreetingService
altheus26 May 5, 2024
3ef54ac
Update HomeController.java: cambio mensaje
altheus26 May 5, 2024
0c2931e
Update pipeline-ci.yml
altheus26 May 5, 2024
6089f23
Jacoco Plugin maven
altheus26 May 5, 2024
e25ee17
test con jacoco
altheus26 May 5, 2024
c0d474f
Update pom.xml jacoco config
altheus26 May 5, 2024
e2d3969
Update pom.xml
altheus26 May 5, 2024
b1b6d20
Agregadas dependencias jacoco
altheus26 May 5, 2024
e713d5b
actualizada version
altheus26 May 5, 2024
3c5dcf5
Update pipeline-ci.yml
altheus26 May 5, 2024
b64dd4c
jacoco otra vez
altheus26 May 5, 2024
ccb0bcb
jacoco otra vez
altheus26 May 5, 2024
8bf7b33
Update pom.xml
altheus26 May 5, 2024
5ef52d3
Update pom.xml
altheus26 May 5, 2024
780037b
jacoco 12
altheus26 May 5, 2024
50140f1
dependencia
altheus26 May 5, 2024
eb0ad98
umbral
altheus26 May 5, 2024
67d835b
Update pom.xml counter line
altheus26 May 5, 2024
826a080
mvn clean package
altheus26 May 5, 2024
04541ab
Agregado config default Jacoco
altheus26 May 5, 2024
1346b35
probando jacoco action
altheus26 May 5, 2024
3d52506
Update pom.xml
altheus26 May 5, 2024
3887222
Update pom.xml
altheus26 May 5, 2024
5197c37
Jacoco otra vez
altheus26 May 5, 2024
d84c5ba
propiedades actualizadas
altheus26 May 5, 2024
3915649
fix
altheus26 May 5, 2024
1b166a7
Update pom.xml
altheus26 May 5, 2024
e6e5e43
versión jacoco
altheus26 May 5, 2024
f841cb2
Update pom.xml
altheus26 May 5, 2024
29a868b
Update pom.xml
altheus26 May 5, 2024
d445430
Update pom.xml
altheus26 May 5, 2024
aff38f9
Update pom.xml
altheus26 May 5, 2024
9edc95c
Update pipeline-ci.yml
altheus26 May 5, 2024
265d696
Update pom.xml
altheus26 May 5, 2024
f914cb7
Update pom.xml
altheus26 May 5, 2024
9862c9a
Update pom.xml
altheus26 May 5, 2024
61b3bd2
jacoco
altheus26 May 5, 2024
2285c2f
Probando
altheus26 May 5, 2024
537db3d
Probando 2
altheus26 May 5, 2024
b77c214
Probando reporte
altheus26 May 5, 2024
52e20da
pom actualizado
altheus26 May 5, 2024
cc9dcfa
probando jacoco
altheus26 May 5, 2024
3a2c98e
Modificando mensaje
altheus26 May 5, 2024
3329dd8
revisando cosas
altheus26 May 5, 2024
c850c5a
Actualizado plugin
altheus26 May 5, 2024
2667066
surefire
altheus26 May 5, 2024
3487b8b
surefire test
altheus26 May 5, 2024
48508ca
teting
altheus26 May 5, 2024
b873bf7
Update pom.xml
altheus26 May 5, 2024
fed22a7
probando
altheus26 May 5, 2024
c49dbeb
Update pom.xml
altheus26 May 5, 2024
af83485
version
altheus26 May 5, 2024
5dca2f6
Update pipeline-ci.yml
altheus26 May 5, 2024
56390d8
probando
altheus26 May 5, 2024
b762634
Update HomeController.java
altheus26 May 5, 2024
bc2321f
probando otra vez
altheus26 May 5, 2024
cd93834
arggline
altheus26 May 5, 2024
b43dd6f
jacoco report
altheus26 May 5, 2024
7a6f3b7
Update HomeController.java
altheus26 May 5, 2024
d591df9
Update pom.xml
altheus26 May 5, 2024
ace12e5
Update pom.xml
altheus26 May 5, 2024
c71f7b9
Update pom.xml
altheus26 May 5, 2024
b80e0e6
Update pom.xml
altheus26 May 5, 2024
8f067a5
0.10
altheus26 May 5, 2024
d0574d7
0.0
altheus26 May 5, 2024
b874c09
jacoco report
altheus26 May 5, 2024
3c793c2
subir reporte jacoco
altheus26 May 5, 2024
f2e9ad6
jacoco report
altheus26 May 5, 2024
242458b
Analisis Sonar Cloud
altheus26 May 5, 2024
21b1873
Modificando mensaje
altheus26 May 5, 2024
19d9302
Prueba cobertura 85
altheus26 May 5, 2024
2f447b8
Prueba cobertura: Umbral cambiado a 0%
altheus26 May 5, 2024
d6b2d5c
Creando error variable
altheus26 May 5, 2024
03e3814
Creando variable password
altheus26 May 5, 2024
d1a5c54
Variable bloqueante
altheus26 May 5, 2024
e81d602
Probando sonar quality gate
altheus26 May 5, 2024
5e1c88d
Sonar quality
altheus26 May 5, 2024
f5adfb3
Crear DockerFile
altheus26 May 6, 2024
5501f89
Docker Deploy
altheus26 May 6, 2024
302601b
Cambio java
altheus26 May 6, 2024
2cfae85
Deploy en runer local
altheus26 May 6, 2024
72f5629
Deploy Kubernetes
altheus26 May 6, 2024
ae5c404
Deploy Kubernetes Local
altheus26 May 6, 2024
b13c06c
Deploy kubernet local runer
altheus26 May 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/pipeline-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clonar repo
uses: actions/checkout@v4

- name: Setup Java JDK
uses: actions/setup-java@v4.2.1
with:
java-version: '8'
distribution: 'temurin'


# - name: Compilar codigo
# run: |
# mvn clean package
- name: Compilar y Testing
run: |
mvn clean package jacoco:report

- name: Cargar reportes Jacoco como
uses: actions/upload-artifact@v4.3.3
with:
name: Reporte Jacoco
path: target/site/jacoco/index.html


# - name: Pruebas Unitarias
# run: mvn test

- name: Setup Java JDK 17
uses: actions/setup-java@v4.2.1
with:
java-version: '17'
distribution: 'temurin'

- name: Analisis SonarCloud
run: |
mvn clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922:sonar \
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=devops-lab-final \
-Dsonar.projectKey=devOps-lab-final_microservicio-java

- name: SonarQube Quality Gate check
uses: sonarsource/sonarqube-quality-gate-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
scanMetadataReportFile: target/sonar/report-task.txt

- name: Docker Login
uses: docker/login-action@v3.1.0
with:
username: estebanignacio
password: ${{secrets.DOCKER_PASS}}

- name: Set Up Docker
uses: docker/setup-buildx-action@v3

- name: Docker build
run: |
docker build -t estebanignacio/microservicio-java:latest .
- name: Docker push
run: |
docker push estebanignacio/microservicio-java:latest

deploy:
needs: build
runs-on: self-hosted
steps:
- name: Clonar repo
uses: actions/checkout@v4

- name: Despliegue
run: |
kubectl apply -f deploy.yaml



5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM openjdk:8-jdk-alpine
EXPOSE 8080
ARG JAR_FILE=target/*.jar
ADD ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
20 changes: 20 additions & 0 deletions deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: microservicio-java
spec:
replicas: 3
selector:
matchLabels:
app: microservicio-java
template:
metadata:
labels:
app: microservicio-java
spec:
containers:
- name: microservicio-java
image: estebanignacio/microservicio-java:latest
ports:
- containerPort: 8080

86 changes: 83 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
</dependency>

</dependencies>

<build>
Expand All @@ -37,7 +49,75 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-report-integration</id>
<goals>
<goal>report-integration</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.0</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.16</version>
<executions>
<execution>
<id>default-integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
3 changes: 2 additions & 1 deletion src/main/java/com/example/testingweb/GreetingService.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@Service
public class GreetingService {
public String greet() {
return "Hello, World";
String password = "12345";
return "Hola, soy Esteban Espinoza";
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/example/testingweb/HomeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class HomeController {

@RequestMapping("/")
public @ResponseBody String greeting() {
return "Hello, World";
return "Hola , Soy Esteban Espinoza";
}

}