This commit is contained in:
2026-05-07 18:57:09 +09:30
parent 80d0502608
commit f115787ef6
Vendored
+15 -45
View File
@@ -36,20 +36,12 @@ pipeline {
stages {
stage('Build Java & Frontend') {
agent {
docker {
image 'eclipse-temurin:21-jdk'
args '--network=host'
}
}
agent any
steps {
script {
echo "Building Java and Frontend..."
}
sh '''
apt-get update && apt-get install -y curl
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
chmod +x ./gradlew
./gradlew clean build -x test --build-cache
'''
@@ -62,12 +54,7 @@ pipeline {
}
stage('Run Unit Tests') {
agent {
docker {
image 'eclipse-temurin:21-jdk'
args '--network=host'
}
}
agent any
steps {
script {
echo "Running unit tests..."
@@ -80,11 +67,6 @@ pipeline {
post {
always {
junit 'backend/build/test-results/test/**/*.xml'
publishHTML([
reportDir: 'backend/build/reports',
reportFiles: 'index.html',
reportName: 'Test Report'
])
}
}
}
@@ -100,12 +82,7 @@ pipeline {
anyOf {
branch 'main'
branch 'develop'
branch 'master'
}
}
steps {
script {
echo "Running integration tests..."
any echo "Running integration tests..."
}
sh '''
chmod +x ./gradlew
@@ -125,12 +102,7 @@ pipeline {
image 'eclipse-temurin:21-jdk'
args '--network=host'
}
}
when {
changeRequest()
}
steps {
script {
}any script {
echo "Running code quality checks..."
}
sh '''
@@ -152,6 +124,11 @@ pipeline {
args '--network=host'
}
}
when {
anyOf {
changeRequest()
branch 'main'
any
when {
anyOf {
changeRequest()
@@ -165,17 +142,10 @@ pipeline {
echo "Running SonarQube analysis..."
}
withSonarQubeEnv('SonarQube') {
sh 'gradle sonar'
}
}
post {
failure {
echo "SonarQube analysis failed - continuing pipeline with warning"
}
}
}
stage('Build Docker Image') {
sh '''
chmod +x ./gradlew
./gradlew sonar
''{
agent {
docker {
image 'docker:latest'
@@ -187,7 +157,7 @@ pipeline {
branch 'main'
branch 'develop'
branch 'master'
tag "*"
buildingTag()
}
}
steps {
@@ -233,7 +203,7 @@ pipeline {
branch 'main'
expression { params.DEPLOY_TO_PRODUCTION == true }
}
tag "*"
buildingTag()
}
}
steps {