New file |
| | |
| | | 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' |
| | | } |
| | | } |
| | | } |