vitally scripts

This commit is contained in:
sloane 2024-03-15 14:08:15 -04:00
parent 3645a4cfbe
commit d1ada1816e
No known key found for this signature in database
5 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,5 @@
function vitally-init
yarn bootstrap
yarn build
yarn migrate
end

View file

@ -0,0 +1,3 @@
function vitally-session-name
echo "vitally"
end

View file

@ -0,0 +1,20 @@
function vitally-start
set session $(vitally session-name)
set workdir $(pwd)
vitally stop
tmux new-session -d -s $session -c $workdir
tmux new-window -t "$session:" -n "build" -c $workdir
tmux new-window -t "$session:" -n "client" -c $workdir
tmux new-window -t "$session:" -n "server" -c $workdir
tmux new-window -t "$session:" -n "surveys-api" -c $workdir
tmux new-window -t "$session:" -n "job-runner" -c $workdir
tmux send-keys -t "$session:build" "yarn migrate" Enter
tmux send-keys -t "$session:build" "yarn build:watch" Enter
tmux send-keys -t "$session:client" "sleep 30; yarn client:start" Enter
tmux send-keys -t "$session:server" "sleep 35; yarn server:start" Enter
tmux send-keys -t "$session:surveys-api" "sleep 35; yarn surveys:start" Enter
tmux send-keys -t "$session:job-runner" "sleep 40; yarn job-runner:start" Enter
end

View file

@ -0,0 +1,3 @@
function vitally-stop
tmux kill-session -t $(vitally session-name) > /dev/null 2>&1
end

View file

@ -0,0 +1,9 @@
function vitally
set cmd $argv[1]
set cmds start stop session-name
if not contains $cmd $cmds
echo "usage: vitally <CMD>; <CMD>: start, stop, session-name"
else
eval "vitally-$cmd"
end
end