Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Remove OpenShift related code
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigonull committed Jan 10, 2024
1 parent cd959e5 commit 63e6e05
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 291 deletions.
132 changes: 21 additions & 111 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@Library('jenkins-pipeline-shared-libraries')_

helper = null
testsFailed = false

gitChanges = false

pipeline {
Expand Down Expand Up @@ -54,10 +52,6 @@ pipeline {
assert helper.getBuildBranch() == util.getReleaseBranchFromVersion(helper.getProjectVersion())
}
}

// Verify we have the connectivity to Openshift
// TODO: Uncomment this line when we have the Openshift credentials
//openshift.loginOpenshift()
}
}
post {
Expand Down Expand Up @@ -107,7 +101,6 @@ pipeline {
}
}


stage('Setup Minikube') {
steps {
script {
Expand Down Expand Up @@ -143,7 +136,7 @@ pipeline {

stage('Build Kogito Operator') {
steps {
sh "source ~/virtenvs/cekit/bin/activate && make BUILDER=${env.CONTAINER_ENGINE}"
sh "make BUILDER=${env.CONTAINER_ENGINE}"
}
post {
unsuccessful {
Expand Down Expand Up @@ -171,6 +164,15 @@ pipeline {
}
}
}

stage('Install Ansible') {
steps {
script {
installAnsible()
}
}
}

stage('Run OLM tests') {
when {
expression {
Expand All @@ -189,55 +191,6 @@ pipeline {
}
}

stage('Push Operator Image to Openshift Registry') {
steps {
script {
echo 'Skipping pushing operator image to Openshift registry'
//container.loginOpenshiftRegistry()
//container.tagImage("quay.io/kiegroup/${env.OPERATOR_IMAGE_NAME}:${getOperatorVersion()}",
//helper.buildTempOpenshiftImageFullName())
//container.pushImage(helper.buildTempOpenshiftImageFullName())
}
}
}

stage('Run BDD tests') {
when {
beforeOptions true
expression {
return helper.shouldLaunchTests()
}
}
stages {
stage('Run full testing') {
options {
timeout(time: 360, unit: 'MINUTES')
}
steps {
script {
// Catch and set unstable so the temp image is still pushed and we get the deployment properties,
// in case we decide to continue in the release
try {
sh "make run-tests timeout=360 load_factor=2 concurrent=2 smoke=${params.SMOKE_TESTS_ONLY} ${getBDDParameters()}"
} catch (err) {
testsFailed = true
util.archiveConsoleLog()
}
}
}
post {
always {
archiveArtifacts artifacts: 'test/logs/**/*.log', allowEmptyArchive: false
junit testResults: 'test/logs/**/junit.xml', allowEmptyResults: false
}
cleanup {
sh 'cd test && go run scripts/prune_namespaces.go'
}
}
}
}
}

stage('Push to registry') {
when {
expression { return !params.SKIP_DEPLOY }
Expand Down Expand Up @@ -301,11 +254,6 @@ pipeline {
script {
properties.writeToFile(env.PROPERTIES_FILE_NAME)
archiveArtifacts(artifacts: env.PROPERTIES_FILE_NAME)

// Verify here if BDD tests due to test errors or build error
if (testsFailed && currentBuild.currentResult == 'SUCCESS') {
error 'There was a test execution failure'
}
}
}
unsuccessful {
Expand All @@ -328,53 +276,15 @@ void sendNotification() {
}
}

String getOperatorVersion() {
return sh(script: 'source ./hack/env.sh > /dev/null && echo $(getOperatorVersion)', returnStdout: true).trim()
}

// Special method to get the Openshift API in the lock because env is not accessible yet
void getLockOpenshiftApi() {
withCredentials([string(credentialsId: 'OPENSHIFT_API', variable: 'OPENSHIFT_API')]) {
return env.OPENSHIFT_API
}
}

////////////////////////////////////////////////////////////////////////
// BDD parameters

String getBDDParameters() {
Map testParamsMap = helper.getBDDCommonParameters(true)

testParamsMap.putAll(helper.getBDDBuildImageParameters('KOGITO_IMAGES'))
testParamsMap.putAll(helper.getBDDServicesImageParameters('KOGITO_IMAGES'))

testParamsMap['image_cache_mode'] = params.EXAMPLES_IMAGES_CACHE_MODE
testParamsMap.putAll(helper.getBDDRuntimeImageParameters('EXAMPLES_IMAGES'))

// Add tags
def tags = []
if (params.BDD_TEST_TAGS) {
tags.add(params.BDD_TEST_TAGS)
}
if (params.SKIP_NATIVE_TESTS) {
tags.add("~${helper.getNativeTag()}")
}
if (params.SKIP_NON_NATIVE_TESTS) {
tags.add("~${helper.getNonNativeTag()}")
}
testParamsMap['tags'] = tags.join('&&')

String testParams = testParamsMap.findAll { entry -> entry.getValue() }
.collect { entry -> "${entry.getKey()}=\"${entry.getValue()}\"" }.join(' ')
echo "BDD parameters = ${testParams}"
return testParams
}

void setupMinikube() {
// Start minikube
minikube.minikubeMemory = '12g'
minikube.start()

minikube.waitForMinikubeStarted()
minikube.waitForMinikubeRegistry()
// TODO: move this to the kogito-ci-build image
void installAnsible() {
sh '''
export TZ=America/New_York
sudo ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
echo $TZ | sudo tee /etc/timezone
sudo apt install -y software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt update
sudo apt install -y ansible
'''
}
121 changes: 0 additions & 121 deletions .ci/jenkins/scripts/minikube.groovy

This file was deleted.

59 changes: 0 additions & 59 deletions hack/ci/install-minikube.sh

This file was deleted.

0 comments on commit 63e6e05

Please sign in to comment.