Skip to content

Commit

Permalink
[KOGITO-2437] - Migarate namespace-cleaning job to rhba jenkins (apac…
Browse files Browse the repository at this point in the history
…he#37)

See: https://issues.redhat.com/browse/KOGITO-2437

Signed-off-by: Mauricio Magnani <mmagnani@redhat.com>

Co-authored-by: Mauricio Magnani <mmagnani@redhat.com>
  • Loading branch information
msmagnanijr and mmagnanijr committed Jun 23, 2020
1 parent b1e8cf8 commit ba60e80
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion clean-old-namespaces-Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
pipeline{
agent {label 'operator-slave'}
agent {label 'kogito-cloud && !master'}
triggers {
cron('@midnight')
}
environment {
OPENSHIFT_API = credentials("OPENSHIFT_API")
// OPENSHIFT_CREDS => Credentials to access the Openshift cluster. Use in `loginOpenshift()`
}
stages{
stage('Clean Old Namespaces'){
steps{
loginOpenshift()
sh "tools/clean-old-namespaces.sh"
}
}
}
}

void loginOpenshift(){
withCredentials([usernamePassword(credentialsId: "OPENSHIFT_CREDS", usernameVariable: 'OC_USER', passwordVariable: 'OC_PWD')]){
sh "oc login --username=${OC_USER} --password=${OC_PWD} --server=${OPENSHIFT_API} --insecure-skip-tls-verify"
}
}

0 comments on commit ba60e80

Please sign in to comment.