Lullabot / drupal9ci

Command Line Interface for implementing Continuous Integration in Drupal 9
GNU General Public License v3.0
161 stars 55 forks source link

Update composer to 1.8.4 #42

Closed salvamomo closed 5 years ago

salvamomo commented 5 years ago

The composer version used by the docker image is a bit old. ( Composer 1.7.1).

This PR pulls the 1.8.4 version.

deviantintegral commented 5 years ago

How about following https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md so we always get the latest versions on builds?

juampynr commented 5 years ago

I like @deviantintegral's suggestion!

q0rban commented 5 years ago

If it's helpful, here's some Makefile syntax for that:

https://github.com/Lullabot/tugboat-registry/blob/master/baseimage/share/Makefile#L49-L67


composer_expected_signature = $(shell wget -q -O - https://composer.github.io/installer.sig)
# Installs the latest version of Composer. Note, you should use install-php-%
# first to ensure your desired version of PHP is installed.
.PHONY: install-composer
install-composer: install-package-wget ## Installs the latest version of Composer.
    $(info Installing Composer...)
#   # The following code is adapted from https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md
    wget -O composer-setup.php https://getcomposer.org/installer
    @if ! sha384sum composer-setup.php | grep ${composer_expected_signature}; then \
        >&2 echo 'ERROR: Invalid installer signature'; \
        rm composer-setup.php; \
        exit 1; \
    fi

    php composer-setup.php --install-dir=/tmp
    mv -f /tmp/composer.phar /usr/local/bin/composer
    rm composer-setup.php
#   # Install hirak/prestissimo to speed up composer operations.
    composer --no-ansi global require hirak/prestissimo
@echo "Composer installed."```
q0rban commented 5 years ago

Whoops, nevermind, I forgot this project doesn't use Make! 😊

juampynr commented 5 years ago

Thanks anyway @q0rban!

salvamomo commented 5 years ago

@juampynr @deviantintegral All right, I think this should do it now. CircleCI passes and I was able to build the Dockerfile locally without errors, so I believe that's all needed (first time I build a Dockerfile).

juampynr commented 5 years ago

Building now at https://cloud.docker.com/repository/registry-1.docker.io/juampynr/drupal8ci/builds/b597b25a-8ca1-4d31-b259-20cf8fcd4cc5