-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
47 lines (41 loc) · 1.33 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
# serverless.yml
service: umuttepe-hava-botu
frameworkVersion: "3"
configValidationMode: off
useDotenv: true
provider:
name: azure
location: UK South
runtime: python3.8
stage: ${opt:stage, 'dev'}
environment:
TWITTER_CONSUMER_KEY: ${env:TWITTER_CONSUMER_KEY}
TWITTER_CONSUMER_SECRET: ${env:TWITTER_CONSUMER_SECRET}
TWITTER_ACCESS_TOKEN: ${env:TWITTER_ACCESS_TOKEN}
TWITTER_ACCESS_TOKEN_SECRET: ${env:TWITTER_ACCESS_TOKEN_SECRET}
package:
patterns:
- "!./**"
- src/**
- publishTweet/** # function name
- deleteAllTweets/** # function name
plugins:
- serverless-azure-functions
- serverless-python-requirements
functions:
publishTweet:
handler: src/handlers/publish_tweet.main
events:
- timer:
do: notRemoveHere # BUG: do not remove, there is a bug in parsing (¯\_(ツ)_/¯)
# https://github.com/serverless/serverless-azure-functions/issues/566
name: timer
schedule: 0 */30 * * * * # every 30 min
deleteAllTweets:
handler: src/handlers/delete_all_tweets.main
events:
- timer:
do: notRemoveHere # BUG: do not remove, there is a bug in parsing (¯\_(ツ)_/¯)
# https://github.com/serverless/serverless-azure-functions/issues/566
name: timer
schedule: 0 21 * * * # every day at 12 AM as Türkiye timezone