diff --git a/Dockerfile b/Dockerfile index 0f911ed..580224e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,18 @@ FROM php:7-alpine LABEL maintainer "nicolas.potier@acseo.fr" -RUN curl -LO https://deployer.org/deployer.phar \ - && mv deployer.phar /usr/local/bin/dep \ - && chmod +x /usr/local/bin/dep +RUN curl -LO https://deployer.org/releases/v6.6.0/deployer.phar \ + && mv deployer.phar /usr/local/bin/dep \ + && chmod +x /usr/local/bin/dep -RUN apk --no-cache add openssh-client rsync +RUN apk --no-cache add openssh-client rsync -ENTRYPOINT ["/bin/sh", "-c"] +ENV COMPOSER_HOME=/var/composer +COPY composer-install /tmp/composer-install +RUN chmod +x /tmp/composer-install +RUN /tmp/composer-install && \ + rm /tmp/composer-install + +RUN composer global require deployer/recipes --dev + +ENTRYPOINT ["/bin/sh", "-c"] diff --git a/README.md b/README.md index 7e6145c..35b0865 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,5 @@ Docker CI Deployer Image used for ACSEO Deployments with Deployer # tags history +- v6.6.0 composer to add recipes + rsync recipe - v6.2.0 symfony4 recipe support diff --git a/composer-install b/composer-install new file mode 100644 index 0000000..626b03b --- /dev/null +++ b/composer-install @@ -0,0 +1,19 @@ +#!/usr/bin/env sh + +EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") + +if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] +then + >&2 echo 'ERROR: Invalid installer signature' + rm composer-setup.php + exit 1 +fi + +php composer-setup.php --quiet +RESULT=$? +rm composer-setup.php +mv composer.phar /usr/bin/composer && chmod +x /usr/bin/composer + +exit ${RESULT}