From 2bf2b1e8ce40e88d43fe76230f564748880156cf Mon Sep 17 00:00:00 2001
From: Erick Hitter <git-contrib@ethitter.com>
Date: Sun, 12 Jun 2022 16:58:13 -0700
Subject: [PATCH] Add nvm for node management

Adding to the PHP images because certain WP-specific Grunt tasks rely on PHP,
so it makes sense to have it all in one place.

See also https://git.ethitter.com/gitlab/ci/wordpress/-/issues/1
---
 .gitlab-ci.yml     | 2 --
 php/5.6/Dockerfile | 2 ++
 php/7.0/Dockerfile | 2 ++
 php/7.1/Dockerfile | 2 ++
 php/7.2/Dockerfile | 2 ++
 php/7.3/Dockerfile | 2 ++
 php/7.4/Dockerfile | 2 ++
 php/8.1/Dockerfile | 2 ++
 8 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d75c3dc..7846466 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -268,7 +268,6 @@ build-php-7.0-dev:
     - docker push "$CI_REGISTRY_IMAGE/php:7.0-dev"
   except:
     - master
-  allow_failure: true
 
 # PHP 5.6
 build-php-5.6-master:
@@ -287,4 +286,3 @@ build-php-5.6-dev:
     - docker push "$CI_REGISTRY_IMAGE/php:5.6-dev"
   except:
     - master
-  allow_failure: true
diff --git a/php/5.6/Dockerfile b/php/5.6/Dockerfile
index ea0fcd8..2451f31 100644
--- a/php/5.6/Dockerfile
+++ b/php/5.6/Dockerfile
@@ -31,6 +31,8 @@ RUN docker-php-ext-install \
       bz2 \
     && php -m
 
+ENV NVM_DIR /usr/local/nvm
+
 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
diff --git a/php/7.0/Dockerfile b/php/7.0/Dockerfile
index 72fa36e..2924c13 100644
--- a/php/7.0/Dockerfile
+++ b/php/7.0/Dockerfile
@@ -31,6 +31,8 @@ RUN docker-php-ext-install \
       bz2 \
     && php -m
 
+ENV NVM_DIR /usr/local/nvm
+
 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
diff --git a/php/7.1/Dockerfile b/php/7.1/Dockerfile
index 78dbd25..580f37d 100644
--- a/php/7.1/Dockerfile
+++ b/php/7.1/Dockerfile
@@ -31,6 +31,8 @@ RUN docker-php-ext-install \
       bz2 \
     && php -m
 
+ENV NVM_DIR /usr/local/nvm
+
 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
diff --git a/php/7.2/Dockerfile b/php/7.2/Dockerfile
index b76b3a4..249f0b4 100644
--- a/php/7.2/Dockerfile
+++ b/php/7.2/Dockerfile
@@ -32,6 +32,8 @@ RUN docker-php-ext-install \
     && pecl install xdebug \
     && php -m
 
+ENV NVM_DIR /usr/local/nvm
+
 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
diff --git a/php/7.3/Dockerfile b/php/7.3/Dockerfile
index 696c8c8..908e677 100644
--- a/php/7.3/Dockerfile
+++ b/php/7.3/Dockerfile
@@ -32,6 +32,8 @@ RUN docker-php-ext-install \
     && pecl install xdebug \
     && php -m
 
+ENV NVM_DIR /usr/local/nvm
+
 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
diff --git a/php/7.4/Dockerfile b/php/7.4/Dockerfile
index 96672f6..cfcbbf0 100644
--- a/php/7.4/Dockerfile
+++ b/php/7.4/Dockerfile
@@ -32,6 +32,8 @@ RUN docker-php-ext-install \
     && pecl install xdebug \
     && php -m
 
+ENV NVM_DIR /usr/local/nvm
+
 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
diff --git a/php/8.1/Dockerfile b/php/8.1/Dockerfile
index 2d05777..f7b79e0 100644
--- a/php/8.1/Dockerfile
+++ b/php/8.1/Dockerfile
@@ -32,6 +32,8 @@ RUN docker-php-ext-install \
     && pecl install xdebug \
     && php -m
 
+ENV NVM_DIR /usr/local/nvm
+
 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
-- 
GitLab