Skip to content

Commit

Permalink
Merge pull request #47 from lahma/allow_output_disable
Browse files Browse the repository at this point in the history
Allow disabling of script output (backups, scripts), log files are retained
  • Loading branch information
ferventcoder committed Jan 18, 2012
2 parents c162fb4 + 12b29f5 commit c7b4a70
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
6 changes: 6 additions & 0 deletions product/roundhouse.console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ private static void parse_arguments_and_set_up_configuration(ConfigurationProper
"OutputPath - This is where everything related to the migration is stored. This includes any backups, all items that ran, permission dumps, logs, etc. Defaults to \"{0}\".",
ApplicationParameters.default_output_path),
option => configuration.OutputPath = option)
//output
.Add("disableoutput",
string.Format(
"DisableoOutput - Disable output of backups, items ran, permissions dumps, etc. Log files are kept. Useful for example in CI environment. Defaults to \"{0}\".",
ApplicationParameters.default_disable_output),
option => configuration.DisableOutput = option != null)
//warn on changes
.Add("w|warnononetimescriptchanges",
"WarnOnOneTimeScriptChanges - If you do not want RH to error when you change scripts that should not change, you must set this flag. One time scripts are DDL/DML (anything in the upFolder). Defaults to false.",
Expand Down
2 changes: 2 additions & 0 deletions product/roundhouse.tasks/Roundhouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ bool ITask.Execute()

public bool SearchAllSubdirectoriesInsteadOfTraverse { get; set; }

public bool DisableOutput { get; set; }

#endregion

public void run_the_task()
Expand Down
1 change: 1 addition & 0 deletions product/roundhouse/consoles/DefaultConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ public sealed class DefaultConfiguration : ConfigurationPropertyHolder
public bool RunAllAnyTimeScripts { get; set; }
public bool DisableTokenReplacement { get; set; }
public bool SearchAllSubdirectoriesInsteadOfTraverse { get; set; }
public bool DisableOutput { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ public interface ConfigurationPropertyHolder
bool RunAllAnyTimeScripts { get; set; }
bool DisableTokenReplacement { get; set; }
bool SearchAllSubdirectoriesInsteadOfTraverse { get; set; }
bool DisableOutput { get; set; }
}
}
1 change: 1 addition & 0 deletions product/roundhouse/infrastructure/ApplicationParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static class ApplicationParameters
public static readonly int default_command_timeout = 60;
public static readonly int default_admin_command_timeout = 300;
public static readonly int default_restore_timeout = 900;
public static readonly bool default_disable_output = false;

public static string get_merged_assembly_name()
{
Expand Down
13 changes: 8 additions & 5 deletions product/roundhouse/runners/RoundhouseMigrationRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,14 @@ private string replace_tokens(string sql_text)

private void copy_to_change_drop_folder(string sql_file_ran, Folder migration_folder)
{
string destination_file = file_system.combine_paths(known_folders.change_drop.folder_full_path, "itemsRan",
sql_file_ran.Replace(migration_folder.folder_path + "\\", string.Empty));
file_system.verify_or_create_directory(file_system.get_directory_name_from(destination_file));
Log.bound_to(this).log_a_debug_event_containing("Copying file {0} to {1}.", file_system.get_file_name_from(sql_file_ran), destination_file);
file_system.file_copy_unsafe(sql_file_ran, destination_file, true);
if (!configuration.DisableOutput)
{
string destination_file = file_system.combine_paths(known_folders.change_drop.folder_full_path, "itemsRan",
sql_file_ran.Replace(migration_folder.folder_path + "\\", string.Empty));
file_system.verify_or_create_directory(file_system.get_directory_name_from(destination_file));
Log.bound_to(this).log_a_debug_event_containing("Copying file {0} to {1}.", file_system.get_file_name_from(sql_file_ran), destination_file);
file_system.file_copy_unsafe(sql_file_ran, destination_file, true);
}
}
}
}

0 comments on commit c7b4a70

Please sign in to comment.