Skip to content
Snippets Groups Projects
Commit 5d48187b authored by Felix Reichenbach's avatar Felix Reichenbach
Browse files

reduce branch name length to 20 character

parent 4f162cbe
No related branches found
No related tags found
1 merge request!3reduce branch name length to 20 characters
......@@ -39,7 +39,7 @@ pipeline {
}
if( !(rootVersion == serverVersion && rootVersion == interfaceVersion )){
error("Versionen sind nicht identisch")
error("Versionen sind nicht identisch")
}
}
}
......@@ -59,7 +59,7 @@ pipeline {
FAILED_STAGE=env.STAGE_NAME
VORGANG_MANAGER_TAG = getPomVersion('pom.xml').replace("SNAPSHOT", "${env.BRANCH_NAME}-SNAPSHOT");
BESCHEID_MANAGER_TAG = getPomVersion('bescheid-manager/pom.xml').replace("SNAPSHOT", "${env.BRANCH_NAME}-SNAPSHOT")
updateDependencyVersions(BESCHEID_MANAGER_TAG, VORGANG_MANAGER_TAG)
}
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
......@@ -70,7 +70,7 @@ pipeline {
}
}
}
stage('Build VorgangManager') {
steps {
script {
......@@ -82,7 +82,7 @@ pipeline {
}
}
}
stage('Deploy to Nexus'){
steps {
script {
......@@ -90,7 +90,7 @@ pipeline {
}
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
sh 'mvn --no-transfer-progress -s $MAVEN_SETTINGS -DskipTests deploy -Dmaven.wagon.http.retryHandler.count=3'
}
}
}
......@@ -114,11 +114,11 @@ pipeline {
steps {
script {
FAILED_STAGE=env.STAGE_NAME
IMAGE_TAG = buildVersionName('pom.xml')
tagAndPushDockerImage('vorgang-manager', IMAGE_TAG)
if (isMainBranch()) {
tagAndPushDockerImage('vorgang-manager', 'snapshot-latest')
tagAndPushDockerImage('vorgang-manager', 'e2e-test')
......@@ -146,7 +146,7 @@ pipeline {
}
}
}
}
}
stage('Trigger Dev rollout') {
when {
......@@ -166,10 +166,10 @@ pipeline {
stage('Trigger Test rollout') {
when {
branch 'release'
}
steps {
script {
}
steps {
script {
FAILED_STAGE = env.STAGE_NAME
cloneGitopsRepo()
......@@ -178,9 +178,9 @@ pipeline {
pushTestGitopsRepo()
}
}
}
}
stage ('Deploy SBOM to DependencyTrack') {
steps {
script {
......@@ -218,7 +218,7 @@ pipeline {
unstable("SonarQube failed")
}
}
dir('vorgang-manager-utils') {
try {
withSonarQubeEnv('sonarqube-ozg-sh'){
......@@ -233,7 +233,7 @@ pipeline {
}
}
}
post {
always{
......@@ -254,7 +254,7 @@ Boolean isReleaseBranch() {
return env.BRANCH_NAME == 'release'
}
void deployHelmChart(String helmChartName, String helmChartVersion) {
void deployHelmChart(String helmChartName, String helmChartVersion) {
withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]){
if (env.BRANCH_NAME == 'release') {
result = sh script: '''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository=ozg-base-apps -F file=@'''+helmChartName+'''-'''+helmChartVersion+'''.tgz''', returnStdout: true
......@@ -270,7 +270,7 @@ void deployHelmChart(String helmChartName, String helmChartVersion) {
}
def validateBranchName(branchName) {
int maxLength = 30
int maxLength = 20
if (branchName.length() > maxLength) {
String originalBranchName = branchName
branchName = branchName.substring(0, maxLength)
......@@ -309,9 +309,9 @@ void updateDependencyVersions(String bescheidManagerSnapshotVersion, String vorg
writeMavenPom model: vorgangManagerServerPom, file: 'vorgang-manager-server/pom.xml'
}
def bescheidManagerServerPom = readMavenPom file: 'bescheid-manager/pom.xml'
if ( bescheidManagerServerPom.properties['vorgang-manager.version'] ==~ SNAPSHOT_REGEX ) {
if ( bescheidManagerServerPom.properties['vorgang-manager.version'] ==~ SNAPSHOT_REGEX ) {
bescheidManagerServerPom.properties['vorgang-manager.version'] = vorgangManagerSnapshotVersion
writeMavenPom model: bescheidManagerServerPom, file: 'bescheid-manager/pom.xml'
writeMavenPom model: bescheidManagerServerPom, file: 'bescheid-manager/pom.xml'
}
}
......@@ -378,7 +378,7 @@ Void sendFailureMessage() {
"body":"VorgangManager: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} Link: ${JENKINS_URL}", \
"format": "org.matrix.custom.html", \
"formatted_body":"VorgangManager: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${JENKINS_URL}'>${env.BUILD_NUMBER}</a>"}"""
if (isMainBranch()) {
room = "!GjqhmouBtnDbwUkAjx:matrix.ozg-sh.de"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment