-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (29 loc) · 890 Bytes
/
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
.PHONY: apollo
define SENSORS_MIGRATION_SCRIPT
CREATE TABLE data
(
id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
sensor_id VARCHAR(32) NOT NULL,
temp NUMERIC(7, 2) NOT NULL,
humidity NUMERIC(7, 2),
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()
);
CREATE INDEX created_at_index ON data (created_at DESC);
endef
export SENSORS_MIGRATION_SCRIPT
migrate:
export PGPASSWORD=apollo
psql -h localhost -U apollo apollo -c "$$SENSORS_MIGRATION_SCRIPT"
pip:
pip install -r requirements.txt
update-requirements:
pcu requirements.txt -u
check:
git add .
pre-commit run
deploy:
scp -r [!.]* coruscant:/home/manti/app/
ssh coruscant "pip install --no-warn-script-location -q -r /home/manti/app/requirements.txt"
ssh coruscant "sudo service nginx restart"
ssh coruscant "sudo systemctl daemon-reload"
ssh coruscant "sudo service server restart"