Skip to content

Commit

Permalink
Fix specific to release 1.39.x (#140)
Browse files Browse the repository at this point in the history
Tests before update version ...
  • Loading branch information
radtriste authored May 30, 2023
1 parent 85ffe89 commit cf0c3e7
Showing 1 changed file with 27 additions and 48 deletions.
75 changes: 27 additions & 48 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,6 @@ pipeline {
}
}

stage('Update version') {
when {
expression { return helper.getProjectVersion() }
}
steps {
script {
sh "make bump-version new_version=${helper.getProjectVersion()}"

// Commit changes
githubscm.commitChanges(getCommitMessage(), {
sh '''
git add .
git reset -- go.mod
git reset -- go.sum
'''
})
commitDone = true
}
}
}

stage('Test Operator') {
when {
expression {
Expand All @@ -113,9 +92,9 @@ pipeline {
}
}

stage('Build Operator') {
stage('Build Operator for tests') {
steps {
sh "make container-build BUILDER=${env.CONTAINER_ENGINE} IMG=${getBuiltImage()}"
sh "make container-build BUILDER=${env.CONTAINER_ENGINE} IMG=${getBuiltImage('temp')}"
}
post {
unsuccessful {
Expand All @@ -126,28 +105,6 @@ pipeline {
}
}

stage('Prepare for e2e tests') {
when {
expression {
return helper.shouldLaunchTests() && helper.isRelease()
}
}
steps {
script {
// Define specific tests images as those to override defaults
// Because released builder and devmode images are not yet available
String platformCRFile = 'config/samples/sw.kogito_v1alpha08_kogitoserverlessplatform_withCache_minikube.yaml'
String[] versionSplit = getOperatorVersion().split("\\.")
String majorMinor = "${versionSplit[0]}.${versionSplit[1]}"
def platformCR = readYaml(file: platformCRFile)
platformCR.spec.devBaseImage = "quay.io/kiegroup/kogito-swf-devmode-nightly:${majorMinor}"
platformCR.spec.platform.baseImage = "quay.io/kiegroup/kogito-swf-builder-nightly:${majorMinor}"
writeYaml(file: platformCRFile, data: platformCR, overwrite: true)
sh "cat ${platformCRFile}"
}
}
}

stage('Run e2e tests') {
when {
expression {
Expand All @@ -170,7 +127,7 @@ pipeline {

// Push image to minikube
String minikubeImageName = "${minikube.getImageRegistry()}/${env.OPERATOR_IMAGE_NAME}:${getOperatorVersion()}"
container.tagImage(getBuiltImage(), minikubeImageName)
container.tagImage(getBuiltImage('temp'), minikubeImageName)
container.pushImage(minikubeImageName)
sh """
export OPERATOR_IMAGE_NAME=${minikubeImageName}
Expand All @@ -192,6 +149,28 @@ pipeline {
}
}

stage('Update version & Build') {
when {
expression { return helper.getProjectVersion() }
}
steps {
script {
sh "make bump-version new_version=${helper.getProjectVersion()}"
sh "make container-build BUILDER=${env.CONTAINER_ENGINE} IMG=${getBuiltImage()}"

// Commit changes
githubscm.commitChanges(getCommitMessage(), {
sh '''
git add .
git reset -- go.mod
git reset -- go.sum
'''
})
commitDone = true
}
}
}

stage('Push to registry') {
when {
expression { return !params.SKIP_DEPLOY }
Expand Down Expand Up @@ -291,8 +270,8 @@ String getOperatorImageName() {
return sh(script: 'source ./hack/env.sh > /dev/null && echo $(getOperatorImageName)', returnStdout: true).trim()
}

String getBuiltImage() {
return "${getOperatorImageName()}:${getOperatorVersion()}"
String getBuiltImage(String suffix = '') {
return "${getOperatorImageName()}${suffix ? "-${suffix}" : ''}:${getOperatorVersion()}"
}

String getCommitMessage() {
Expand Down

0 comments on commit cf0c3e7

Please sign in to comment.