@servers(['web' => 'root@zielonepogotowie.app' , 'local'=>'localhost']) @setup $app =[ 'root_dir'=>'/var/www/html', 'dir'=>'/var/www/html/dr-kwiatek-app', 'repo'=>'ssh://zielone-pogotowie@dev.haifai.pl:/var/git/dr-kwiatek-app.git' ]; $server_array = [ 'web' =>'root@zielonepogotowie.app' ]; @endsetup @story('update') build clear:send send restart @endstory @task('build', ['on' => 'local']) npm run build:ssr @endtask @task('clear:send', ['on' => 'web']) cd {{$app['dir']}} [ -e dist2 ] && rm -R dist2 echo Cleared @endtask @task('send', ['on' => 'local']) [ -e dist2 ] && rm -R dist2 mv dist dist2 [ -e dist2 ] && rsync -rh dist2 {{$server_array['web']}}:{{$app['dir']}} @endtask @task('restart', ['on' => 'web']) cd {{$app['dir']}} {{-- pm2 stop server --}} [ -e old ] && rm -R old mv dist old mv dist2 dist pm2 reload zielone-cluster @endtask