From 5aec104ed3ba1cd95803ebe6b0ca7a5651181dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Andrieux?= Date: Thu, 17 Sep 2015 15:51:48 +0200 Subject: [PATCH 1/3] Modified source & dest for copying vendors --- lib/symfony2/symfony.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/symfony2/symfony.rb b/lib/symfony2/symfony.rb index 264f066..dfe6cb2 100644 --- a/lib/symfony2/symfony.rb +++ b/lib/symfony2/symfony.rb @@ -343,7 +343,7 @@ task :copy_vendors, :except => { :no_release => true } do capifony_pretty_print "--> Copying vendors from previous release" - run "vendorDir=#{current_path}/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir #{latest_release}; fi;" + run "vendorDir=#{current_path}/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir/. #{latest_release}/vendor; fi;" capifony_puts_ok end From 3e7d6226918bdc509f56b87747bb3b0392943462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Andrieux?= Date: Thu, 17 Sep 2015 15:55:44 +0200 Subject: [PATCH 2/3] Added missing description for the task --- lib/symfony2/symfony.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/symfony2/symfony.rb b/lib/symfony2/symfony.rb index dfe6cb2..0459325 100644 --- a/lib/symfony2/symfony.rb +++ b/lib/symfony2/symfony.rb @@ -340,6 +340,7 @@ capifony_puts_ok end + desc "Copies vendors from the previous release" task :copy_vendors, :except => { :no_release => true } do capifony_pretty_print "--> Copying vendors from previous release" From 465d7deb8894700f913628fc7af1eb568b28acaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Andrieux?= Date: Thu, 17 Sep 2015 16:26:56 +0200 Subject: [PATCH 3/3] Changed specs for vendors copying --- spec/capifony_symfony2_symfony_spec.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/capifony_symfony2_symfony_spec.rb b/spec/capifony_symfony2_symfony_spec.rb index e191801..73dfe87 100644 --- a/spec/capifony_symfony2_symfony_spec.rb +++ b/spec/capifony_symfony2_symfony_spec.rb @@ -169,7 +169,7 @@ @configuration.find_and_execute_task('symfony:composer:update') end - it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } + it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir/. /var/www/releases/20120927/vendor; fi;') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sSL https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar update --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -189,7 +189,7 @@ @configuration.find_and_execute_task('symfony:composer:update') end - it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } + it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir/. /var/www/releases/20120927/vendor; fi;') } it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sSL https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod my_composer update --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -200,7 +200,7 @@ @configuration.find_and_execute_task('symfony:composer:update') end - it { should have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } + it { should have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir/. /var/www/releases/20120927/vendor; fi;') } end context "when running symfony:composer:install with an existing composer.phar in the previous release" do @@ -209,7 +209,7 @@ @configuration.find_and_execute_task('symfony:composer:install') end - it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } + it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir/. /var/www/releases/20120927/vendor; fi;') } it { should_not have_run(' sh -c \'cp /var/www/releases/20120920/composer.phar /var/www/releases/20120927/\'') } it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sSL https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar self-update \'') } @@ -223,7 +223,7 @@ @configuration.find_and_execute_task('symfony:composer:install') end - it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } + it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir/. /var/www/releases/20120927/vendor; fi;') } it { should_not have_run(' sh -c \'cp /var/www/releases/20120920/composer.phar /var/www/releases/20120927/\'') } it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sSL https://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar self-update 1.0.0-alpha8\'') } @@ -236,7 +236,7 @@ @configuration.find_and_execute_task('symfony:composer:install') end - it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } + it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir/. /var/www/releases/20120927/vendor; fi;') } it { should_not have_run(' sh -c \'cp /var/www/releases/20120920/composer.phar /var/www/releases/20120927/\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sSL https://getcomposer.org/installer | php\'') } it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar self-update \'') } @@ -248,7 +248,7 @@ @configuration.find_and_execute_task('symfony:composer:install') end - it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } + it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir/. /var/www/releases/20120927/vendor; fi;') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sSL https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -268,7 +268,7 @@ @configuration.find_and_execute_task('symfony:composer:install') end - it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927/vendor; fi;') } + it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir/. /var/www/releases/20120927/vendor; fi;') } it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sSL https://getcomposer.org/installer | php\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod my_composer install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -279,7 +279,7 @@ @configuration.find_and_execute_task('symfony:composer:install') end - it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } + it { should_not have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir/. /var/www/releases/20120927/vendor; fi;') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sSL https://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') } it { should have_run(' sh -c \'cd /var/www/releases/20120927 && SYMFONY_ENV=prod php composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress\'') } end @@ -290,7 +290,7 @@ @configuration.find_and_execute_task('symfony:composer:install') end - it { should have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /var/www/releases/20120927; fi;') } + it { should have_run('vendorDir=/var/www/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir/. /var/www/releases/20120927/vendor; fi;') } end context "when running symfony:composer:dump_autoload" do