File tree Expand file tree Collapse file tree 5 files changed +60
-5
lines changed
aws/bitops.after-deploy.d
ecr/bitops.after-deploy.d
eks/bitops.after-deploy.d Expand file tree Collapse file tree 5 files changed +60
-5
lines changed Original file line number Diff line number Diff line change 2626if [[ $( alpha_only " $AWS_EFS_CREATE " ) == true ]] || [[ $( alpha_only " $AWS_EFS_CREATE_HA " ) == true ]] || [ -n " $AWS_EFS_FS_ID " ]; then
2727 export AWS_EFS_ENABLE=" true"
2828else
29- export AWS_EFS_ENABLE=" false "
29+ export AWS_EFS_ENABLE=" " # Intentional, being consistent with the rest of incoming vars
3030fi
3131
3232# Generate Github identifiers vars
Original file line number Diff line number Diff line change @@ -37,12 +37,25 @@ function check_aws_bucket_for_file() {
3737 return $?
3838}
3939
40+ function generate_tf_state_file_name () {
41+ if [ -n " $TF_STATE_FILE_NAME " ]; then
42+ filename=" $TF_STATE_FILE_NAME "
43+ else
44+ filename=" tf-state-$1 "
45+ fi
46+
47+ if [ -n " $TF_STATE_FILE_NAME_APPEND " ]; then
48+ filename=" ${filename} -${TF_STATE_FILE_NAME_APPEND} "
49+ fi
50+ echo $filename
51+ }
52+
4053function check_statefile() {
4154 provider=" $1 "
4255 bucket=" $TF_STATE_BUCKET "
4356 commons_module=" $2 "
4457 if [[ " $provider " == " aws" ]]; then
45- check_aws_bucket_for_file $bucket " tf-state- $ commons_module"
58+ check_aws_bucket_for_file $bucket $( generate_tf_state_file_name $ commons_module)
4659 return $?
4760 fi
4861}
Original file line number Diff line number Diff line change 44
55echo " "
66
7- tf_state_file=" tf-state-aws"
87bucket=" $TF_STATE_BUCKET "
8+ commons_module=" aws"
9+
10+ function generate_tf_state_file_name () {
11+ if [ -n " $TF_STATE_FILE_NAME " ]; then
12+ filename=" $TF_STATE_FILE_NAME "
13+ else
14+ filename=" tf-state-$1 "
15+ fi
16+
17+ if [ -n " $TF_STATE_FILE_NAME_APPEND " ]; then
18+ filename=" ${filename} -${TF_STATE_FILE_NAME_APPEND} "
19+ fi
20+ echo $filename
21+ }
922
1023function check_aws_bucket_for_file() {
1124 bucket=" $1 "
@@ -14,6 +27,7 @@ function check_aws_bucket_for_file() {
1427 return $?
1528}
1629
30+ tf_state_file=$( generate_tf_state_file_name $commons_module )
1731
1832if [[ " $BITOPS_TERRAFORM_COMMAND " == " destroy" ]]; then
1933 if check_aws_bucket_for_file $bucket " $tf_state_file " ; then
Original file line number Diff line number Diff line change 44
55echo " "
66
7- tf_state_file=" tf-state-aws"
87bucket=" $TF_STATE_BUCKET "
8+ commons_module=" ecr"
9+
10+ function generate_tf_state_file_name () {
11+ if [ -n " $TF_STATE_FILE_NAME " ]; then
12+ filename=" $TF_STATE_FILE_NAME "
13+ else
14+ filename=" tf-state-$1 "
15+ fi
16+
17+ if [ -n " $TF_STATE_FILE_NAME_APPEND " ]; then
18+ filename=" ${filename} -${TF_STATE_FILE_NAME_APPEND} "
19+ fi
20+ echo $filename
21+ }
922
1023function check_aws_bucket_for_file() {
1124 bucket=" $1 "
@@ -14,6 +27,7 @@ function check_aws_bucket_for_file() {
1427 return $?
1528}
1629
30+ tf_state_file=$( generate_tf_state_file_name $commons_module )
1731
1832if [[ " $BITOPS_TERRAFORM_COMMAND " == " destroy" ]]; then
1933 if check_aws_bucket_for_file $bucket " $tf_state_file " ; then
Original file line number Diff line number Diff line change 44
55echo " "
66
7- tf_state_file=" tf-state-eks"
87bucket=" $TF_STATE_BUCKET "
8+ commons_module=" eks"
9+
10+ function generate_tf_state_file_name () {
11+ if [ -n " $TF_STATE_FILE_NAME " ]; then
12+ filename=" $TF_STATE_FILE_NAME "
13+ else
14+ filename=" tf-state-$1 "
15+ fi
16+
17+ if [ -n " $TF_STATE_FILE_NAME_APPEND " ]; then
18+ filename=" ${filename} -${TF_STATE_FILE_NAME_APPEND} "
19+ fi
20+ echo $filename
21+ }
922
1023function check_aws_bucket_for_file() {
1124 bucket=" $1 "
@@ -14,6 +27,7 @@ function check_aws_bucket_for_file() {
1427 return $?
1528}
1629
30+ tf_state_file=$( generate_tf_state_file_name $commons_module )
1731
1832if [[ " $BITOPS_TERRAFORM_COMMAND " == " destroy" ]]; then
1933 if check_aws_bucket_for_file $bucket " $tf_state_file " ; then
You can’t perform that action at this time.
0 commit comments