Olaf Bohlen
2020-07-07 e6182554a1d994c049a3c78be2c325eb919aecfb
drift pipe def
1 files added
32 ■■■■■ changed files
Jenkinsfile-drift 32 ●●●●● patch | view | raw | blame | history
Jenkinsfile-drift
New file
@@ -0,0 +1,32 @@
pipeline {
    triggers {
    cron ('H/5 * * * *')
    }
    options {
    buildDiscarder (logrotator (numToKeepStr: '15', artifactNumToKeepStr: '15'))
    }
    agent {
    node {
        label '{nodejs'
    }
    }
    stages {
    stage ('Check resource drift') {
        steps {
        sh 'oc diff -k config | tee drift-report.txt'
        sh '! test -s drift-report.txt'
        }
    }
    }
    post {
    failure {
        archiveArtifacts artifacts: '*.txt'
        build job: 'apply/master'
    }
    success {
        sh 'rm drift-report.txt'
        sh 'echo \'There is no config drift\' > no-drift.txt'
        archiveArtifacts artifacts '*.txt'
    }
    }
}