I created such script to check md5sum of package.json in Jenkins:
stage('NPM Build') { steps { sh ''' node -v && npm -v ''' // rm -rf node_modules sh ''' CACHE_FOLDER=${HOME}/.cache/md5 echo "EXECUTOR_NUMBER: ${EXECUTOR_NUMBER}" MD5_FILE_NAME=package-json_${EXECUTOR_NUMBER}.md5sum [ -d ${CACHE_FOLDER} ] || mkdir -p ${CACHE_FOLDER} ls ${CACHE_FOLDER} if [ -f ${CACHE_FOLDER}/${MD5_FILE_NAME} ];then cp ${CACHE_FOLDER}/${MD5_FILE_NAME} ${MD5_FILE_NAME} md5sum package.json cat ${MD5_FILE_NAME} md5sum -c ${MD5_FILE_NAME} || npm ci else echo "No md5sum backup" npm ci fi echo "create new md5sum backup" md5sum package.json md5sum package.json > ${MD5_FILE_NAME} cp ${MD5_FILE_NAME} ${CACHE_FOLDER} ''' sh ''' npm run ngcc ''' sh ''' npm run build ''' } }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I created such script to check md5sum of package.json in Jenkins: