Skip to content

Commit

Permalink
use python 3.11 for jjb
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed May 10, 2024
1 parent 3bb3119 commit 55e817e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions theforeman.org/pipelines/infra/updateJobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ pipeline {
]
])

virtEnv('jjb-venv', 'pip install pbr')
virtEnv('jjb-venv', 'pip install -r requirements.txt')
virtEnv('jjb-venv', 'pip install pbr', '3.11')
virtEnv('jjb-venv', 'pip install -r requirements.txt', '3.11')
}
}

stage('Update ci.theforeman.org jobs') {
steps {
withCredentials([usernamePassword(credentialsId: 'theforeman-jenkins', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
virtEnv('jjb-venv', "cd ./theforeman.org && REQUESTS_CA_BUNDLE=/etc/pki/tls/cert.pem jenkins-jobs --conf ./foreman_jenkins.ini --user ${env.USERNAME} --password '${env.PASSWORD}' update --delete-old -r .")
virtEnv('jjb-venv', "cd ./theforeman.org && REQUESTS_CA_BUNDLE=/etc/pki/tls/cert.pem jenkins-jobs --conf ./foreman_jenkins.ini --user ${env.USERNAME} --password '${env.PASSWORD}' update --delete-old -r .", '3.11')
}
}
}

stage('Update jenkins-foreman.apps.ocp.cloud.ci.centos.org jobs') {
steps {
withCredentials([usernamePassword(credentialsId: 'centos-jenkins-openshift-cloud', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
virtEnv('jjb-venv', "cd ./centos.org && REQUESTS_CA_BUNDLE=/etc/pki/tls/cert.pem jenkins-jobs --conf ./centos_jenkins.ini --user ${env.USERNAME} --password '${env.PASSWORD}' update --delete-old -r ./jobs")
virtEnv('jjb-venv', "cd ./centos.org && REQUESTS_CA_BUNDLE=/etc/pki/tls/cert.pem jenkins-jobs --conf ./centos_jenkins.ini --user ${env.USERNAME} --password '${env.PASSWORD}' update --delete-old -r ./jobs", '3.11')
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions theforeman.org/pipelines/lib/virtualEnv.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
def virtEnv(path, command) {
def virtEnv(path, command, python=null) {
if(!fileExists("${path}/bin/activate")) {
sh "virtualenv ${path}"
if(python) {
cmd = "python${python}"
} else {
cmd = "python3"
}
sh "${cmd} -m venv ${path}"
}

sh """
Expand Down

0 comments on commit 55e817e

Please sign in to comment.