From c04e8df12aa349beef39adff8ac631c466ae7f94 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Mon, 28 Nov 2022 07:29:43 +0000 Subject: [PATCH] Added sourcing of .bashrc to Jenkinsfile. --- Jenkinsfile | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d6e1ff0..cb984a5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,26 +8,39 @@ pipeline { steps { sh 'curl -fsSL https://fnm.vercel.app/install | bash' sh 'fnm install' - sh 'fnm use' - sh 'npm install' + sh ''' + echo 'eval "$(fnm env --use-on-cd)"' >> ~/.bashrc + source ~/.bashrc + fnm use + npm install + ''' } } stage("test") { steps { - sh 'npm run test:junit' + sh ''' + source ~/.bashrc + npm run test:junit + ''' junit 'junit/*.xml' } } stage("build") { steps { - sh 'npm run build:prod' + sh ''' + source ~/.bashrc + npm run build:prod + ''' fingerprint "dist/**" archiveArtifacts artifacts: 'dist/audioshowkit.js', followSymlinks: false } } stage("generate docs") { steps { - sh 'npm run docs' + sh ''' + source ~/.bashrc + npm run docs + ''' publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: './docs', reportFiles: 'index.html', reportName: 'AudioShowKit Docs', reportTitles: '']) } }