Я создал файл Envoy.blade.php для развертывания, однако, когда я запускаю envoy run deploy
, я получаю синтаксическую ошибку.Я пытался найти ошибку, но не вижу ее.
Envoy.blade.php
@setup
// user on web-server
$user = 'root';
$timezone = 'Europe/Moscow';
// path to the directory on web-server
$path = '/var/www/';
$current = path . '/current';
// where take your code (git clone)
$repo = 'git@github.com';
$branch = 'master';
// Directory and files with chmod 755
$chmod = [
'storage/logs'
];
$date = new DateTime('now', new DateTimeZone($timezone));
$release = $path .'/release'. $date->format('YmdHis');
@endsetup
@servers(['production' => $user . '@5.453.20.189'])
@task('clone', ['on' => $on])
mkdir -p {{ $release }}
git clone --depth l -b {{ $branch }} "{{ $repo }}" {{ $release }}
echo "#1 - Repository has been cloned"
@endtask
{{-- Runs a fresh installation --}}
@task('composer', ['on' => $on])
composer self-update
cd {{ $release }}
composer install --no-interaction --no-dev --prefer-dist
echo "#2 - Composer dependencies have been installed"
@endtask
{{-- Updates composer, then runs a fresh unstallation --}}
@task('artisan', ['on' => $on])
cd {{ $release }}
ln -nfs {{ $path }}/.env .env;
chfrp -h www-data .env;
php artisan config:clear
php artisan migrate
php artisan clear-compiled --env-production;
php artisan optimize --env-production;
echo "#3 Production dependencies have been installed"
@endtask
{{-- Set permissions for various files and directories --}}
@task('chmod', ['on' => $on])
chgrp -R www-data {{ $release }};
chmod -R ug+rwx {{ $release }};
@foreach($chmod as $file)
chmod -R 775 {{ $release }}/{{ $file }}
chown -R {{ $user }}:www-data {{ $release }}/{{ $file }}
echo "Permissions have been set for {{ $file }}"
@endforeach
echo "#4 - Permissions has been set"
@endtask
@task('update_symlinks')
ln -nfs {{ $release }} {{ $current }};
chgrp -h www-data {{ $current }};
echo "#5 - Symlinks has beeb set"
@endtask
{{-- Run all deployment task --}}
@macro('deploy', ['on', => 'production'])
clone
composer
artisan
chmod
update_symlinks
@endmacro
Я получаю ошибку в строке 79 после запускакоманда envoy run deploy
.Пожалуйста, помогите мне найти ошибку.