<jenkins> 管道触发器中的时区

hok*_*ang 2 timezone triggers jenkins jenkins-pipeline

我想使用管道设置带触发器的时区。

我可以在作业配置中手动设置构建触发器。

查看 Build periodically

日程 :

0 0 * * *
TZ=Asia/Seoul
Run Code Online (Sandbox Code Playgroud)

这有效!

但在管道中,以下语法有效

pipeline {
  triggers {
    cron ('0 0 * * *')
  }
}
Run Code Online (Sandbox Code Playgroud)

但这里不起作用。

cron('0 0 * * *; TZ=Asia/Seoul')

cron('''
  0 0 * * *
  TZ=Asia/Seoul
''')
Run Code Online (Sandbox Code Playgroud)
cron('0 0 * * *')
cron('TZ=Asia/Seoul')
Run Code Online (Sandbox Code Playgroud)

如何使用 cron 设置 TZ?

hok*_*ang 5

我找到了,

cron('TZ=Asia/Seoul\n0 0 * * *') 作品!