-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
66 lines (51 loc) · 1.45 KB
/
Makefile
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
SHELL := /bin/bash
ifneq (,$(wildcard ./.env))
include .env
export $(shell sed 's/=.*//' .env)
endif
all: init_yc create_function create_dotenv
test: phpcs phpunit
develop: pull_images composer_install
pull_images:
docker pull php:7.4-cli
docker pull composer:1.10.13
phpcs:
docker run --rm --interactive --tty \
--volume ${PWD}:/usr/src/oliver \
--workdir /usr/src/oliver \
php:7.4-cli ./vendor/bin/phpcs --standard=ruleset.xml
phpunit:
docker run --rm --interactive --tty \
--volume ${PWD}:/usr/src/oliver \
--workdir /usr/src/oliver \
php:7.4-cli ./vendor/bin/phpunit
logs:
yc config profile activate oliver
yc serverless function logs oliver
fixpsr12:
./vendor/bin/phpcbf --standard=ruleset.xml
init_yc:
yc init
create_function:
yc config profile activate oliver
yc serverless function create \
--name=oliver \
--description="Обработчик навыка Оливер"
composer_install:
docker run --rm --interactive --tty \
--user $$(id -u):$$(id -g) \
--volume ${PWD}:/app \
composer:1.10.13 install
create_dotenv:
cp -i .env.example .env
create_version:
zip -r oliver.zip src index.php composer.json composer.lock
yc config profile activate oliver
yc serverless function version create \
--function-name=oliver \
--runtime php74 \
--entrypoint index.main \
--memory 128m \
--execution-timeout 3s \
--environment="TINKOFF_OPEN_API_EXCHANGE=${TINKOFF_OPEN_API_EXCHANGE}" \
--source-path ./oliver.zip