vitally scripts
This commit is contained in:
parent
3645a4cfbe
commit
d1ada1816e
5 changed files with 40 additions and 0 deletions
5
.config/fish/functions/vitally-init.fish
Normal file
5
.config/fish/functions/vitally-init.fish
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
function vitally-init
|
||||||
|
yarn bootstrap
|
||||||
|
yarn build
|
||||||
|
yarn migrate
|
||||||
|
end
|
3
.config/fish/functions/vitally-session-name.fish
Normal file
3
.config/fish/functions/vitally-session-name.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function vitally-session-name
|
||||||
|
echo "vitally"
|
||||||
|
end
|
20
.config/fish/functions/vitally-start.fish
Normal file
20
.config/fish/functions/vitally-start.fish
Normal 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
|
3
.config/fish/functions/vitally-stop.fish
Normal file
3
.config/fish/functions/vitally-stop.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function vitally-stop
|
||||||
|
tmux kill-session -t $(vitally session-name) > /dev/null 2>&1
|
||||||
|
end
|
9
.config/fish/functions/vitally.fish
Normal file
9
.config/fish/functions/vitally.fish
Normal 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
|
Loading…
Reference in a new issue