-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
295 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
account = ['partnerlab', 'coreos-training'] | ||
pipeline { | ||
options { | ||
disableConcurrentBuilds() | ||
} | ||
agent { | ||
docker { | ||
label 'cloud-governance-worker' | ||
image 'quay.io/athiru/centos-stream8-podman:latest' | ||
args '-u root -v /etc/postfix/main.cf:/etc/postfix/main.cf --privileged' | ||
} | ||
} | ||
environment { | ||
AWS_IAM_USER_SPREADSHEET_ID = credentials('cloud-governance-aws-iam-user-spreadsheet-id') | ||
GOOGLE_APPLICATION_CREDENTIALS = credentials('cloud-governance-google-application-credentials') | ||
LDAP_HOST_NAME = credentials('cloud-governance-ldap-host-name') | ||
ES_HOST = credentials('haim-cloud-governance-elasticsearch-url') | ||
ES_PORT = credentials('haim-cloud-governance-elasticsearch-port') | ||
contact1 = "[email protected]" | ||
contact2 = "[email protected]" | ||
} | ||
stages { | ||
stage('Checkout') { // Checkout (git clone ...) the projects repository | ||
steps { | ||
checkout scm | ||
} | ||
} | ||
stage('Initial Cleanup') { | ||
steps { | ||
sh '''if [[ "$(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null)" != "" ]]; then podman rmi -f $(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null); fi''' | ||
} | ||
} | ||
stage('Run Policies the Cost Policies') { | ||
steps { | ||
script { | ||
for (int i = 0; i < account.size(); ++i) { | ||
echo "Running for account ${account[i].toUpperCase()}" | ||
withCredentials([string(credentialsId: "${account[i]}-aws-access-key-id", variable: 'access_key'), | ||
string(credentialsId: "${account[i]}-aws-secret-key-id", variable: 'secret_key'), | ||
string(credentialsId: "${account[i]}-s3-bucket", variable: 's3_bucket')]) { | ||
env.account_name = "${account[i]}" | ||
sh 'python3 jenkins/poc/haim/common/run_cost_policies.py' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('Run Policies the Daily polices') { | ||
steps { | ||
script { | ||
for (int i = 0; i < account.size(); ++i) { | ||
echo "Running for account ${account[i].toUpperCase()}" | ||
withCredentials([string(credentialsId: "${account[i]}-aws-access-key-id", variable: 'access_key'), | ||
string(credentialsId: "${account[i]}-aws-secret-key-id", variable: 'secret_key'), | ||
string(credentialsId: "${account[i]}-s3-bucket", variable: 's3_bucket')]) { | ||
env.account_name = "${account[i]}" | ||
sh 'python3 jenkins/poc/haim/common/run_policies.py' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('Finalize Cleanup') { | ||
steps { | ||
sh '''if [[ "$(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null)" != "" ]]; then podman rmi -f $(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null); fi''' | ||
deleteDir() | ||
} | ||
} | ||
} | ||
post { | ||
failure { | ||
script { | ||
msg = "Build error for ${env.JOB_NAME} ${env.BUILD_NUMBER} (${env.BUILD_URL})" | ||
emailext body: """\ | ||
Jenkins job: ${env.BUILD_URL}\nSee the console output for more details: ${env.BUILD_URL}consoleFull\n\n | ||
""",subject: msg, to: "${contact1}, ${contact2}, ${contact3}" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
### ecoeng_01 | ||
|
||
Accounts: | ||
- partnerlab | ||
- coreos-training | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
account = ['partnerlab', 'coreos-training'] | ||
pipeline { | ||
options { | ||
disableConcurrentBuilds() | ||
} | ||
agent { | ||
docker { | ||
label 'cloud-governance-worker' | ||
image 'quay.io/athiru/centos-stream8-podman:latest' | ||
args '-u root -v /etc/postfix/main.cf:/etc/postfix/main.cf --privileged' | ||
} | ||
} | ||
environment { | ||
LDAP_HOST_NAME = credentials('cloud-governance-ldap-host-name') | ||
account_name = "appeng" | ||
contact1 = "[email protected]" | ||
contact2 = "[email protected]" | ||
} | ||
stages { | ||
stage('Checkout') { // Checkout (git clone ...) the projects repository | ||
steps { | ||
checkout scm | ||
} | ||
} | ||
stage('Initial Cleanup') { | ||
steps { | ||
sh '''if [[ "$(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null)" != "" ]]; then podman rmi -f $(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null); fi''' | ||
} | ||
} | ||
stage('Run Tagging Cluster & Non-Cluster') { | ||
steps { | ||
script { | ||
for (int i = 0; i < account.size(); ++i) { | ||
echo "Running for account ${account[i].toUpperCase()}" | ||
withCredentials([string(credentialsId: "${account[i]}-aws-access-key-id", variable: 'access_key'), | ||
string(credentialsId: "${account[i]}-aws-secret-key-id", variable: 'secret_key'), | ||
string(credentialsId: "${account[i]}-s3-bucket", variable: 's3_bucket')]) { | ||
env.account_name = "${account[i]}" | ||
sh 'python3 jenkins/poc/haim/common/run_tagging.py' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('Finalize Cleanup') { | ||
steps { | ||
sh '''if [[ "$(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null)" != "" ]]; then podman rmi -f $(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null); fi''' | ||
deleteDir() | ||
} | ||
} | ||
} | ||
post { | ||
failure { | ||
script { | ||
msg = "Build error for ${env.JOB_NAME} ${env.BUILD_NUMBER} (${env.BUILD_URL})" | ||
emailext body: """\ | ||
Jenkins job: ${env.BUILD_URL}\nSee the console output for more details: ${env.BUILD_URL}consoleFull\n\n | ||
""",subject: msg, to: "${contact1}, ${contact2}, ${contact3}" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
account = ['appeng', 'fsi-partner'] | ||
pipeline { | ||
options { | ||
disableConcurrentBuilds() | ||
} | ||
agent { | ||
docker { | ||
label 'cloud-governance-worker' | ||
image 'quay.io/athiru/centos-stream8-podman:latest' | ||
args '-u root -v /etc/postfix/main.cf:/etc/postfix/main.cf --privileged' | ||
} | ||
} | ||
environment { | ||
AWS_IAM_USER_SPREADSHEET_ID = credentials('cloud-governance-aws-iam-user-spreadsheet-id') | ||
GOOGLE_APPLICATION_CREDENTIALS = credentials('cloud-governance-google-application-credentials') | ||
LDAP_HOST_NAME = credentials('cloud-governance-ldap-host-name') | ||
ES_HOST = credentials('haim-cloud-governance-elasticsearch-url') | ||
ES_PORT = credentials('haim-cloud-governance-elasticsearch-port') | ||
contact1 = "[email protected]" | ||
contact2 = "[email protected]" | ||
} | ||
stages { | ||
stage('Checkout') { // Checkout (git clone ...) the projects repository | ||
steps { | ||
checkout scm | ||
} | ||
} | ||
stage('Initial Cleanup') { | ||
steps { | ||
sh '''if [[ "$(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null)" != "" ]]; then podman rmi -f $(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null); fi''' | ||
} | ||
} | ||
stage('Run Policies the Cost Policies') { | ||
steps { | ||
script { | ||
for (int i = 0; i < account.size(); ++i) { | ||
echo "Running for account ${account[i].toUpperCase()}" | ||
withCredentials([string(credentialsId: "${account[i]}-aws-access-key-id", variable: 'access_key'), | ||
string(credentialsId: "${account[i]}-aws-secret-key-id", variable: 'secret_key'), | ||
string(credentialsId: "${account[i]}-s3-bucket", variable: 's3_bucket')]) { | ||
env.account_name = "${account[i]}" | ||
sh 'python3 jenkins/poc/haim/common/run_cost_policies.py' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('Run Policies the Daily polices') { | ||
steps { | ||
script { | ||
for (int i = 0; i < account.size(); ++i) { | ||
echo "Running for account ${account[i].toUpperCase()}" | ||
withCredentials([string(credentialsId: "${account[i]}-aws-access-key-id", variable: 'access_key'), | ||
string(credentialsId: "${account[i]}-aws-secret-key-id", variable: 'secret_key'), | ||
string(credentialsId: "${account[i]}-s3-bucket", variable: 's3_bucket')]) { | ||
env.account_name = "${account[i]}" | ||
sh 'python3 jenkins/poc/haim/common/run_policies.py' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('Finalize Cleanup') { | ||
steps { | ||
sh '''if [[ "$(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null)" != "" ]]; then podman rmi -f $(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null); fi''' | ||
deleteDir() | ||
} | ||
} | ||
} | ||
post { | ||
failure { | ||
script { | ||
msg = "Build error for ${env.JOB_NAME} ${env.BUILD_NUMBER} (${env.BUILD_URL})" | ||
emailext body: """\ | ||
Jenkins job: ${env.BUILD_URL}\nSee the console output for more details: ${env.BUILD_URL}consoleFull\n\n | ||
""",subject: msg, to: "${contact1}, ${contact2}, ${contact3}" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### ecoeng_02 | ||
|
||
Accounts: | ||
- appeng | ||
- partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
account = ['appeng', 'fsi-partner'] | ||
pipeline { | ||
options { | ||
disableConcurrentBuilds() | ||
} | ||
agent { | ||
docker { | ||
label 'cloud-governance-worker' | ||
image 'quay.io/athiru/centos-stream8-podman:latest' | ||
args '-u root -v /etc/postfix/main.cf:/etc/postfix/main.cf --privileged' | ||
} | ||
} | ||
environment { | ||
LDAP_HOST_NAME = credentials('cloud-governance-ldap-host-name') | ||
account_name = "appeng" | ||
contact1 = "[email protected]" | ||
contact2 = "[email protected]" | ||
} | ||
stages { | ||
stage('Checkout') { // Checkout (git clone ...) the projects repository | ||
steps { | ||
checkout scm | ||
} | ||
} | ||
stage('Initial Cleanup') { | ||
steps { | ||
sh '''if [[ "$(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null)" != "" ]]; then podman rmi -f $(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null); fi''' | ||
} | ||
} | ||
stage('Run Tagging Cluster & Non-Cluster') { | ||
steps { | ||
script { | ||
for (int i = 0; i < account.size(); ++i) { | ||
echo "Running for account ${account[i].toUpperCase()}" | ||
withCredentials([string(credentialsId: "${account[i]}-aws-access-key-id", variable: 'access_key'), | ||
string(credentialsId: "${account[i]}-aws-secret-key-id", variable: 'secret_key'), | ||
string(credentialsId: "${account[i]}-s3-bucket", variable: 's3_bucket')]) { | ||
env.account_name = "${account[i]}" | ||
sh 'python3 jenkins/poc/haim/common/run_tagging.py' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('Finalize Cleanup') { | ||
steps { | ||
sh '''if [[ "$(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null)" != "" ]]; then podman rmi -f $(podman images -q quay.io/ebattat/cloud-governance 2> /dev/null); fi''' | ||
deleteDir() | ||
} | ||
} | ||
} | ||
post { | ||
failure { | ||
script { | ||
msg = "Build error for ${env.JOB_NAME} ${env.BUILD_NUMBER} (${env.BUILD_URL})" | ||
emailext body: """\ | ||
Jenkins job: ${env.BUILD_URL}\nSee the console output for more details: ${env.BUILD_URL}consoleFull\n\n | ||
""",subject: msg, to: "${contact1}, ${contact2}, ${contact3}" | ||
} | ||
} | ||
} | ||
} |