more
This commit is contained in:
Vendored
+15
-45
@@ -36,20 +36,12 @@ pipeline {
|
|||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Build Java & Frontend') {
|
stage('Build Java & Frontend') {
|
||||||
agent {
|
agent any
|
||||||
docker {
|
|
||||||
image 'eclipse-temurin:21-jdk'
|
|
||||||
args '--network=host'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
echo "Building Java and Frontend..."
|
echo "Building Java and Frontend..."
|
||||||
}
|
}
|
||||||
sh '''
|
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
|
chmod +x ./gradlew
|
||||||
./gradlew clean build -x test --build-cache
|
./gradlew clean build -x test --build-cache
|
||||||
'''
|
'''
|
||||||
@@ -62,12 +54,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Run Unit Tests') {
|
stage('Run Unit Tests') {
|
||||||
agent {
|
agent any
|
||||||
docker {
|
|
||||||
image 'eclipse-temurin:21-jdk'
|
|
||||||
args '--network=host'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
echo "Running unit tests..."
|
echo "Running unit tests..."
|
||||||
@@ -80,11 +67,6 @@ pipeline {
|
|||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
junit 'backend/build/test-results/test/**/*.xml'
|
junit 'backend/build/test-results/test/**/*.xml'
|
||||||
publishHTML([
|
|
||||||
reportDir: 'backend/build/reports',
|
|
||||||
reportFiles: 'index.html',
|
|
||||||
reportName: 'Test Report'
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,12 +82,7 @@ pipeline {
|
|||||||
anyOf {
|
anyOf {
|
||||||
branch 'main'
|
branch 'main'
|
||||||
branch 'develop'
|
branch 'develop'
|
||||||
branch 'master'
|
any echo "Running integration tests..."
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
echo "Running integration tests..."
|
|
||||||
}
|
}
|
||||||
sh '''
|
sh '''
|
||||||
chmod +x ./gradlew
|
chmod +x ./gradlew
|
||||||
@@ -125,12 +102,7 @@ pipeline {
|
|||||||
image 'eclipse-temurin:21-jdk'
|
image 'eclipse-temurin:21-jdk'
|
||||||
args '--network=host'
|
args '--network=host'
|
||||||
}
|
}
|
||||||
}
|
}any script {
|
||||||
when {
|
|
||||||
changeRequest()
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
echo "Running code quality checks..."
|
echo "Running code quality checks..."
|
||||||
}
|
}
|
||||||
sh '''
|
sh '''
|
||||||
@@ -152,6 +124,11 @@ pipeline {
|
|||||||
args '--network=host'
|
args '--network=host'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
when {
|
||||||
|
anyOf {
|
||||||
|
changeRequest()
|
||||||
|
branch 'main'
|
||||||
|
any
|
||||||
when {
|
when {
|
||||||
anyOf {
|
anyOf {
|
||||||
changeRequest()
|
changeRequest()
|
||||||
@@ -165,17 +142,10 @@ pipeline {
|
|||||||
echo "Running SonarQube analysis..."
|
echo "Running SonarQube analysis..."
|
||||||
}
|
}
|
||||||
withSonarQubeEnv('SonarQube') {
|
withSonarQubeEnv('SonarQube') {
|
||||||
sh 'gradle sonar'
|
sh '''
|
||||||
}
|
chmod +x ./gradlew
|
||||||
}
|
./gradlew sonar
|
||||||
post {
|
''{
|
||||||
failure {
|
|
||||||
echo "SonarQube analysis failed - continuing pipeline with warning"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build Docker Image') {
|
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'docker:latest'
|
image 'docker:latest'
|
||||||
@@ -187,7 +157,7 @@ pipeline {
|
|||||||
branch 'main'
|
branch 'main'
|
||||||
branch 'develop'
|
branch 'develop'
|
||||||
branch 'master'
|
branch 'master'
|
||||||
tag "*"
|
buildingTag()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
@@ -233,7 +203,7 @@ pipeline {
|
|||||||
branch 'main'
|
branch 'main'
|
||||||
expression { params.DEPLOY_TO_PRODUCTION == true }
|
expression { params.DEPLOY_TO_PRODUCTION == true }
|
||||||
}
|
}
|
||||||
tag "*"
|
buildingTag()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
|
|||||||
Reference in New Issue
Block a user