-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (23 loc) · 727 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (23 loc) · 727 Bytes
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
SERVER = blazerw@1702.org
REMOTE_PATH = /home/blazerw/lucky.1702.org
IMAGE_NAME = lucky-fcgi-build
LOCAL_BINARY = dispatch.fcgi
URL = https://lucky.1702.org
SSH_TIMEOUT = 15
SCP_TIMEOUT = 60
.PHONY: all build deploy test logs clean
all: build deploy test
build:
docker build -f Dockerfile.deploy -t $(IMAGE_NAME) .
-docker rm -f lucky-temp
docker create --name lucky-temp $(IMAGE_NAME)
docker cp lucky-temp:/app/examples/lucky/$(LOCAL_BINARY) ./$(LOCAL_BINARY)
docker rm lucky-temp
deploy:
timeout $(SCP_TIMEOUT) scp $(LOCAL_BINARY) $(SERVER):$(REMOTE_PATH)/$(LOCAL_BINARY)
test:
curl -I $(URL)
logs:
timeout $(SSH_TIMEOUT) ssh $(SERVER) "tail -n 150 $(REMOTE_PATH)/fastcgi.cr.log"
clean:
rm -f $(LOCAL_BINARY)