feat: 添加版本信息生成步骤,输出构建号、提交哈希、分支和时间
This commit is contained in:
1 parent
7bafbf9e64
commit
db1a5264d3
1 file changed
+17
Vendored
+17
@@ -48,6 +48,23 @@ environment {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Version') {
|
||||
steps {
|
||||
dir('dashboard') {
|
||||
sh '''
|
||||
cat > dist/version.json <<EOF
|
||||
{
|
||||
"buildNumber": "${BUILD_NUMBER}",
|
||||
"commit": "$(git rev-parse --short HEAD)",
|
||||
"branch": "$(git branch --show-current)",
|
||||
"time": "$(date '+%Y-%m-%d %H:%M:%S')"
|
||||
}
|
||||
EOF
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Package') {
|
||||
steps {
|
||||
// Package frontend
|
||||
|
||||
Reference in new issue
Block a user