Capistrano 3 deploy failed messages - exit status

2019-08-12 16:57发布

问题:

When I deploy my Symfony2 app using Capistrano with symfony gem I get various errors such as

Running /usr/bin/env [ -L  /var/www/releases/20151014090151/app/config/parameters.yml ] as ubuntu@ec2-00-000-000-000.eu-west-1.compute.amazonaws.com 
Command: [ -L /var/www/releases/20151014090151/app/config/parameters.yml ]
Finished in 0.038 seconds with exit status 1 (failed)

and I get the same for

-f /var/www/releases/20151014120425/app/config/parameters.yml
-L /var/www/releases/20151014090151/web/.htaccess
-L /var/www/releases/20151014090151/web/robots.txt
-L /var/www/releases/20151014090151/app/logs
-d /var/www/releases/20151014120425/app/logs
SYMFONY_ENV=prod /usr/bin/env ln -s /var/www/shared/app/logs /var/www/releases/20151014120425/app/logs
-L /var/www/releases/20151014120425/web/uploads
-d /var/www/releases/20151014120425/web/uploads
-L /var/www/releases/20151014120425/src/Helios/CoreBundle/Resources/translations
-d /var/www/releases/20151014120425/src/Helios/CoreBundle/Resources/translations
-L /var/www/releases/20151014120425/app/spool
-d /var/www/releases/20151014120425/app/spool
-d /var/www/releases/20151014120425/app/cache

I am not sure what is failing or what the various flags -f -L -d mean?

The deploy completes but it just shows these failed message. Please can someone advise what they mean and how to fix please?

Thanks

回答1:

The flags are file test operators.

When Capistrano says a command fails, it just means it returns a non-0 status code. In the case of file test operators, it may be checking whether something exists before creating it, so that failure is fed into a conditional which will create the file/folder/symlink. This is normal, albeit confusing. If a critical command fails, Capistrano will stop the deployment and display an error message.