Skip to content

Commit 4f2721b

Browse files
author
Thomas Z
committed
added default init script for a given environment
1 parent 4b33c8a commit 4f2721b

2 files changed

Lines changed: 29 additions & 6 deletions

File tree

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ Terraform infrastructure as code
44
## Instructions
55
1. Setup the basic infrastructure for either staging / production environment
66
```
7-
cd terraform
8-
cd environments/staging
9-
terraform init
10-
terraform apply
7+
./init.sh <environment>
118
```
9+
The supported environment values are currently `staging` and `production`
1210

1311
2. Setup the Kubernetes utilities
1412
```
15-
cd kubernetes/terraform
16-
cd environments/staging
13+
cd kubernetes/terraform/environments/staging
1714
terraform apply
1815
```

init.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
ENV=${1:-staging}
3+
4+
# Setup the remote state storage
5+
pushd terraform/environments/bootstrap;
6+
terraform init;
7+
terraform apply;
8+
popd;
9+
10+
# Setup the secrets
11+
pushd terraform/environments/bootstrap;
12+
terraform init;
13+
terraform apply;
14+
popd;
15+
16+
# Setup the chosen environment
17+
pushd terraform/environments/$ENV;
18+
terraform init;
19+
terraform apply;
20+
popd;
21+
22+
# Setup the Kubernetes utilities
23+
pushd kubernetes/terraform/environments/$ENV;
24+
terraform init;
25+
terraform apply;
26+
popd;

0 commit comments

Comments
 (0)