最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Force a bamboo task to execute in re-run scenario - Stack Overflow

programmeradmin2浏览0评论

I have a bamboo plan that does the following

  1. Deploys test sources to oracle
  2. Executes FOO.BEFORE_ALL proc
  3. Executes database tests in various stages and jobs
  4. Executes FOO.AFTER_ALL proc in a final stage

This works fine for normal bamboo execution but doesn't work how I'd like in re-run scenarios.

Since FOO.AFTER_ALL is executed in a final stage it executes regardless of pass/fail of previous stages/jobs.

Is there any way to force FOO.BEFORE_ALL to be run in re-run scenarios?

The default bamboo behavior for re-runs is to start at the first failed job which is after my BEFOREALL job. Is there any way to force this job to run in re-run scenario?

Sample Bamboo plan java

private Plan createPlan() {
  return new Plan(project(), "Plan Name", "PLANKEY")
    .stages(
      new Stage("Deploy").jobs(new MyDeployJob()),
      new Stage("Setup").jobs(
        new Job("Before All", "BEFOREALL")
          .tasks(new SqlTask().inlineBody("FOO.BEFORE_ALL;"))
      ),
      new Stage("Unit Tests").jobs(
        new PlSqlTestJob("FOO.UNIT_TESTS_1"),
        new PlSqlTestJob("FOO.UNIT_TESTS_2"),
        new PlSqlTestJob("FOO.UNIT_TESTS_3")
      ),
      new Stage("Integration Tests").jobs(
        new PlSqlTestJob("FOO.INTEG_TESTS_1"),
        new PlSqlTestJob("FOO.INTEG_TESTS_2"),
        new PlSqlTestJob("FOO.INTEG_TESTS_3")
      ),
      new Stage("Tear Down")
        .finalStage(true)         
        .jobs(
          new Job("After All", "AFTERALL")
            .tasks(new SqlTask().inlineBody("FOO.AFTER_ALL;"))
        )
      )
    );
}
发布评论

评论列表(0)

  1. 暂无评论