SyntaxC4-MSFT / ComposerExtension

Brings Composer Support to Azure Websites via a Site Extension
http://www.siteextensions.net
MIT License
15 stars 7 forks source link

Composer failure should halt execution of deploy.cmd #8

Closed marchie closed 8 years ago

marchie commented 8 years ago

I have encountered an issue today where Composer failed part way through retrieving dependencies. However, the partially downloaded dependencies were then copied across to the live site, which resulted in an outage.

Currently, the deploy.cmd file does not check for an error before calling the Kudu sync command:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Download Dependencies with Composer
:: -----------------

echo Install Dependencies with Composer

call composer install %COMPOSER_ARGS%

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------

echo Handling Basic Web Site deployment.

:: 1. KuduSync
call %KUDU_SYNC_CMD% -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
IF !ERRORLEVEL! NEQ 0 goto error

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Adding IF !ERRORLEVEL! NEQ 0 goto error after the call composer install %COMPOSER_ARGS% line will prevent this from happening.