-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
48 lines (43 loc) · 1.84 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
# Welcome to serverless. Read the docs
# https://serverless.com/framework/docs/
# Serverless.yml is the configuration the CLI
# uses to deploy your code to your provider of choice
# The `service` block is the name of the service
service: serverless-remote-cc
# The `provider` block defines where your service will be deployed
provider:
name: aws
runtime: nodejs6.10
custom: ${file(./config/lambda.${opt:stage, 'dev'}.yml)}
iamRoleStatements:
- Effect: Allow
Action:
- s3:*
Resource: "*"
# The `functions` block defines what code to deploy
functions:
crawlerRemoteJobs:
handler: handler.crawlerRemoteJobs
environment:
PROXY: ${file(./config/lambda.${opt:stage, 'dev'}.yml):crawlerProxy}
JOBS_FILE: ${file(./config/lambda.${opt:stage, 'dev'}.yml):jobsFile}
BUCKET_NAME: ${file(./config/lambda.${opt:stage, 'dev'}.yml):bucketName}
REGION: ${self:provider.custom.region}
events:
- schedule: ${file(./config/lambda.${opt:stage, 'dev'}.yml):crawlerSchedule}
sendJobsFileToRepository:
handler: handler.sendJobsFileToRepository
environment:
GITHUB_TOKEN: ${file(./config/lambda.${opt:stage, 'dev'}.yml):githubToken}
GITHUB_OWNER: ${file(./config/lambda.${opt:stage, 'dev'}.yml):githubOwner}
GITHUB_REPO: ${file(./config/lambda.${opt:stage, 'dev'}.yml):githubRepo}
GITHUB_FILE: ${file(./config/lambda.${opt:stage, 'dev'}.yml):jobsFile}
DATA_FILE: ${file(./config/lambda.${opt:stage, 'dev'}.yml):githubDataFile}
BUCKET_NAME: ${file(./config/lambda.${opt:stage, 'dev'}.yml):bucketName}
REGION: ${self:provider.custom.region}
events:
- s3:
bucket: ${file(./config/lambda.${opt:stage, 'dev'}.yml):bucketName}
event: s3:ObjectCreated:*
rules:
- prefix: ${file(./config/lambda.${opt:stage, 'dev'}.yml):jobsFile}