@Override public Self deploy(Collection<ChangeInput> changes) { return this.deploy(changes, new MainDeployerArgs()); }
public MainDeployerArgs allChangesets(boolean allChangesets) { this.setAllChangesets(allChangesets); return this; }
MainDeployerArgs dbArgs = new MainDeployerArgs(); dbArgs.setNoPrompt(args.isNoPrompt()); dbArgs.setPerformInitOnly(args.isPerformInitOnly()); dbArgs.setPreview(args.isPreview()); dbArgs.setRollback(args.isRollback()); dbArgs.setUseBaseline(args.isUseBaseline()); dbArgs.setOnboardingMode(args.isOnboardingMode()); dbArgs.setProductVersion(args.getProductVersion()); if (args.getChangesets() != null && args.getChangesets().length > 0) { dbArgs.setChangesetNames(ArrayAdapter.adapt(args.getChangesets()).toSet().toImmutable()); dbArgs.setAllChangesets(args.isAllChangesets()); dbArgs.setChangeInclusionPredicate(ChangeKeyPredicateBuilder.parseFullPredicate(args.getChangeCriteria())); dbArgs.setSourceGraphExportFile(args.getSourceGraphExportFile()); dbArgs.setSourceGraphExportFormat(args.getSourceGraphExportFormat());
.setupEnvInfra() .cleanEnvironment() .deploy(new MainDeployerArgs().reason("try1").deployExecutionAttributes(Sets.immutable.with( new DeployExecutionAttributeImpl("A", "aval"), new DeployExecutionAttributeImpl("B", "bval") dbDeployerAppContext = getAppContext.valueOf(1); dbDeployerAppContext .deploy(new MainDeployerArgs().reason("try1a-noop").deployExecutionAttributes(Sets.immutable.with( new DeployExecutionAttributeImpl("A", "aval"), new DeployExecutionAttributeImpl("B", "bval"), dbDeployerAppContext .setupEnvInfra() .deploy(new MainDeployerArgs().reason("try2").deployExecutionAttributes(Sets.immutable.with( new DeployExecutionAttributeImpl("C", "cval2"), new DeployExecutionAttributeImpl("E", "eval") dbDeployerAppContext .setupEnvInfra() .deploy(new MainDeployerArgs().reason("try3").deployExecutionAttributes(Sets.immutable.with( new DeployExecutionAttributeImpl("F", "fval") )))
MainDeployerArgs dbArgs = new MainDeployerArgs() .noPrompt(this.noPrompt != null && this.noPrompt) .performInitOnly(performInitOnly) .preview(preview) .rollback(rollback);
private MainDeployerArgs getMainDeployerArgs() { MainDeployerArgs args = new MainDeployerArgs(); if (this.tables != null || this.views != null) { MutableList<Predicate<? super ChangeKey>> predicates = Lists.mutable.empty(); if (this.tables != null) { predicates.add(ChangeKeyPredicateBuilder.newBuilder() .setChangeTypes(ChangeType.TABLE_STR, ChangeType.FOREIGN_KEY_STR, ChangeType.TRIGGER_INCREMENTAL_OLD_STR, ChangeType.STATICDATA_STR) .setObjectNames(Sets.immutable.withAll(this.tables)) .build()); } if (this.views != null) { predicates.add(ChangeKeyPredicateBuilder.newBuilder() .setChangeTypes(ChangeType.VIEW_STR) .setObjectNames(Sets.immutable.withAll(this.views)) .build()); } args.setChangeInclusionPredicate(Predicates.or(predicates)); } args.setAllChangesets(true); // for unit tests, we always want all changes to deploy return args; }
appContext.deploy(new MainDeployerArgs().useBaseline(true));
"VIEW4 is dropped\n"); Obevo.readEnvironmentAndBuildContext("scenariotests/rollback-scenario/step1", "test") .deploy(new MainDeployerArgs().rollback(true));
.deploy(new MainDeployerArgs().onboardingMode(true)); } catch (RuntimeException exc) { exc.printStackTrace(); deployContext.deploy(new MainDeployerArgs().onboardingMode(true)); } catch (RuntimeException exc) { exc.printStackTrace(); deployContext.deploy(new MainDeployerArgs().onboardingMode(true)); } catch (RuntimeException exc) { exc.printStackTrace();
@Test public void testDeploy() { DbEnvironmentFactory.getInstance().readOneFromSourcePath("./src/test/resources/scenariotests/initusecase/step1") .buildAppContext("abc", "abc") .setupEnvInfra().cleanEnvironment() .deploy(); // TODO the SystemOutRule doesn't work w/ Maven, as no system output is captured // Leave this commented-code in; I REALLY would like to get this to work! // systemOutRule.enableLog(); DbEnvironmentFactory.getInstance().readOneFromSourcePath("./src/test/resources/scenariotests/initusecase/step2") .buildAppContext("abc", "abc") .deploy(new MainDeployerArgs().performInitOnly(true)); // init // validate that the warning message is getting printed out for doing an INIT when tables already exist // assertThat(systemOutRule.getLog(), containsString(DbDeployer.INIT_WARNING_MESSAGE)); DbEnvironmentFactory.getInstance().readOneFromSourcePath("./src/test/resources/scenariotests/initusecase/step2") .buildAppContext("abc", "abc") .deploy(); }
@Test public void testChangesetAppliedAtOnce() { DbDeployerAppContext dbDeployerAppContext = DbEnvironmentFactory.getInstance() .readOneFromSourcePath("scenariotests/changesetDeploy/step1") .buildAppContext() .setupEnvInfra().cleanEnvironment(); dbDeployerAppContext.deploy(new MainDeployerArgs().allChangesets(true)); checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", true); checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", true); checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", true); }
@Test public void testChangesetsAppliedInPhases() { DbDeployerAppContext dbDeployerAppContext = DbEnvironmentFactory.getInstance() .readOneFromSourcePath("scenariotests/changesetDeploy/step1") .buildAppContext() .setupEnvInfra().cleanEnvironment(); dbDeployerAppContext.deploy(); // in the default phase, all the checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", false); checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", false); checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", false); dbDeployerAppContext.deploy(new MainDeployerArgs().changesetNames(Sets.immutable.with("phaseA"))); checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", true); checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", true); checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", false); dbDeployerAppContext.deploy(new MainDeployerArgs().changesetNames(Sets.immutable.with("phaseB"))); checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", true); checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", true); checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", true); }
.setupEnvInfra() .cleanEnvironment() .deploy(new MainDeployerArgs().reason("try1").deployExecutionAttributes(Sets.immutable.with( new DeployExecutionAttributeImpl("A", "aval"), new DeployExecutionAttributeImpl("B", "bval") dbDeployerAppContext = getAppContext.valueOf(1); dbDeployerAppContext .deploy(new MainDeployerArgs().reason("try1a-noop").deployExecutionAttributes(Sets.immutable.with( new DeployExecutionAttributeImpl("A", "aval"), new DeployExecutionAttributeImpl("B", "bval"), dbDeployerAppContext .setupEnvInfra() .deploy(new MainDeployerArgs().reason("try2").deployExecutionAttributes(Sets.immutable.with( new DeployExecutionAttributeImpl("C", "cval2"), new DeployExecutionAttributeImpl("E", "eval") dbDeployerAppContext .setupEnvInfra() .deploy(new MainDeployerArgs().reason("try3").deployExecutionAttributes(Sets.immutable.with( new DeployExecutionAttributeImpl("F", "fval") )))
private MainDeployerArgs getMainDeployerArgs() { MainDeployerArgs args = new MainDeployerArgs(); if (this.tables != null || this.views != null) { MutableList<Predicate<? super ChangeKey>> predicates = Lists.mutable.empty(); if (this.tables != null) { predicates.add(ChangeKeyPredicateBuilder.newBuilder() .setChangeTypes(ChangeType.TABLE_STR, ChangeType.FOREIGN_KEY_STR, ChangeType.TRIGGER_INCREMENTAL_OLD_STR, ChangeType.STATICDATA_STR) .setObjectNames(Sets.immutable.withAll(this.tables)) .build()); } if (this.views != null) { predicates.add(ChangeKeyPredicateBuilder.newBuilder() .setChangeTypes(ChangeType.VIEW_STR) .setObjectNames(Sets.immutable.withAll(this.views)) .build()); } args.setChangeInclusionPredicate(Predicates.or(predicates)); } args.setAllChangesets(true); // for unit tests, we always want all changes to deploy return args; }
appContext.deploy(new MainDeployerArgs().useBaseline(true));
@Test public void testAseDeploy() throws Exception { MainDeployerArgs args1 = new MainDeployerArgs() .deployExecutionAttributes(Sets.immutable.<DeployExecutionAttribute>with( new DeployExecutionAttributeImpl("attr1", "v1_val1"), new DeployExecutionAttributeImpl("attr2", "v1_val2") )) .reason("try1"); verifyExecution1(execution1); MainDeployerArgs args2 = new MainDeployerArgs() .deployExecutionAttributes(Sets.immutable.<DeployExecutionAttribute>with( new DeployExecutionAttributeImpl("attr1", "v2_val1"), new DeployExecutionAttributeImpl("attr2", "v2_val2"), new DeployExecutionAttributeImpl("attr3", "v2_val3") )) .reason("try2"); DbDeployerAppContext context2 = getAppContext.valueOf(2); context2.setupEnvInfra().deploy(args2);
@Override public Self deploy() { return this.deploy(new MainDeployerArgs()); }
public MainDeployerArgs allChangesets(boolean allChangesets) { this.setAllChangesets(allChangesets); return this; }
@Test public void testAseDeploy() throws Exception { MainDeployerArgs args1 = new MainDeployerArgs() .deployExecutionAttributes(Sets.immutable.<DeployExecutionAttribute>with( new DeployExecutionAttributeImpl("attr1", "v1_val1"), new DeployExecutionAttributeImpl("attr2", "v1_val2") )) .reason("try1"); verifyExecution1(execution1); MainDeployerArgs args2 = new MainDeployerArgs() .deployExecutionAttributes(Sets.immutable.<DeployExecutionAttribute>with( new DeployExecutionAttributeImpl("attr1", "v2_val1"), new DeployExecutionAttributeImpl("attr2", "v2_val2"), new DeployExecutionAttributeImpl("attr3", "v2_val3") )) .reason("try2"); DbDeployerAppContext context2 = getAppContext.valueOf(2); context2.setupEnvInfra().deploy(args2);
@Override public Self deploy(Collection<ChangeInput> changes) { return this.deploy(changes, new MainDeployerArgs()); }