@setup $homologacao = $server; $webhook = $slack @endsetup @servers(['sandbox'=> $homologacao]) @story('deploy', ['on' => 'sandbox']) git build config route migration @endstory @task('git') cd "{{ $path }}" git remote set-url origin https://{{ $username }}:{{ $token }}@gitlab.com/epi-use/epi-use-web.git git fetch origin {{ $branch }} git reset --hard origin/{{ $branch }} @endtask @task('build') cd "{{ $path }}" rm -rf vendor rm -rf composer.lock /opt/cpanel/ea-php81/root/usr/bin/php ~/composer install @endtask @task('config') cd {{ $path }} php -r "file_exists('.env') || copy('.env.example', '.env');" php artisan package:discover --ansi php artisan key:generate --ansi --force php artisan config:clear php artisan config:cache [ -e public/storage ] && unlink public/storage cd public ln -s ../storage/app/public storage @endtask @task('route') cd {{ $path }} php artisan route:clear php artisan route:cache @endtask @task('migration') cd {{ $path }} php artisan migrate --no-interaction --force @endtask @success @slack($webhook, '#gitlab', "Deploy em homologação do EPI-USE realizado com sucesso!") @endsuccess @error @slack($webhook, '#gitlab', "Deploy em homologação do EPI-USE falhou!") @enderror