Skip to content

Commit

Permalink
Merge pull request coreos#893 from aaradhak/awszone
Browse files Browse the repository at this point in the history
jobs: check-aws-regions job for checking disabled aws regions
  • Loading branch information
aaradhak authored Jul 27, 2023
2 parents a24e609 + 87f1244 commit 3427c38
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions jobs/check-aws-regions.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 3427c38

Please sign in to comment.