migrate all non-deploy, non-canary pipelines
@@ -43,9 +43,8 @@ public class ExecutionEngineMigration implements Migration {
Observable
.from(pipelineDAO.all())
.filter(this::isV1)
- .filter(this::hasDeployStage)
+ .filter(this::hasNoDeployStage)
.filter(this::hasNoCanaryStage)
- .filter(this::deploysOnlyToTest)
.subscribe(this::migrate, this::onError);
}
@@ -53,8 +52,8 @@ public class ExecutionEngineMigration implements Migration {
return !"v2".equals(pipeline.get("executionEngine"));
}
- private boolean hasDeployStage(Pipeline pipeline) {
- return Observable
+ private boolean hasNoDeployStage(Pipeline pipeline) {
+ return !Observable
.from((List<Map<String, Object>>) pipeline.get("stages"))
.exists(stage -> "deploy".equals(stage.get("type")))
.toBlocking()
@@ -69,16 +68,6 @@ public class ExecutionEngineMigration implements Migration {
.first();
}
- private boolean deploysOnlyToTest(Pipeline pipeline) {
- return Observable
- .from((List<Map<String, Object>>) pipeline.get("stages"))
- .filter(stage -> "deploy".equals(stage.get("type")))
- .flatMapIterable(stage -> (List<Map<String, Object>>) stage.get("clusters"))
- .all(cluster -> "test".equals(cluster.get("account")))
- .toBlocking()
- .first();
- }
-
private void migrate(Pipeline pipeline) {
log.info("Migrating {} pipeline '{}' from v1 -> v2", pipeline.getApplication(), pipeline.getName());
