Added sourcing of .bashrc to Jenkinsfile.

This commit is contained in:
Harrison Deng 2022-11-28 07:29:43 +00:00
parent bc5e4b09eb
commit c04e8df12a

23
Jenkinsfile vendored
View File

@ -8,26 +8,39 @@ pipeline {
steps { steps {
sh 'curl -fsSL https://fnm.vercel.app/install | bash' sh 'curl -fsSL https://fnm.vercel.app/install | bash'
sh 'fnm install' sh 'fnm install'
sh 'fnm use' sh '''
sh 'npm install' echo 'eval "$(fnm env --use-on-cd)"' >> ~/.bashrc
source ~/.bashrc
fnm use
npm install
'''
} }
} }
stage("test") { stage("test") {
steps { steps {
sh 'npm run test:junit' sh '''
source ~/.bashrc
npm run test:junit
'''
junit 'junit/*.xml' junit 'junit/*.xml'
} }
} }
stage("build") { stage("build") {
steps { steps {
sh 'npm run build:prod' sh '''
source ~/.bashrc
npm run build:prod
'''
fingerprint "dist/**" fingerprint "dist/**"
archiveArtifacts artifacts: 'dist/audioshowkit.js', followSymlinks: false archiveArtifacts artifacts: 'dist/audioshowkit.js', followSymlinks: false
} }
} }
stage("generate docs") { stage("generate docs") {
steps { 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: '']) publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: './docs', reportFiles: 'index.html', reportName: 'AudioShowKit Docs', reportTitles: ''])
} }
} }