jenkins-scripts/install/ci/Jenkinsfile
Primakov Alexandr Alexandrovich d474d02217 npm ci flags
2024-08-23 10:04:06 +03:00

19 lines
968 B
Groovy

stage('install:ci') {
def tag = sh(returnStdout: true, script: "git tag --contains").trim()
def branchName = sh(returnStdout: true, script: "git rev-parse --abbrev-ref HEAD").trim()
def commit = sh(returnStdout: true, script: 'git log -1 --oneline').trim()
String commitMsg = commit.substring( commit.indexOf(' ') ).trim()
def lastLog = sh(returnStdout: true, script: "git log -1").trim()
if (tag) {
currentBuild.displayName = "#${BUILD_NUMBER}, tag ${tag}"
} else {
currentBuild.displayName = "#${BUILD_NUMBER}, branch ${branchName}"
}
String author = sh(returnStdout: true, script: "git log -1 --pretty=format:'%an'").trim()
currentBuild.description = "${author}<br />${commitMsg}"
// currentBuild.description = "#${BUILD_NUMBER}, branch ${branchName}, tag ${tag ? tag : 'no tag'}\n\n${lastLog}"
echo 'starting installing'
sh "pwd"
sh 'npm ci --progress=false --loglevel=error --fetch-retries=3'
}