jenkins-scripts/install/ci/Jenkinsfile
Primakov Alexandr Alexandrovich 9bccd1f0a1 edit description
2024-08-05 12:58:55 +03:00

19 lines
916 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'
}