diff --git a/jobs/check-aws-regions.Jenkinsfile b/jobs/check-aws-regions.Jenkinsfile new file mode 100644 index 000000000..dba3be1b5 --- /dev/null +++ b/jobs/check-aws-regions.Jenkinsfile @@ -0,0 +1,32 @@ +import org.yaml.snakeyaml.Yaml; + +node { + checkout scm + // these are script global vars + pipeutils = load("utils.groovy") +} + +properties([ + pipelineTriggers([ + // check once a day + pollSCM('H H * * *') + ]), + buildDiscarder(logRotator( + numToKeepStr: '20', + artifactNumToKeepStr: '20' + )), + durabilityHint('PERFORMANCE_OPTIMIZED') +]) + +cosaPod(serviceAccount: "jenkins"){ + def disabled_regions = "" + withCredentials([file(variable: 'AWS_CONFIG_FILE', + credentialsId: 'aws-build-upload-config')]) { + disabled_regions = shwrapCapture("ore aws list-regions --disabled") + } + if (disabled_regions != "None") { + warn("Disabled AWS regions detected: ${disabled_regions}") + pipeutils.trySlackSend(message: ":aws: aws-regions-disabled :jenkins:<${env.BUILD_URL}|${env.BUILD_NUMBER}> ${disabled_regions}") + return + } +}