diff --git a/README.md b/README.md index 5f9847d..6d93eef 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,13 @@ _Recommended version for testing newest versions of eZ Platform is PHP 7.2 for b \* *Primarily: Since this is also used to run functional testing against several PHP versions, for any other usage use the recommended image.* +## Node image + +For each php version there is an additional `-node` flavour with Node.js (latest LTS version) and Yarn installed, useful if your project needs it (for example for Webpack Encore). + ### Dev image -For each php version there is an additional `-dev` flavour with additional tools for when you need to be able to login and work towards the installation. It contains tools like vim, git, xdebug, ... [and others](php/Dockerfile-dev). +For each php version there is an additional `-dev` flavour based on Node image, with additional tools for when you need to be able to login and work towards the installation. It contains tools like vim, git, xdebug, ... [and others](php/Dockerfile-dev). ### Format version diff --git a/bin/.travis/build.sh b/bin/.travis/build.sh index 2ee0df4..704763a 100755 --- a/bin/.travis/build.sh +++ b/bin/.travis/build.sh @@ -18,5 +18,8 @@ fi # Build prod container docker build --network=host --no-cache --rm=true --pull -f php/Dockerfile-${PHP_VERSION} -t ez_php:latest php/ -# Build expanded dev container (will extend ez_php:latest, hence why --pull is skipped) +# Build expanded node container (will extend ez_php:latest, hence why --pull is skipped) +docker build --network=host --no-cache --rm=true -f php/Dockerfile-node -t ez_php:latest-node php/ + +# Build expanded dev container (will extend ez_php:latest-node, hence why --pull is skipped) docker build --network=host --no-cache --build-arg XDEBUG_CHANNEL="$XDEBUG_CHANNEL" --rm=true -f php/Dockerfile-dev -t ez_php:latest-dev php/ diff --git a/bin/.travis/push.sh b/bin/.travis/push.sh index f9bd6ac..c5f4822 100755 --- a/bin/.travis/push.sh +++ b/bin/.travis/push.sh @@ -4,6 +4,7 @@ set -e # Expects images from build.sh, as in: # - ez_php:latest +# - ez_php:latest-node # - ez_php:latest-dev validateEnvironment() @@ -27,20 +28,23 @@ fi REMOTE_IMAGE="$1" PHP_VERSION=`docker -l error run ez_php:latest php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;"` +NODE_VERSION=`docker -l error run ez_php:latest-node node -e "console.log(process.versions.node)"` docker images docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" ## TAGS -echo "About to tag remote image '${REMOTE_IMAGE}' with php version '${PHP_VERSION}'" +echo "About to tag remote image '${REMOTE_IMAGE}' with php version '${PHP_VERSION}' and Node '${NODE_VERSION}'" # "7.0" docker tag ez_php:latest "${REMOTE_IMAGE}:${PHP_VERSION}" +docker tag ez_php:latest-node "${REMOTE_IMAGE}:${PHP_VERSION}-node" docker tag ez_php:latest-dev "${REMOTE_IMAGE}:${PHP_VERSION}-dev" # "7.0-v0" if [ "$2" != "" ]; then docker tag ez_php:latest "${REMOTE_IMAGE}:${PHP_VERSION}-${2}" + docker tag ez_php:latest-node "${REMOTE_IMAGE}:${PHP_VERSION}-${2}-node" docker tag ez_php:latest-dev "${REMOTE_IMAGE}:${PHP_VERSION}-${2}-dev" fi diff --git a/bin/.travis/test.sh b/bin/.travis/test.sh index ae77330..d30531c 100755 --- a/bin/.travis/test.sh +++ b/bin/.travis/test.sh @@ -3,6 +3,7 @@ set -e # Expects images from build.sh, as in: # - ez_php:latest +# - ez_php:latest-node # - ez_php:latest-dev REUSE_VOLUME=0 @@ -52,7 +53,11 @@ if [ "$REUSE_VOLUME" = "0" ]; then bash -c "composer -v && composer create-project --prefer-dist --no-progress --no-interaction ezsystems/ezplatform /var/www $EZ_VERSION" fi - +printf "\nMake sure Node.js and Yarn are included in latest-node and latest-dev\n" +docker -l error run -a stderr ez_php:latest-node node -e "process.versions.node" +docker -l error run -a stderr ez_php:latest-dev node -e "process.versions.node" +docker -l error run -a stderr ez_php:latest-node bash -c "yarn -v" +docker -l error run -a stderr ez_php:latest-dev bash -c "yarn -v" printf "\nMinimal testing on ez_php:latest for use with ez user\n" docker run -ti --rm \ diff --git a/php/Dockerfile-dev b/php/Dockerfile-dev index cb6e98f..8c380f3 100644 --- a/php/Dockerfile-dev +++ b/php/Dockerfile-dev @@ -1,4 +1,4 @@ -FROM ez_php +FROM ez_php:latest-node ARG XDEBUG_CHANNEL="xdebug" diff --git a/php/Dockerfile-node b/php/Dockerfile-node new file mode 100644 index 0000000..4fd3d53 --- /dev/null +++ b/php/Dockerfile-node @@ -0,0 +1,11 @@ +FROM ez_php + +# Install Node.js and Yarn +RUN apt-get update -q -y \ + && apt-get install -q -y --no-install-recommends gnupg \ + && curl -sL https://deb.nodesource.com/setup_10.x | bash - \ + && apt-get install -y nodejs \ + && curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ + && sudo apt-get update && sudo apt-get install yarn \ + && rm -rf /var/lib/apt/lists/*