补全预览流水线首次触发参数
Project CI / Repository checks (push) Successful in 1m13s
Project CI / Frontend tests (push) Successful in 4m7s
Project CI / Backend tests (push) Successful in 5m4s
Project CI / Native shell tests (push) Failing after 12m44s

在 Jenkins Job 配置中预声明部署参数
增加 buildWithParameters 首次触发合同检查
This commit is contained in:
2026-08-15 17:29:25 +08:00
parent 1746c77cb1
commit 6befa3c33a
2 changed files with 36 additions and 1 deletions
+31 -1
View File
@@ -5,7 +5,37 @@
<keepDependencies>false</keepDependencies>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions/>
<parameterDefinitions>
<hudson.model.ChoiceParameterDefinition>
<name>ACTION</name>
<description>部署、查询状态或卸载分支预览容器</description>
<choices class="java.util.Arrays$ArrayList">
<a class="string-array">
<string>DEPLOY</string>
<string>STATUS</string>
<string>UNINSTALL</string>
</a>
</choices>
</hudson.model.ChoiceParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>SOURCE_BRANCH</name>
<description>源码分支;DEPLOY 和 UNINSTALL 必填</description>
<defaultValue></defaultValue>
<trim>true</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>COMMIT_HASH</name>
<description>可选;必须是 SOURCE_BRANCH 历史中的 commit</description>
<defaultValue></defaultValue>
<trim>true</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>DEPLOYMENT_ID</name>
<description>预览实例稳定 ID</description>
<defaultValue></defaultValue>
<trim>true</trim>
</hudson.model.StringParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="workflow-cps">
+5
View File
@@ -132,6 +132,11 @@ assertIncludes(
'<scriptPath>jenkins/Jenkinsfile.preview-deployer</scriptPath>',
'Jenkins Job 必须从受保护 master 读取固定流水线。',
);
assertIncludes(
jobConfig,
'<hudson.model.ChoiceParameterDefinition>',
'Jenkins Job 首次触发前必须已经声明 buildWithParameters 参数。',
);
assertIncludes(
nginx,
'location ^~ /api/preview-deployer/',