Skip to content

Commit

Permalink
Merge pull request #568 from shakaran/master
Browse files Browse the repository at this point in the history
Fetch composer binary from HTTPS-only
  • Loading branch information
willdurand committed Apr 27, 2015
2 parents 98f6af4 + b0d8bfa commit 20c5a9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/symfony2/symfony.rb
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
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

0 comments on commit 20c5a9c

Please sign in to comment.