1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

Add Makefile for updater

This commit is contained in:
Maksym Pavlenko
2019-04-07 14:59:39 -07:00
parent 9800feade5
commit 4d8e727b67
4 changed files with 34 additions and 1 deletions

3
cmd/updater/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
package/
function.zip

28
cmd/updater/Makefile Normal file
View File

@@ -0,0 +1,28 @@
TIMEOUT := 300
ROLE := AWSLambdaBasicExecutionRole
NAME := Updater
build:
pip3 install --requirement requirements.txt --target package
cd package && zip -r9 ../function.zip .
zip -g function.zip function.py updater.py
deploy: build
aws --profile Podsync lambda create-function \
--function-name $(NAME) \
--role $(shell aws --profile Podsync iam get-role --role-name $(ROLE) --query 'Role.Arn' --output text) \
--runtime python3.7 \
--handler function.handler \
--zip-file fileb://function.zip \
--timeout $(TIMEOUT) \
--memory-size 128
update: build
aws --profile Podsync lambda update-function-code \
--function-name $(NAME) \
--zip-file fileb://function.zip
clean:
rm -rf package function.zip
.PHONY: deploy update clean

View File

@@ -5,7 +5,7 @@ TEST_URL = 'https://www.youtube.com/user/CNN/videos'
class TestUpdater(unittest.TestCase):
#@unittest.skip('heavy test, run manually')
@unittest.skip('heavy test, run manually')
def test_get_50(self):
resp = function.handler({
'url': 'https://www.youtube.com/channel/UCd6MoB9NC6uYN2grvUNT-Zg',

2
cmd/updater/setup.cfg Normal file
View File

@@ -0,0 +1,2 @@
[install]
prefix=