aboutsummaryrefslogtreecommitdiff
path: root/justfile
blob: a1abce40d0cdd7b9c6f3d683ff1a689f5a4889bd (plain) (blame)
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
set dotenv-load
set positional-arguments

TARGET_DIR := "/opt/project"

ssh *args:
  ssh -p "$SSH_PORT" "${SSH_USER}@${SSH_HOST}" "$@"

shell: ssh

copy *args:
  rsync -ravh --delete --exclude '.git' --exclude 'tmp' -e "ssh -p $SSH_PORT" "$@"

df:
  just ssh 'df -ah /'

upload:
  just copy . "${SSH_USER}@${SSH_HOST}:{{TARGET_DIR}}"

setup *args:
  just ssh "{{TARGET_DIR}}/setup.sh" "$@"

local-setup *args:
  mkdir -p ./tmp/uploads
  ROOT_DIR="$PWD" \
    GIT_REPOS_ROOT="$HOME/dev/projects" \
    SEND_UPLOADS_ROOT="$PWD/tmp/uploads" SEND_USER="$(id -u):$(id -g)" \
    ./setup.sh "$@"

# TODO: pull /git for backup
# TODO: Add service on home server to backup automatically?