Many Jenkins jobs depend on business calendars.
For teams in China, that can be difficult to model with a simple weekday/weekend check. A weekday is not always a workday, and a weekend is not always a holiday. Chinese statutory holidays and make-up workdays change every year, so Pipeline logic often needs more than basic date rules.
The Chinese Workday Plugin was created to support that use case in Jenkins.
What the plugin provides</h2>
The plugin adds Pipeline steps for Chinese workday checks:
-
isChineseWorkday(…)
-
isChineseHoliday(…)
-
chineseWorkdaySupportedYears()
It also lets administrators add or override calendar data in:
Manage Jenkins → System → Chinese Workday
This makes it possible to keep holiday calendar logic in one place instead of repeating it across Jenkinsfiles.
</div>
Example</h2>
One common use case is to run a stage only on a Chinese workday:
pipeline {
agent any
stages {
stage('Release') {
when {
expression {
isChineseWorkday()
}
}
steps {
echo 'Release runs only on a Chinese workday.'
}
}
}
}
</div>
The plugin adds Pipeline steps for Chinese workday checks:
-
isChineseWorkday(…) -
isChineseHoliday(…) -
chineseWorkdaySupportedYears()
It also lets administrators add or override calendar data in:
Manage Jenkins → System → Chinese Workday
This makes it possible to keep holiday calendar logic in one place instead of repeating it across Jenkinsfiles.
Example</h2>
One common use case is to run a stage only on a Chinese workday:
pipeline {
agent any
stages {
stage('Release') {
when {
expression {
isChineseWorkday()
}
}
steps {
echo 'Release runs only on a Chinese workday.'
}
}
}
}
</div>
One common use case is to run a stage only on a Chinese workday:
pipeline {
agent any
stages {
stage('Release') {
when {
expression {
isChineseWorkday()
}
}
steps {
echo 'Release runs only on a Chinese workday.'
}
}
}
}