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

Fetch composer binary from HTTPS-only #568

Merged
merged 2 commits into from
Apr 27, 2015
Merged
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
4 changes: 2 additions & 2 deletions lib/symfony2/symfony.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@
# Because we always install to temp location we assume that we download composer every time.
logger.debug "Downloading composer to #{$temp_destination}"
capifony_pretty_print "--> Downloading Composer to temp location"
run_locally "cd #{$temp_destination} && curl -s http://getcomposer.org/installer | #{php_bin}#{install_options}"
run_locally "cd #{$temp_destination} && curl -sS https://getcomposer.org/installer | #{php_bin}#{install_options}"
else
if !remote_file_exists?("#{latest_release}/composer.phar")
capifony_pretty_print "--> Downloading Composer"

run "#{try_sudo} sh -c 'cd #{latest_release} && curl -s http://getcomposer.org/installer | #{php_bin}#{install_options}'"
run "#{try_sudo} sh -c 'cd #{latest_release} && curl -sS https://getcomposer.org/installer | #{php_bin}#{install_options}'"
else
capifony_pretty_print "--> Updating Composer"

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 @@ -170,7 +170,7 @@
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 have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') }
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS 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 @@ -190,7 +190,7 @@
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(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') }
it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS 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 @@ -211,7 +211,7 @@

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(' 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 -s http://getcomposer.org/installer | php\'') }
it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') }
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar self-update \'') }
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 @@ -225,7 +225,7 @@

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(' 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 -s http://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') }
it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS 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\'') }
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 @@ -238,7 +238,7 @@

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(' 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 -s http://getcomposer.org/installer | php\'') }
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') }
it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar self-update \'') }
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 @@ -249,7 +249,7 @@
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 have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') }
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS 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 @@ -269,7 +269,7 @@
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(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') }
it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS 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 @@ -280,7 +280,7 @@
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 have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php -- --version=1.0.0-alpha8\'') }
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS 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 @@ -298,7 +298,7 @@
@configuration.find_and_execute_task('symfony:composer:dump_autoload')
end

it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') }
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') }
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php composer.phar dump-autoload --optimize\'') }
end

Expand All @@ -308,7 +308,7 @@
@configuration.find_and_execute_task('symfony:composer:dump_autoload')
end

it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -s http://getcomposer.org/installer | php\'') }
it { should_not have_run(' sh -c \'cd /var/www/releases/20120927 && curl -sS https://getcomposer.org/installer | php\'') }
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && my_composer dump-autoload --optimize\'') }
end

Expand Down