Skip to content
Snippets Groups Projects
Commit 40e1e4c1 authored by OZG-Cloud Team's avatar OZG-Cloud Team
Browse files

OZG-3140 run on new jenkins

parent efa0dddc
No related branches found
No related tags found
No related merge requests found
pipeline { pipeline {
agent { agent {
node { node {
label 'jenkins-worker' label 'jenkins-build-agent'
} }
} }
...@@ -60,21 +60,19 @@ pipeline { ...@@ -60,21 +60,19 @@ pipeline {
script { script {
FAILED_STAGE=env.STAGE_NAME FAILED_STAGE=env.STAGE_NAME
} }
container("maven-17"){ configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { sh 'mvn --version'
sh 'mvn --version' sh 'mvn -s $MAVEN_SETTINGS clean install spring-boot:build-image -Dmaven.wagon.http.retryHandler.count=3'
sh 'mvn -s $MAVEN_SETTINGS clean install spring-boot:build-image -Dmaven.wagon.http.retryHandler.count=3'
script { script {
try { try {
if (env.BRANCH_NAME == 'master') { if (env.BRANCH_NAME == 'master') {
withSonarQubeEnv('sonarqube-ozg-sh'){ withSonarQubeEnv('sonarqube-ozg-sh'){
sh 'mvn -s $MAVEN_SETTINGS sonar:sonar' sh 'mvn -s $MAVEN_SETTINGS sonar:sonar'
}
} }
} catch (Exception e) { }
unstable("SonarQube failed") } catch (Exception e) {
} unstable("SonarQube failed")
} }
} }
} }
...@@ -97,10 +95,8 @@ pipeline { ...@@ -97,10 +95,8 @@ pipeline {
script { script {
FAILED_STAGE = env.STAGE_NAME FAILED_STAGE = env.STAGE_NAME
} }
container('maven-17') { configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { sh 'mvn -s $MAVEN_SETTINGS -DskipTests deploy'
sh 'mvn -s $MAVEN_SETTINGS -DskipTests deploy'
}
} }
} }
} }
...@@ -128,20 +124,18 @@ pipeline { ...@@ -128,20 +124,18 @@ pipeline {
stage('Test, build and deploy Helm Chart') { stage('Test, build and deploy Helm Chart') {
steps { steps {
container('k8s') { script {
script { FAILED_STAGE=env.STAGE_NAME
FAILED_STAGE=env.STAGE_NAME HELM_CHART_VERSION = generateHelmChartVersion()
HELM_CHART_VERSION = generateHelmChartVersion()
dir('src/main/helm') { dir('src/main/helm') {
sh "helm lint -f test-values.yaml" sh "helm lint -f test-values.yaml"
sh "helm unittest -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' ." sh "helm unittest -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' ."
sh "helm package --version=${HELM_CHART_VERSION} ." sh "helm package --version=${HELM_CHART_VERSION} ."
deployHelmChart(HELM_CHART_VERSION) deployHelmChart(HELM_CHART_VERSION)
}
} }
} }
} }
...@@ -293,13 +287,11 @@ Void checkoutProvisioningRepo() { ...@@ -293,13 +287,11 @@ Void checkoutProvisioningRepo() {
} }
Void tagAndPushDockerImage(String imageName, String newTag){ Void tagAndPushDockerImage(String imageName, String newTag){
container("docker") { withCredentials([usernamePassword(credentialsId: 'jenkins-docker-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) {
withCredentials([usernamePassword(credentialsId: 'jenkins-docker-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { sh 'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}'
sh 'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}'
sh "docker tag docker.ozg-sh.de/${imageName}:build-latest docker.ozg-sh.de/${imageName}:${newTag}" sh "docker tag docker.ozg-sh.de/${imageName}:build-latest docker.ozg-sh.de/${imageName}:${newTag}"
sh "docker push docker.ozg-sh.de/${imageName}:${newTag}" sh "docker push docker.ozg-sh.de/${imageName}:${newTag}"
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment