Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing roundhouse folder path options #52

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified lib/references/roundhouse/roundhouse.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion product/dropkick.tests/Tasks/RoundhousE/RoundhousETest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void TestRoundhousE()
};
var task = new RoundhousETask(connection,
@"C:\Solutions\roundhouse\code_drop\sample\db\SQLServer\TestRoundhousE", "TEST",
RoundhousEMode.DropCreate,DatabaseRecoveryMode.Simple,string.Empty,0,string.Empty,"git://somehwere","","",0,0, "", "", "", "", "", "", "", null, null);
RoundhousEMode.DropCreate,DatabaseRecoveryMode.Simple,string.Empty,0,string.Empty,"git://somehwere","","",0,0, "", "", "", "", "", "", "", null, null, "", "", "", "", "", "", "");
DeploymentResult results = task.Execute();

System.Console.WriteLine(results);
Expand Down
15 changes: 15 additions & 0 deletions product/dropkick/Configuration/Dsl/NServiceBusHost/Action.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

namespace dropkick.Configuration.Dsl.NServiceBusHost
{
public enum Action
{
/// <summary>
/// Install the NServiceBus host
/// </summary>
Install,
/// <summary>
/// Uninstall the NServceBus host
/// </summary>
Uninstall
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// specific language governing permissions and limitations under the License.
namespace dropkick.Configuration.Dsl.NServiceBusHost
{
using System;
using DeploymentModel;
using FileSystem;
using Tasks;
Expand All @@ -31,10 +32,17 @@ public class NServiceBusHostConfigurator :
string _password;
string _username;
string _profiles;
Action _action;

public NServiceBusHostConfigurator(Path path)
{
_path = path;
_action = NServiceBusHost.Action.Install;
}

public void Action(Action action)
{
_action = action;
}

public void ExeName(string name)
Expand Down Expand Up @@ -81,14 +89,45 @@ public void Profiles(string profiles)
public override void RegisterRealTasks(PhysicalServer site)
{
var location = _path.GetPhysicalPath(site, _location, true);
switch (_action)
{
case NServiceBusHost.Action.Install:
RegisterInstallTasks(site, location);
break;
case NServiceBusHost.Action.Uninstall:
RegisterUninstallTasks(site, location);
break;
default:
throw new NotImplementedException(String.Format("Action [{0}] has not been implemented.", Enum.GetName(typeof(Action), _action)));
}
}

public void RegisterInstallTasks(PhysicalServer site, string location)
{
if (site.IsLocal)
{
site.AddTask(new LocalNServiceBusHostTask(_exeName, location, _instanceName, _username, _password, _serviceName, _displayName, _description, _profiles));
site.AddTask(new LocalNServiceBusHostInstallTask(_exeName, location, _instanceName, _username,
_password, _serviceName, _displayName, _description,
_profiles));
}
else
{
site.AddTask(new RemoteNServiceBusHostTask(_exeName, location, _instanceName, site, _username, _password, _serviceName, _displayName, _description, _profiles));
site.AddTask(new RemoteNServiceBusHostInstallTask(_exeName, location, _instanceName, site, _username,
_password, _serviceName, _displayName, _description,
_profiles));
}
}

public void RegisterUninstallTasks(PhysicalServer site, string location)
{
if (site.IsLocal)
{
site.AddTask(new LocalNServiceBusHostUninstallTask(_exeName, location, _instanceName, _serviceName));
}
else
{
site.AddTask(new RemoteNServiceBusHostUninstallTask(_exeName, location, _instanceName, site, _serviceName));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace dropkick.Configuration.Dsl.NServiceBusHost
{
public interface NServiceBusHostOptions
{
void Action(Action action);
void ExeName(string name);
void Instance(string name);
void LocatedAt(string location);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@ public interface RoundhousEOptions
RoundhousEOptions WithVersionXPath(string versionXPath);
RoundhousEOptions WithCommandTimeout(int timeout);
RoundhousEOptions WithCommandTimeoutAdmin(int timeout);
RoundhousEOptions WithAlterDatabaseFolder(string alterDatabaseFolderName);
RoundhousEOptions WithRunAfterCreateDatabaseFolder(string runAfterCreateDatabaseFolderName);
RoundhousEOptions WithRunBeforeUpFolder(string runBeforeUpFolderName);
RoundhousEOptions WithUpFolder(string upFolderName);
RoundhousEOptions WithRunFirstAfterUpFolder(string runFirstAfterUpFolderName);
RoundhousEOptions WithFunctionsFolder(string functionsFolderName);
RoundhousEOptions WithSprocsFolder(string sprocsFolderName);
RoundhousEOptions WithViewsFolder(string viewsFolderName);
RoundhousEOptions WithUpFolder(string upFolderName);
RoundhousEOptions WithSprocsFolder(string sprocsFolderName);
RoundhousEOptions WithIndexesFolder(string indexesFolderName);
RoundhousEOptions WithRunAfterOtherAnyTimeScriptsFolder(string runAfterAnyOtherTimeScriptsFolderName);
RoundhousEOptions WithPermissionsFolder(string permissionsFolderName);
RoundhousEOptions WithVersionTable(string versionTable);
RoundhousEOptions WithScriptsRunTable(string scriptsRunTable);
RoundhousEOptions WithScriptsRunErrorTable(string scriptsRunErrorTable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@

namespace dropkick.Configuration.Dsl.RoundhousE
{
using System;
using DeploymentModel;
using Tasks.RoundhousE;
using Tasks;
using Tasks.RoundhousE;

public class RoundhousEProtoTask :
BaseProtoTask,
Expand All @@ -44,10 +43,17 @@ public class RoundhousEProtoTask :
private int _restoreTimeout;
private int _commandTimeoutAdmin;

private string _alterDatabaseFolderName;
private string _runAfterCreateDatabaseFolderName;
private string _runBeforeUpFolderName;
private string _upFolderName;
private string _runFirstAfterUpFolderName;
private string _functionsFolderName;
private string _sprocsFolderName;
private string _viewsFolderName;
private string _upFolderName;
private string _sprocsFolderName;
private string _indexesFolderName;
private string _runAfterOtherAnyTimeScriptsFolderName;
private string _permissionsFolderName;
private string _versionTable;
private string _scriptsRunTable;
private string _scriptsRunErrorTable;
Expand Down Expand Up @@ -78,6 +84,12 @@ public RoundhousEOptions WithScriptsFolder(string scriptsLocation)
return this;
}

public RoundhousEOptions WithRunFirstAfterUpFolder(string runFirstAfterUpFolderName)
{
_runFirstAfterUpFolderName = ReplaceTokens(runFirstAfterUpFolderName);
return this;
}

public RoundhousEOptions WithFunctionsFolder(string functionsFolderName)
{
_functionsFolderName = ReplaceTokens(functionsFolderName);
Expand All @@ -90,12 +102,42 @@ public RoundhousEOptions WithSprocsFolder(string sprocsFolderName)
return this;
}

public RoundhousEOptions WithIndexesFolder(string indexesFolderName)
{
_indexesFolderName = ReplaceTokens(indexesFolderName);
return this;
}

public RoundhousEOptions WithRunAfterOtherAnyTimeScriptsFolder(string runAfterAnyOtherTimeScriptsFolderName)
{
_runAfterOtherAnyTimeScriptsFolderName = ReplaceTokens(runAfterAnyOtherTimeScriptsFolderName);
return this;
}

public RoundhousEOptions WithPermissionsFolder(string permissionsFolderName)
{
_permissionsFolderName = ReplaceTokens(permissionsFolderName);
return this;
}

public RoundhousEOptions WithViewsFolder(string viewsFolderName)
{
_viewsFolderName = ReplaceTokens(viewsFolderName);
return this;
}

public RoundhousEOptions WithRunAfterCreateDatabaseFolder(string runAfterCreateDatabaseFolderName)
{
_runAfterCreateDatabaseFolderName = ReplaceTokens(runAfterCreateDatabaseFolderName);
return this;
}

public RoundhousEOptions WithRunBeforeUpFolder(string runBeforeUpFolderName)
{
_runBeforeUpFolderName = ReplaceTokens(runBeforeUpFolderName);
return this;
}

public RoundhousEOptions WithUpFolder(string upFolderName)
{
_upFolderName = ReplaceTokens(upFolderName);
Expand Down Expand Up @@ -186,6 +228,12 @@ public RoundhousEOptions WithCommandTimeoutAdmin(int timeout)
return this;
}

public RoundhousEOptions WithAlterDatabaseFolder(string alterDatabaseFolderName)
{
_alterDatabaseFolderName = ReplaceTokens(alterDatabaseFolderName);
return this;
}


public RoundhousEOptions WithRestoreCustomOptions(string options)
{
Expand Down Expand Up @@ -220,14 +268,15 @@ public override void RegisterRealTasks(PhysicalServer site)
UserName = _userName,
Password = _password
};
// string scriptsLocation = PathConverter.Convert(site, _path.GetFullPath(_scriptsLocation));

var task = new RoundhousETask(connectionInfo, _scriptsLocation,
_environmentName, _roundhouseMode,
_recoveryMode, _restorePath, _restoreTimeout, _restoreCustomOptions,
_repositoryPath, _versionFile, _versionXPath, _commandTimeout, _commandTimeoutAdmin,
_functionsFolderName, _sprocsFolderName, _viewsFolderName, _upFolderName,
_versionTable, _scriptsRunTable, _scriptsRunErrorTable, _warnOnOneTimeScriptChanges, _outputPath);
_versionTable, _scriptsRunTable, _scriptsRunErrorTable, _warnOnOneTimeScriptChanges, _outputPath,
_alterDatabaseFolderName, _runAfterCreateDatabaseFolderName, _runBeforeUpFolderName, _runFirstAfterUpFolderName,
_indexesFolderName, _runAfterOtherAnyTimeScriptsFolderName, _permissionsFolderName);

site.AddTask(task);
}
Expand Down
Loading