From b92d532c4b335fdfeee1d38de9d02772e11353af Mon Sep 17 00:00:00 2001 From: nhyatt Date: Sun, 2 Oct 2022 16:02:03 -0500 Subject: [PATCH] Directory permissions were preventing application from compiling --- build-k8s-lenz.jenkins | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/build-k8s-lenz.jenkins b/build-k8s-lenz.jenkins index ed6bbdd..ae2422c 100644 --- a/build-k8s-lenz.jenkins +++ b/build-k8s-lenz.jenkins @@ -139,14 +139,24 @@ pipeline { container (jsNodeID) { script { sh """ + printf '%s\\n' "Installing required packages" apt-get update DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y rpm + printf '%s\\n' "Setting up ROOT user build permissions" + mkdir -p /root/.npm/_logs /root/.npmrc + chmod 755 /root + chown -R 1000:1000 /root/.npm /root/.npmrc + printf '%s\\n' "Changing user to node" su - node - mkdir -p "${workspace}/lens/.npm-cache/_logs" - npm config set cache "${workspace}/lens/.npm-cache" - npm config set loglevel verbose + printf '%s\\n' "Setting up NODE user build permissions" + mkdir -p "/home/node/.npm" + printf '%s\\n' "Configuring NODE" + npm config set prefix="/home/node/.npm" + npm config set unsafe-perm true npm cache verify + printf '%s\\n' "Changing directory" cd "${workspace}/lens" + printf '%s\\n' "Building..." make build """ }