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