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:
3
cmd/updater/.gitignore
vendored
Normal file
3
cmd/updater/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
package/
|
||||
|
||||
function.zip
|
||||
28
cmd/updater/Makefile
Normal file
28
cmd/updater/Makefile
Normal 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
|
||||
@@ -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
2
cmd/updater/setup.cfg
Normal file
@@ -0,0 +1,2 @@
|
||||
[install]
|
||||
prefix=
|
||||
Reference in New Issue
Block a user