Skip to content

Commit 900a1c9

Browse files
authored
Create reweeden CI stack (#4245)
* Add personal stack * Apply deployment tag everywhere using provider level `default_tags` * Add quotes to git commit logs in scripts This should prevent backticks in commit messages from being executed as shell commands
1 parent ebc6606 commit 900a1c9

12 files changed

Lines changed: 37 additions & 5 deletions

File tree

bamboo/abort-if-skip-unit-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -e
33

4-
if [[ $(git log --pretty='format:%Creset%s' -1) =~ '[skip-unit-tests]' ]]; then
4+
if [[ "$(git log --pretty='format:%Creset%s' -1)" =~ '[skip-unit-tests]' ]]; then
55
>&2 echo "*** Skipping unit tests based on commit message: $COMMIT_MESSAGE"
66
exit 0
77
fi

bamboo/audit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ commit_message_contains_skip_audit_flag=false
88
commit_matches_version_tag=false
99

1010

11-
if [[ $(git log --pretty='format:%Creset%s' -1) =~ '[skip-audit]' ]]; then
11+
if [[ "$(git log --pretty='format:%Creset%s' -1)" =~ '[skip-audit]' ]]; then
1212
commit_message_contains_skip_audit_flag=true;
1313
fi
1414
if [[ $(git describe --exact-match HEAD 2>/dev/null |sed -n '1p') =~ ^v[0-9]+.* ]]; then

bamboo/select-stack.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function determineIntegrationTestStackName(cb) {
3737
'Naga Nages': 'nnaga-ci',
3838
'Paul Pilone': 'ppilone-ci',
3939
'Robert Swanson': 'rs-ci',
40+
'Rohan Weeden': 'reweeden-ci',
4041
'Tim Clark': 'teclark-ci',
4142
wisdomaj: 'awisdom-ci',
4243
'Yonggang Liu': 'yliu10-ci',

bamboo/set-bamboo-env-variables.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ echo GIT_PR is $GIT_PR
175175
## Exporting the commit message as an env variable to be brought in
176176
## for yes/no toggles on build
177177
if [[ -z $COMMIT_MESSAGE ]]; then
178-
COMMIT_MESSAGE=$(git log --pretty='format:%Creset%s' -1)
178+
COMMIT_MESSAGE="$(git log --pretty='format:%Creset%s' -1)"
179179
export COMMIT_MESSAGE
180180
echo export COMMIT_MESSAGE=\""$COMMIT_MESSAGE"\" >> .bamboo_env_vars
181181
fi

example/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ np:
6262
nnaga-tf:
6363
bucket: nnaga-internal
6464

65+
reweeden:
66+
bucket: reweeden-internal
67+
6568
rs:
6669
bucket: rs-internal
6770

example/cumulus-tf/main.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ provider "aws" {
1515
region = var.region
1616
profile = var.aws_profile
1717

18+
default_tags {
19+
tags = {
20+
Deployment = var.prefix
21+
}
22+
}
23+
1824
ignore_tags {
1925
key_prefixes = ["gsfc-ngap"]
2026
}
@@ -25,6 +31,12 @@ provider "aws" {
2531
region = "us-west-2"
2632
profile = var.aws_profile
2733

34+
default_tags {
35+
tags = {
36+
Deployment = var.prefix
37+
}
38+
}
39+
2840
ignore_tags {
2941
key_prefixes = ["gsfc-ngap"]
3042
}

example/cumulus-tf/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ variable "archive_api_users" {
298298
"mikedorfman",
299299
"nnageswa",
300300
"npauzenga",
301+
"reweeden",
301302
"terrafirma13",
302303
"yliu10"
303304
]

example/data-persistence-tf/main.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ terraform {
1414
provider "aws" {
1515
region = var.aws_region
1616

17+
default_tags {
18+
tags = {
19+
Deployment = var.prefix
20+
}
21+
}
22+
1723
ignore_tags {
1824
key_prefixes = ["gsfc-ngap"]
1925
}
@@ -32,7 +38,7 @@ module "provision_database" {
3238
prefix = var.prefix
3339
rds_security_group = var.rds_security_group
3440
rds_admin_access_secret_arn = var.rds_admin_access_secret_arn
35-
tags = var.tags
41+
tags = merge(var.tags, { Deployment = var.prefix })
3642
permissions_boundary_arn = var.permissions_boundary_arn
3743
rds_user_password = var.rds_user_password == "" ? random_string.db_pass.result : var.rds_user_password
3844
rds_connection_timing_configuration = var.rds_connection_timing_configuration
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
prefix = "reweeden-ci-tf"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
prefix = "reweeden-ci-tf"

0 commit comments

Comments
 (0)