diff --git a/.woodpecker.yml b/.woodpecker.yml index 543f9e7..bc1a40a 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -12,7 +12,7 @@ pipeline: image: registry.monotremata.xyz/terraform pull: true commands: - - terraform init -backend-config="conn_str=$BACKEND_CONN_STR" + - terraform -chdir=tf init -backend-config="conn_str=$BACKEND_CONN_STR" secrets: [backend_conn_str] @@ -20,8 +20,8 @@ pipeline: image: registry.monotremata.xyz/terraform pull: true commands: - - terraform plan -out=tfplan - - terraform show -json tfplan + - terraform -chdir=tf plan -out=tfplan + - terraform -chdir=tf show -json tfplan environment: - HTTP_PROXY=caladan:8888 - HTTPS_PROXY=caladan:8888 @@ -34,7 +34,7 @@ pipeline: image: registry.monotremata.xyz/terraform pull: true commands: - - terraform apply tfplan + - terraform -chdir=tf apply tfplan environment: - HTTP_PROXY=caladan:8888 - HTTPS_PROXY=caladan:8888 diff --git a/README.md b/README.md index e0d88e1..5dce77c 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,14 @@ create resources manually and import them later to terraform. ## Wrapper scripts -I run Terrafrom through two wrapper scripts: `init.sh` and `run_terraform`. +I run Terrafrom through two wrapper scripts: `scripts/init.sh` and +`scripts/run_terraform`. -`init.sh` is used just to run `terraform init`. It fetches the PostgreSQL -phssword (from `pass`) and it passes the connection string manually to the -partially-configured pg backend. +`scripts/init.sh` is used just to run `terraform init`. It fetches the +PostgreSQL phssword (from `pass`) and it passes the connection string manually +to the partially-configured pg backend. -`run_terraform` is used to run other terraform commands. It sets up the +`scripts/run_terraform` is used to run other terraform commands. It sets up the `HTTP_PROXY` and `HTTPS_PROXY` variables to use `caladan` as a proxy. It also fetches the secrets (from `pass`) and exports the variables for api keys and tokens needed by the different providers. diff --git a/init.sh b/scripts/init.sh similarity index 100% rename from init.sh rename to scripts/init.sh diff --git a/run_terraform b/scripts/run_terraform similarity index 90% rename from run_terraform rename to scripts/run_terraform index 3aecbc8..ff6d083 100755 --- a/run_terraform +++ b/scripts/run_terraform @@ -11,4 +11,4 @@ export NAMECHEAP_API_KEY export LINODE_TOKEN export VULTR_API_KEY -terraform "$@" +terraform -chdir=./tf "$@" diff --git a/caladan.tf b/tf/caladan.tf similarity index 100% rename from caladan.tf rename to tf/caladan.tf diff --git a/fugu.tf b/tf/fugu.tf similarity index 100% rename from fugu.tf rename to tf/fugu.tf diff --git a/main.tf b/tf/main.tf similarity index 100% rename from main.tf rename to tf/main.tf diff --git a/monotremata-xyz.tf b/tf/monotremata-xyz.tf similarity index 100% rename from monotremata-xyz.tf rename to tf/monotremata-xyz.tf