-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
executable file
·49 lines (41 loc) · 1.83 KB
/
buildspec.yml
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
version: 0.1
phases:
install:
commands:
# Install additional npm modules
- npm install
# Install jq
- apt-get update && apt-get install -y jq
pre_build:
commands:
# Get Configuration Information
- chmod +x getConfig.sh && ./getConfig.sh
# Uncomment/modify secret management code below as needed.
# The commands assume you have uploaded files to the dedicated bucket.
# For instructions on updating secrets, see https://github.com/pariveda-serverless/support/blob/master/secrets-uploader/README.md
# To see an example of client-side encryption/decryption, view the commands at https://github.com/pariveda-serverless/child-pipelines/blob/master/buildspec.yml
# TODO determine if you need secret management, and modify accordingly
- aws configure set s3.signature_version s3v4
- echo Secrets bucket is $(cat s3.txt)
# For environment var SLACK_APP_AUTH_TOKEN in serverless.yml
- aws s3api get-object --bucket $(cat s3.txt) --key oauth.enc oauth.txt
# For environment var VERIFICATION_TOKEN in serverless.yml
- aws s3api get-object --bucket $(cat s3.txt) --key token.enc token.txt
# For environment var SLACK_BOT_AUTH_TOKEN in serverless.yml
- aws s3api get-object --bucket $(cat s3.txt) --key bot_oauth.enc bot_oauth.txt
# TODO: If needed, add additional steps
# EXAMPLE: npm lint, npm test, etc.
build:
commands:
# Deploy Application
- serverless deploy --clientSecret "$(cat oauth.txt)" --slackToken "$(cat token.txt)" --botToken "$(cat bot_oauth.txt)"
post_build:
commands:
# Remove S3 Bucket Name from Codebuild Memory
- rm -rf s3.txt
- rm -rf oauth.txt
- rm -rf token.txt
- rm -rf bot_oauth.txt
# Remove pipelines
# USE WITH EXTREME CAUTION!
#- sls remove