Updated Jenkinsfiles

This commit is contained in:
Erik Tiekstra
2021-05-17 10:07:55 +02:00
parent e21757b8e8
commit 0c567395a6
2 changed files with 5 additions and 13 deletions

View File

@@ -43,6 +43,7 @@ pipeline {
CACHE_DIRECTORY=/home/jenkins/.npm/cache
mkdir -p ${CACHE_DIRECTORY}
echo "_auth=${ENCODED}" >> .npmrc
# set -x
cat .npmrc
@@ -62,7 +63,7 @@ pipeline {
# Check if we found the cached node_modules
test -f node_modules.tar.gz
# If we found the cached node_modules, extract the files to node_modules
tar -zxf node_modules.tar.gz
(test -f node_modules.tar.gz && tar -zxf node_modules.tar.gz && echo "Using cached node_modules from ${CACHE_DIRECTORY}/$(cat hashed.pkg-lock)") || echo "No cached node_modules.tar.gz found"
# Echo to the logs stating that we are using cache
echo "Using cached node_modules from ${CACHE_DIRECTORY}/$(cat hashed.pkg-lock)"
) || true
@@ -95,12 +96,8 @@ pipeline {
steps {
echo '### Building application... ###'
sh '''
npm run build:dafa -- --prod
cp nginx/nginx.conf ${NGINX_PATH}
#cp -r nginx/* ${NGINX_PATH}
ls -la dist
npm run build:pega -- --prod
cp -r nginx/* ${NGINX_PATH}
'''
echo '### Application built! ###'
}