jenkins-scripts/install/ci/Jenkinsfile
Primakov Alexandr Alexandrovich da12ce1b10 cd script
2024-08-04 10:42:38 +03:00

19 lines
692 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 lastLog = sh(returnStdout: true, script: "git log -1").trim()
if (tag) {
currentBuild.displayName = "#${BUILD_NUMBER}, tag ${tag}"
} else {
currentBuild.displayName = "#${BUILD_NUMBER}, branch ${branchName}"
}
if (CD_DIR) {
sh "cd ${CD_DIR}";
}
currentBuild.description = "#${BUILD_NUMBER}, branch ${branchName}, tag ${tag ? tag : 'no tag'}\n\n${lastLog}"
echo 'starting installing'
sh CD_DIR ? "cd ${CD_DIR} && pwd" : "pwd"
sh 'npm ci'
}