This repository was archived by the owner on Sep 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuildspec.yml
More file actions
43 lines (38 loc) · 1.71 KB
/
Copy pathbuildspec.yml
File metadata and controls
43 lines (38 loc) · 1.71 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
version: 0.2
env:
variables:
stage: "stg"
parameter-store:
config_json: "office-maker-profiles-config-stg"
# public key for JWT should be same as office-maker-api's pubkey
pubkey: "office-maker-api-authorizer-pubkey"
phases:
install:
commands:
- sudo apt-get update && sudo apt-get install -y lsof
- npm i -g npm@latest
- npm ci
- cd functions && npm ci && cd -
- wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O /usr/bin/jq && chmod +x /usr/bin/jq
- pip install yq
- pip install --upgrade awscli
- docker pull amazon/dynamodb-local
- echo ${config_json} >> config.json
- mkdir -p keys
- echo "${pubkey}" >> keys/pubkey.pem
pre_build:
commands:
- docker run -d -p 8000:8000 amazon/dynamodb-local
- echo $(npx sls print -s test | yq '.resources.Resources.ProfilesTable.Properties') > input.json && aws dynamodb create-table --cli-input-json file://input.json --endpoint-url "http://localhost:8000"
- echo $(npx sls print -s test | yq '.resources.Resources.ProfilesSearchHelpTable.Properties') > input.json && aws dynamodb create-table --cli-input-json file://input.json --endpoint-url "http://localhost:8000"
- echo $(npx sls print -s test | yq '.resources.Resources.ProfilesPostsTable.Properties') > input.json && aws dynamodb create-table --cli-input-json file://input.json --endpoint-url "http://localhost:8000"
- aws --endpoint-url http://localhost:8000 dynamodb list-tables
- npx mocha test/lambda-test.js
build:
commands: |
if [ "$CODEBUILD_WEBHOOK_TRIGGER" = "branch/master" ]; then
npx sls deploy -s ${stage}
fi;
cache:
paths:
- '~/.npm/**/*'