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

@@ -45,9 +45,6 @@ pipeline {
mkdir -p ${CACHE_DIRECTORY} mkdir -p ${CACHE_DIRECTORY}
echo "_auth=${ENCODED}" >> .npmrc echo "_auth=${ENCODED}" >> .npmrc
node -v
npm -v
# set -x # set -x
cat .npmrc cat .npmrc
@@ -99,9 +96,7 @@ pipeline {
echo '### Building application... ###' echo '### Building application... ###'
sh ''' sh '''
npm run build:pega npm run build:pega
#cp nginx/nginx.conf ${NGINX_PATH}
cp -r nginx/* ${NGINX_PATH} cp -r nginx/* ${NGINX_PATH}
''' '''

View File

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