fix: increase permissions and return to directory (#122)
Signed-off-by: matttrach <matt.trachier@suse.com>
This commit is contained in:
parent
3c161fb1f6
commit
c3f2da99e2
|
|
@ -1,8 +1,10 @@
|
|||
set -x
|
||||
DIR=$(pwd)
|
||||
cd ${deploy_path}
|
||||
pwd
|
||||
ls -lah
|
||||
. envrc
|
||||
whoami
|
||||
. ${deploy_path}/envrc
|
||||
TF_CLI_ARGS_init=""
|
||||
TF_CLI_ARGS_apply=""
|
||||
|
||||
|
|
@ -54,5 +56,5 @@ if [ $EXITCODE -eq 0 ]; then
|
|||
echo "success...";
|
||||
terraform output -json -state="${deploy_path}/tfstate" > ${deploy_path}/outputs.json
|
||||
fi
|
||||
|
||||
cd $DIR
|
||||
exit $EXITCODE
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
set -x
|
||||
DIR=$(pwd)
|
||||
cd ${deploy_path}
|
||||
pwd
|
||||
ls -lah
|
||||
. envrc
|
||||
whoami
|
||||
. ${deploy_path}/envrc
|
||||
TF_CLI_ARGS_init=""
|
||||
TF_CLI_ARGS_apply=""
|
||||
if [ -z "${skip_destroy}" ]; then
|
||||
|
|
@ -11,3 +13,5 @@ if [ -z "${skip_destroy}" ]; then
|
|||
else
|
||||
echo "Not destroying deployed module, it will no longer be managed here."
|
||||
fi
|
||||
cd $DIR
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ resource "file_local_directory" "deploy_path" {
|
|||
path = local.deploy_path
|
||||
permissions = "0755"
|
||||
}
|
||||
|
||||
resource "file_local_directory" "tf_data_dir" {
|
||||
count = (local.tf_data_dir != local.deploy_path ? 1 : 0)
|
||||
path = local.tf_data_dir
|
||||
|
|
@ -78,6 +77,7 @@ resource "file_local" "write_tmp_inputs" {
|
|||
directory = local.tf_data_dir
|
||||
name = "inputs.tmp"
|
||||
contents = local.inputs
|
||||
permissions = "0400"
|
||||
}
|
||||
resource "file_local_snapshot" "persist_inputs" {
|
||||
depends_on = [
|
||||
|
|
@ -110,6 +110,7 @@ resource "file_local" "write_tmp_env" {
|
|||
directory = local.tf_data_dir
|
||||
name = "env.tmp"
|
||||
contents = local.export_contents
|
||||
permissions = "0400"
|
||||
}
|
||||
resource "file_local_snapshot" "persist_envrc" {
|
||||
depends_on = [
|
||||
|
|
@ -131,6 +132,7 @@ resource "file_local" "instantiate_envrc_snapshot" {
|
|||
directory = local.deploy_path
|
||||
name = "envrc"
|
||||
contents = base64decode(file_local_snapshot.persist_envrc.snapshot)
|
||||
permissions = "0644"
|
||||
}
|
||||
|
||||
## Deploy ##
|
||||
|
|
|
|||
Loading…
Reference in New Issue