diff --git a/.ci/tasks/apply/task.sh b/.ci/tasks/apply/task.sh index 3e31596..80a6e59 100755 --- a/.ci/tasks/apply/task.sh +++ b/.ci/tasks/apply/task.sh @@ -1,6 +1,6 @@ #!/bin/sh export DIR="${PWD}" -cp -R ${DIR}/source ${DIR}secret-source +cp -a ${DIR}/source/. ${DIR}/secret-source/ cd ${DIR}/secret-source/examples/${directory} sed -i 's##'${AWS_ACCOUNT_ID}'#g' main.tf sed -i 's##'${KMS_KEY_ID}'#g' main.tf diff --git a/.ci/tasks/destroy/task.sh b/.ci/tasks/destroy/task.sh index 2077034..34b1866 100755 --- a/.ci/tasks/destroy/task.sh +++ b/.ci/tasks/destroy/task.sh @@ -1,4 +1,6 @@ #!/bin/sh export DIR="${PWD}" -cd ${DIR}/secret-source/examples/default +cd ${DIR}/secret-source/examples/${directory} +rm -rf .terraform +terraform init terraform destroy --auto-approve diff --git a/examples/default/test.sh b/examples/default/test.sh index 8546733..e0e339d 100755 --- a/examples/default/test.sh +++ b/examples/default/test.sh @@ -15,6 +15,7 @@ tests_failed=0 if [ $1 == 'ci' ] then VPC_ID=`cat terraform-out/terraform-out.json | jq -r '.vpc_id.value'` + export AWS_DEFAULT_REGION=eu-west-1 else VPC_ID=`terraform output -json | jq -r '.vpc_id.value'` fi diff --git a/examples/private-subnets-no-nat/test.sh b/examples/private-subnets-no-nat/test.sh index 58c1048..689fc41 100755 --- a/examples/private-subnets-no-nat/test.sh +++ b/examples/private-subnets-no-nat/test.sh @@ -15,6 +15,7 @@ tests_failed=0 if [ $1 == 'ci' ] then VPC_ID=`cat terraform-out/terraform-out.json | jq -r '.vpc_id.value'` + export AWS_DEFAULT_REGION=eu-west-1 else VPC_ID=`terraform output -json | jq -r '.vpc_id.value'` fi diff --git a/examples/private-subnets/test.sh b/examples/private-subnets/test.sh index 4338e18..396ba1d 100755 --- a/examples/private-subnets/test.sh +++ b/examples/private-subnets/test.sh @@ -15,6 +15,7 @@ tests_failed=0 if [ $1 == 'ci' ] then VPC_ID=`cat terraform-out/terraform-out.json | jq -r '.vpc_id.value'` + export AWS_DEFAULT_REGION=eu-west-1 else VPC_ID=`terraform output -json | jq -r '.vpc_id.value'` fi