Thursday 15 March 2012

php - Running "composer update" within a Windows .bat file -



php - Running "composer update" within a Windows .bat file -

i've updated app utilize composer dependencies. part of this, i've updated deploy script - combo of grunt tasks , batch file - include "composer update" after doing "git pull".

however, i'm finding although composer update runs successfully, none of commands in rest of batch file after line run. if take "composer update" line out, else runs fine (but of course of study risk having out of date/missing dependencies).

edit: total .bat file. without composer update line, runs exclusively - it, skips out next part of deploy process.

this creates new date-stamped folder in \versions\, updates repository & updates composer dependencies in main repo folder, git checkout-index new version folder, uses xcopy re-create vendor folder composer dependencies new version (because it's ignored git) , updates symlinks, including \current\ symlink used iis site root folder.

@echo off /f "tokens=2-4 delims=/ " %%a in ('date /t') (set mydate=%%c-%%a-%%b) /f "tokens=1-2 delims=/:" %%a in ('time /t') (set mytime=%%a%%b) set date=%mydate%_%mytime% mkdir "c:\inetpub\appname\versions\%date%" cd "c:\inetpub\appname\repository" git pull origin master composer update git checkout-index -a -f --prefix="c:\inetpub\appname\versions\%date%\\" cd "c:\inetpub\appname\versions\%date%\\" xcopy /e /y /q "c:\inetpub\appname\repository\www\app\vendor" "www\app\vendor" del /q www\app\webroot\files rmdir www\app\webroot\files cd "c:\inetpub\appname\" mklink /d "c:\inetpub\appname\versions\%date%\www\app\tmp" "c:\inetpub\appname_tmp" mklink /d "c:\inetpub\appname\versions\%date%\www\app\webroot\files" "e:\appname_files" rmdir current mklink /d current "c:\inetpub\appname\versions\%date%\www" appcmd recycle apppool /apppool.name:"localhost"

sounds typo in script. possible paste script on gist or code share? if composer update running correctly, it's in way script written. also, should never run composer update in deployment scripts. deployment scripts should utilize "composer install"

php batch-file composer-php

No comments:

Post a Comment