补全预览流水线首次触发参数
在 Jenkins Job 配置中预声明部署参数 增加 buildWithParameters 首次触发合同检查
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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/',
|
||||
|
||||
Reference in New Issue
Block a user