Skip to content
Snippets Groups Projects
Commit 6d182ff7 authored by Max Melchert's avatar Max Melchert
Browse files

feat: add ssh/rsync makefile

parent d6da08d6
No related branches found
No related tags found
No related merge requests found
# Server Setup
SERVER_USER := user
SERVER_HOST := host
CONDA_PATH := /opt/conda
CONDA_ENV := base
# Project Directories
REMOTE_PATH := /path/to/server/code
LOCAL_PATH := /path/to/client/code
# Output Directory
OUTPUT_DIR := output
# Files
MAIN_SCRIPT := main.py
LOG_FILE := logfile.log
.PHONY: push exec status pull
push:
rsync -a $(LOCAL_PATH) $(SERVER_USER)@$(SERVER_HOST):$(REMOTE_PATH)
exec:
ssh $(SERVER_USER)@$(SERVER_HOST) 'cd $(REMOTE_PATH) && conda run -n $(CONDA_ENV) python $(MAIN_SCRIPT)'
status:
ssh $(SERVER_USER)@$(SERVER_HOST) 'cd $(REMOTE_PATH) && tail -n 10 $(LOG_FILE)'
pull:
rsync -a $(SERVER_USER)@$(SERVER_HOST):$(REMOTE_PATH)/$(OUTPUT_DIR) $(LOCAL_PATH)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment