Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to JAVA 21 + SpringBoot 3.3.0 #26

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1c3c423
Update to JAVA 21 + SpringBoot 3.3.0
wcaquino Jun 4, 2024
e77a652
Fix server port value
wcaquino Jun 4, 2024
e519d54
Add final name
wcaquino Jun 4, 2024
8ded819
Add final name
wcaquino Jun 4, 2024
3e34e40
Fix package name
wcaquino Jun 4, 2024
edb4fbe
Following name patterns
wcaquino Jun 4, 2024
0790a0f
Add final name
wcaquino Jun 4, 2024
258ab29
Testes unitários da aplicação
wcaquino Jun 6, 2024
0315a83
adicionando erro
wcaquino Jun 10, 2024
8c848e7
retirando erro
wcaquino Jun 10, 2024
15f45fc
Error message
wcaquino Jun 23, 2024
5dbe44c
acertando jacoco
wcaquino Jul 9, 2024
6a3e52d
acertando jacoco
wcaquino Jul 9, 2024
429dd00
acertando jacoco
wcaquino Jul 9, 2024
616027f
Adicionando Jenkinsfile
wcaquino Jul 19, 2024
a7c97e4
Adicionando Jenkinsfile
wcaquino Jul 19, 2024
a39814d
pipeline evol
wcaquino Jul 19, 2024
c69a874
pipeline evol
wcaquino Jul 19, 2024
9a63620
pipeline evol
wcaquino Jul 19, 2024
bae7a53
pipeline evol
wcaquino Jul 19, 2024
51b1fda
pipeline evol
wcaquino Jul 19, 2024
e24444a
pipeline evol
wcaquino Jul 19, 2024
5d84d5b
pipeline evol
wcaquino Jul 19, 2024
97bae7c
pipeline evol
wcaquino Jul 20, 2024
eed4b6a
pipeline evol
wcaquino Jul 20, 2024
e750775
pipeline evol
wcaquino Jul 20, 2024
f037184
pipeline evol
wcaquino Jul 20, 2024
37a1bac
pipeline evol
wcaquino Jul 20, 2024
15edcd8
pipeline evol
wcaquino Jul 20, 2024
692270e
pipeline evol
wcaquino Jul 20, 2024
4e0baac
pipeline evol
wcaquino Jul 20, 2024
d9fdc6f
pipeline evol
wcaquino Jul 20, 2024
464f7b6
pipeline evol
wcaquino Jul 20, 2024
e4e4505
pipeline evol
wcaquino Jul 20, 2024
52689f3
pipeline evol
wcaquino Jul 20, 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
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
Expand All @@ -26,7 +26,8 @@ target/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
**/.DS_Store
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM tomcat:10.1.24-jdk21

ARG WAR_FILE
ARG CONTEXT

COPY ${WAR_FILE} /usr/local/tomcat/webapps/${CONTEXT}.war
78 changes: 78 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
pipeline {
agent any
stages {
stage('Build Backend') {
steps {
bat 'mvn clean package -DskipTests=true'
}
}
stage('Unit Tests') {
steps {
bat 'mvn test jacoco:report'
}
}
stage('Sonar Analysis') {
environment {
scannerHome = tool 'SONAR_SCANNER'
}
steps {
withSonarQubeEnv('SONAR_LOCAL') {
bat "${scannerHome}/bin/sonar-scanner -e -Dsonar.projectKey=DeployBack -Dsonar.projectName='DeployBack' -Dsonar.host.url=http://localhost:9000 -Dsonar.token=sqp_6e351c42da66a5d11418912d112c46ea217fe6a6 -Dsonar.java.binaries=target -Dsonar.sources=src/main -Dsonar.tests=src/test -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml -Dsonar.coverage.exclusions=**/model/**,**TaskBackendApplication.java"
}
}
}
stage('Quality Gate') {
steps {
bat 'echo skipping...'
// sleep(10)
// timeout(time: 1, unit: 'MINUTES') {
// waitForQualityGate abortPipeline: true
// }
}
}
stage('Deploy Backend') {
steps {
deploy adapters: [tomcat9(credentialsId: 'tomcat_login', path: '', url: 'http://localhost:8001/')], contextPath: 'tasks-backend', war: 'target/tasks-backend.war'
}
}
stage('API Test') {
steps {
dir('api-test') {
git credentialsId: 'gmail_wcaquino', url: 'https://github.com/wcca2024/tasks-api-test'
bat 'mvn test'
}
}
}
stage('Deploy Frontend') {
steps {
dir('frontend') {
git credentialsId: 'gmail_wcaquino', url: 'https://github.com/wcca2024/tasks-frontend'
bat 'mvn clean package'
deploy adapters: [tomcat9(credentialsId: 'tomcat_login', path: '', url: 'http://localhost:8001/')], contextPath: 'tasks', war: 'target/tasks.war'
}
}
}
stage('Functional Test') {
steps {
dir('functional-test') {
git credentialsId: 'gmail_wcaquino', url: 'https://github.com/wcca2024/tasks-functional-tests'
bat 'mvn test'
}
}
}
stage('Deploy Prod') {
steps {
bat 'docker-compose build'
bat 'docker-compose up -d'
}
}
stage('Health Check') {
steps {
sleep(10)
dir('functional-test') {
bat 'mvn verify -Dskip.surefire.tests'
}
}
}
}
}
61 changes: 61 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
services:
db:
container_name: pg-prod
image: postgres:16.3
networks:
- prod_net_back
environment:
- POSTGRES_PASSWORD=passwd
- POSTGRES_DB=tasks
volumes:
- prod_postgresql:/var/lib/postgresql
- prod_postgresql_data:/var/lib/postgresql/data

backend:
container_name: backend-prod
image: back_prod:build_${BUILD_NUMBER}
build:
context: .
args:
- WAR_FILE=target/tasks-backend.war
- CONTEXT=tasks-backend
networks:
- prod_net_back
- prod_net_front
#ports:
# - 9998:8080
environment:
- DATABASE_HOST=db
- DATABASE_PORT=5432
- DATABASE_USER=postgres
- DATABASE_PASSWD=passwd
#- DATABASE_UPDATE=none
depends_on:
- db

frontend:
container_name: frontend-prod
image: front_prod:build_${BUILD_NUMBER}
build:
context: .
args:
- WAR_FILE=frontend/target/tasks.war
- CONTEXT=tasks
networks:
- prod_net_front
ports:
- 9999:8080
environment:
- BACKEND_HOST=backend
- BACKEND_PORT=8080
- APP_VERSION=build_${BUILD_NUMBER}
#depends_on:
# - backend

networks:
prod_net_front:
prod_net_back:

volumes:
prod_postgresql:
prod_postgresql_data:
Loading