From 0b551c0cd4114234ad728d4fa3b01a7c43bee81f Mon Sep 17 00:00:00 2001 From: Vasily Date: Thu, 10 Oct 2019 10:35:11 +0300 Subject: [PATCH] Merge pull request #1861 from joshuaboniface/fix-centos-build Use NVM to install nodejs v8 and yarn for CentOS (cherry picked from commit 094852ce304c0d64747d1ade2a8a73dbf22a5b61) Signed-off-by: Joshua Boniface --- deployment/centos-package-x64/Dockerfile | 12 +++++++----- deployment/centos-package-x64/docker-build.sh | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/deployment/centos-package-x64/Dockerfile b/deployment/centos-package-x64/Dockerfile index 99f538bc29..855b0a4797 100644 --- a/deployment/centos-package-x64/Dockerfile +++ b/deployment/centos-package-x64/Dockerfile @@ -13,17 +13,19 @@ RUN yum update -y \ && yum install -y epel-release # Install build dependencies -RUN yum install -y @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel nodejs wget git +RUN yum install -y @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel wget git + +# Install recent NodeJS and Yarn +RUN wget -O- https://raw.githubusercontent.com/creationix/nvm/v0.35.0/install.sh | /bin/bash \ + && source "$HOME/.nvm/nvm.sh" \ + && nvm install v8 \ + && npm install -g yarn # Install DotNET SDK RUN rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm \ && rpmdev-setuptree \ && yum install -y dotnet-sdk-${SDK_VERSION} -# Install yarn package manager -RUN wget -q -O /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo \ - && yum install -y yarn - # Create symlinks and directories RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \ && mkdir -p ${SOURCE_DIR}/SPECS \ diff --git a/deployment/centos-package-x64/docker-build.sh b/deployment/centos-package-x64/docker-build.sh index 014f582f08..18e10661c3 100755 --- a/deployment/centos-package-x64/docker-build.sh +++ b/deployment/centos-package-x64/docker-build.sh @@ -18,6 +18,8 @@ pushd ${web_build_dir} if [[ -n ${web_branch} ]]; then checkout -b origin/${web_branch} fi +source "$HOME/.nvm/nvm.sh" +nvm use v8 yarn install mkdir -p ${web_target} mv dist/* ${web_target}/