-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuildspec.yml
More file actions
50 lines (45 loc) · 1.91 KB
/
Copy pathbuildspec.yml
File metadata and controls
50 lines (45 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# All commands below are run from root directory of repository by CodeBuild
version: 0.2
env:
variables:
AWS_DEFAULT_REGION: "ap-southeast-4"
REMOTE_STATE_BUCKET: "jch254-terraform-remote-state"
TF_STATE_KEY: "serverless-node-dynamodb-ui"
APP_HOSTNAME: "serverless-api.603.nz"
DEPLOYMENT_BUCKET: "serverless-api.603.nz"
AUTH0_CLIENT_ID: "PabWYDl71ibZ920e3XjoPIe0QoJVrhtY"
AUTH0_DOMAIN: "603.au.auth0.com"
API_BASE_URI: "https://sls-api.603.nz"
parameter-store:
CLOUDFLARE_API_TOKEN: "/serverless-node-dynamodb-ui/cloudflare-api-token"
GA_ID: "/serverless-node-dynamodb-ui/ga-id"
phases:
install:
commands:
- echo Setting up Terraform plugin cache...
- export TF_PLUGIN_CACHE_DIR="$HOME/.terraform.d/plugin-cache"
- mkdir -p "$TF_PLUGIN_CACHE_DIR"
# Workaround until CodeBuild/CodePipeline retains file permissions
- find ./infrastructure -name "*.bash" -exec chmod +x {} \;
- echo Installing Node dependencies...
- corepack enable
- corepack prepare pnpm@9.15.9 --activate
- ./infrastructure/install.bash
pre_build:
commands:
- echo Verifying required parameters...
- 'test -n "$AUTH0_CLIENT_ID" || { echo "AUTH0_CLIENT_ID is required"; exit 1; }'
- 'test -n "$AUTH0_DOMAIN" || { echo "AUTH0_DOMAIN is required"; exit 1; }'
- 'test -n "$API_BASE_URI" || { echo "API_BASE_URI is required"; exit 1; }'
- 'test -n "$CLOUDFLARE_API_TOKEN" || { echo "CLOUDFLARE_API_TOKEN is required"; exit 1; }'
- 'test -n "$GA_ID" || { echo "GA_ID is required"; exit 1; }'
build:
commands:
- ./infrastructure/build-artifacts.bash
- ./infrastructure/deploy-infrastructure.bash
- ./infrastructure/upload-artifacts.bash
cache:
paths:
- 'infrastructure/terraform/.terraform/modules/**/*'
- 'infrastructure/terraform/.terraform/plugins/**/*'
- '/root/.terraform.d/plugin-cache/**/*'