Update Jenkinsfile

This commit is contained in:
2025-05-22 11:28:03 +03:00
parent 18384e1f54
commit 1f12881a90

24
Jenkinsfile vendored
View File

@@ -66,45 +66,31 @@ spec:
} }
} }
stages{ stages{
stage('Get source code') {
steps {
container('maven') {
sh 'git clone https://git.konsthol.eu/konsthol/example-app appsource'
}
}
}
stage('Prepare source code') {
steps {
container('maven') {
sh 'mvn io.quarkus.platform:quarkus-maven-plugin:3.22.1:create -DprojectGroupId=com.example -DprojectArtifactId=example-app -DclassName=Example -Dextensions="resteasy-reactive,helm"'
}
}
}
stage('Make jar') { stage('Make jar') {
steps { steps {
container('maven') { container('maven') {
sh 'cd example-app && mvn install -DskipTests' sh 'mvn install -DskipTests'
} }
} }
} }
stage('Change values.yaml to nexus') { stage('Change values.yaml to nexus') {
steps { steps {
container('maven') { container('maven') {
sh 'sed -i "s|docker.io/root/example-app:1.0.0-SNAPSHOT|$NEXUS_URL|g" example-app/target/helm/kubernetes/example-app/values.yaml' sh 'sed -i "s|docker.io/root/example-app:1.0.0-SNAPSHOT|$NEXUS_URL|g" target/helm/kubernetes/example-app/values.yaml'
} }
} }
} }
stage('Make chart') { stage('Make chart') {
steps { steps {
container('helm') { container('helm') {
sh 'cd example-app && helm package target/helm/kubernetes/example-app' sh 'helm package target/helm/kubernetes/example-app'
} }
} }
} }
stage('Upload chart') { stage('Upload chart') {
steps { steps {
container('maven') { container('maven') {
sh 'cd example-app && curl -u admin:$NEXUS_PASS --upload-file example-app-1.0.0-SNAPSHOT.tgz $NEXUS_URL' sh 'curl -u admin:$NEXUS_PASS --upload-file example-app-1.0.0-SNAPSHOT.tgz $NEXUS_URL'
} }
} }
} }
@@ -118,7 +104,7 @@ spec:
stage('Docker build in Docker') { stage('Docker build in Docker') {
steps { steps {
container('docker') { container('docker') {
sh 'docker build -t example-app -f /home/jenkins/agent/workspace/example-pipeline/appsource/Dockerfile example-app/target' sh 'docker build -t example-app -f ./Dockerfile target'
} }
} }
} }