mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
bugfix
This commit is contained in:
30
Jenkinsfile
vendored
30
Jenkinsfile
vendored
@@ -7,6 +7,15 @@ pipeline{
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
|
||||
environment{
|
||||
|
||||
|
||||
CURRENT_TIME = """${sh(
|
||||
returnStdout: true,
|
||||
script: 'date "+%Y-%m-%d-%H-%M-%S"'
|
||||
)}"""
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,27 +24,6 @@ pipeline{
|
||||
}
|
||||
stages{
|
||||
|
||||
stage('定义变量') {
|
||||
steps {
|
||||
script {
|
||||
// 获取当前时间
|
||||
|
||||
def now = new Date()
|
||||
|
||||
// 格式化时间,例如为 yyyy-MM-dd HH:mm:ss
|
||||
def timeFormatter = new java.text.SimpleDateFormat("yyyy-MM-dd-HH-mm-ss")
|
||||
def currentTime = timeFormatter.format(now)
|
||||
|
||||
// 将格式化的当前时间存储为环境变量
|
||||
environment {
|
||||
CURRENT_TIME = currentTime
|
||||
}
|
||||
}
|
||||
|
||||
sh 'printenv'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stage("打包"){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user