Exemplo n.º 1
0
 private void updateApproval(String pipelineName, String ftStage, Approval manualApproval) {
   CruiseConfig cruiseConfig = loadForEdit();
   PipelineConfig pipelineConfig =
       cruiseConfig.pipelineConfigByName(new CaseInsensitiveString(pipelineName));
   StageConfig config = pipelineConfig.findBy(new CaseInsensitiveString(ftStage));
   config.updateApproval(manualApproval);
   writeConfigFile(cruiseConfig);
 }
Exemplo n.º 2
0
 public void setOperatePermissionForStage(String pipelineName, String stageName, String username) {
   CruiseConfig cruiseConfig = loadForEdit();
   StageConfig stageConfig =
       cruiseConfig
           .pipelineConfigByName(new CaseInsensitiveString(pipelineName))
           .findBy(new CaseInsensitiveString(stageName));
   stageConfig.updateApproval(
       new Approval(new AuthConfig(new AdminUser(new CaseInsensitiveString(username)))));
   writeConfigFile(cruiseConfig);
 }