-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
77 lines (68 loc) · 2.2 KB
/
serverless.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
service: scrapbox-codesync
frameworkVersion: "2"
plugins:
- serverless-jest-plugin
- serverless-dotenv-plugin
useDotenv: true
custom:
defaultRegion: ap-northeast-1
defaultStage: prod
profile: slsfw-${self:provider.stage}
environment:
SLS_STAGE: ${self:provider.stage}
USER_CSS_EYECATCH_URL: ${env:USER_CSS_EYECATCH_URL}
USER_SCRIPT_EYECATCH_URL: ${env:USER_SCRIPT_EYECATCH_URL}
USER_CSS_TAG: ${env:USER_CSS_TAG}
USER_SCRIPT_TAG: ${env:USER_SCRIPT_TAG}
CONCURRENT_EXEC_NUMBER: ${env:CONCURRENT_EXEC_NUMBER}
SCRAPBOX_PROJECT_NAME: ${opt:scrapboxProjectName, env:SCRAPBOX_PROJECT_NAME}
SCRAPBOX_CONNECT_SID: ${opt:scrapboxConnectSid, env:SCRAPBOX_CONNECT_SID}
GITHUB_TARGET_BRUNCH: ${env:GITHUB_TARGET_BRUNCH}
GITHUB_REPO_OWNER: ${opt:githubRepoOwner, env:GITHUB_REPO_OWNER}
GITHUB_REPO_NAME: ${opt:githubRepoName, env:GITHUB_REPO_NAME}
GITHUB_API_TOKEN: ${opt:githubApiToken, env:GITHUB_API_TOKEN}
GITHUB_WEBHOOK_SECRET_TOKEN: ${opt:githubWebhookSecretToken, env:GITHUB_WEBHOOK_SECRET_TOKEN}
request:
template:
application/json:
method: $context.httpMethod,
body: $util.escapeJavaScript($input.json('$')),
headers:
#foreach($param in $input.params().header.keySet())
$param: $util.escapeJavaScript($input.params().header.get($param))
#if($foreach.hasNext),#end
#end
provider:
name: aws
runtime: nodejs12.x
timeout: 900
profile: ${opt:profile, self:custom.profile}
region: ${opt:region, self:custom.defaultRegion}
stage: ${opt:stage, self:custom.defaultStage}
apiGateway:
shouldStartNameWithService: true
functions:
allSync:
handler: app/handler.allSync
layers:
- { Ref: ChromeLambdaLayer }
environment: ${self:custom.environment}
receive:
handler: app/handler.receive
events:
- http:
path: scrapbox/code/receive
method: post
layers:
- { Ref: ChromeLambdaLayer }
environment: ${self:custom.environment}
package:
exclude:
- node_modules/serverless/**
- node_modules/chrome-aws-lambda/**
- chrome-aws-lambda/**
- tests/**
layers:
chrome:
package:
artifact: ./layers/chrome_aws_lambda.zip