jenkins-scripts/install/ci/Jenkinsfile

14 lines
790 B
Plaintext
Raw Normal View History

2022-09-17 18:45:43 +03:00
stage('install:ci') {
2024-04-11 12:50:46 +03:00
def tag = sh(returnStdout: true, script: "git tag --contains").trim()
def branchName = sh(returnStdout: true, script: "git rev-parse --abbrev-ref HEAD").trim()
2024-04-11 13:02:51 +03:00
// def lastLog = sh(returnStdout: true, script: "git log -1").trim()
def lastLog = sh(returnStdout: true, script: "git show -s --format='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative").trim()
2024-04-11 12:47:41 +03:00
if (tag) {
2024-04-11 12:50:46 +03:00
currentBuild.displayName = "#${BUILD_NUMBER}, tag ${tag}"
2024-04-11 12:47:41 +03:00
} else {
2024-04-11 12:50:46 +03:00
currentBuild.displayName = "#${BUILD_NUMBER}, branch ${branchName}"
2024-04-11 12:47:41 +03:00
}
2024-04-11 12:56:36 +03:00
currentBuild.description = "#${BUILD_NUMBER}, branch ${branchName}, tag ${tag ? tag : 'no tag'}\n\n${lastLog}"
2022-09-17 18:45:43 +03:00
echo 'starting installing'
sh 'npm ci'
}