Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed the way to copy composer's vendors #585

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/symfony2/symfony.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,11 @@
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"

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

Expand Down
20 changes: 10 additions & 10 deletions spec/capifony_symfony2_symfony_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 \'') }
Expand All @@ -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\'') }
Expand All @@ -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 \'') }
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down