chucknorris / dropkick Goto Github PK
View Code? Open in Web Editor NEWDropkicK - A deployment framework
Home Page: http://github.com/chucknorris/dropkick
License: Apache License 2.0
DropkicK - A deployment framework
Home Page: http://github.com/chucknorris/dropkick
License: Apache License 2.0
There is no exposed extension method that allows you to set the PathForWebsite property on the IISProtoTask. This causes null reference errors in IIS7Task.CreateWebsite(...) when it tries to create the directory for the web site.
Hi guys,
Not sure if this is the right place to ask questions, but I ran into a problem with the deployment finder, and wanted to run a possible fix by you.
So this line is the problem:
https://github.com/chucknorris/dropkick/blob/master/product/dropkick/Engine/DeploymentFinders/AssemblyWasSpecifiedAssumingOnlyOneDeploymentClass.cs#L45
In that line, once it have the path to DLL that contains the deployment code, it calls Assembly.LoadFile to load it. The problem I ran into is that this DLL references a few more DLLs, which are colocated with the deployment DLL, and LoadFile will not load those dependencies automatically. It will assume that all dependencies are in the current executing directory (where ever dk.exe is located) which does not have the dependencies. For a cutting edge explanation, here is an 11 year old blog post: http://blogs.msdn.com/b/suzcook/archive/2003/09/19/loadfile-vs-loadfrom.aspx
This a key difference between LoadFrom and LoadFile. LoadFrom will load the dependencies colocated with the deployment DLL, but LoadFile will not.
In my case, i'm using a copy of dk.exe sitting in a single directory, and then using that to execute a bunch of deployments from other directories, so it's not practical to put all of the dependency DLLs in the same directory as dk.exe.
Obviously in my case it's easier to change LoadFile to LoadFrom so that the dependencies will automatically get loaded. However, I wasn't sure if LoadFile was used intentionally because the deployemtn DLL in turn is also going to reference dropkick.dll, and you wanted to make sure that the correct dk.exe dll version was used. However if they actually was a breaking mismatch in the dropkick.dll versions, I'm guessing that it burst into flames with some gory error messages anyway, elegantly telling the user that they have a problem.
Anywho, any issue if I submit a PR changing that to LoadFrom?
I'll probably have another one coming after that to be able to specify a specific deployment object to use if multiple objects exist in a DLL. Right now it seems like it only allows one per DLL,and I'm going to be building a whole bunch of a deployment automation tool (https://github.com/mmooney/Sriracha.Deploy), and it would be a lot easier to be able to put them all in the same DLL.
Thanks
The alert stating "REMOTE QUEUE - DID NOTHING" needs to be removed from the remote msmq creation task. dropkick issues this alert even though it at least attempted to do something.
This should be as simple as copying a named file in.
The project continues development or dead?
Anyways, why not working together?
https://github.com/chucknorris/dropkick
https://github.com/mmooney/Sriracha.Deploy
https://github.com/asimov-deploy/asimov-deploy-winagent
https://wolfpack.codeplex.com/
Thanks a lot.
Or something like that...
DeploymentStepsFor(Test1, t => {
string temp = @"\\localhost\c$\temp";
string sub = temp + "\\sub";
t.CreateEmptyFolder(sub);
t.CopyFile(temp + "\\dummy_exists.txt").ToDirectory(sub);
t.CopyFile(temp + "\\dummy_does_not_exist.txt").ToDirectory(sub);
t.CopyFile(temp + "\\dummy_exists.txt").ToDirectory(sub);
});
Create a file at \\localhost\c$\temp\dummy_exists.txt
[Good ] 'C:\temp\sub' already exists.
[copy][overwrite] '\\localhost\c$\temp\dummy_exists.txt' -> 'C:\temp\sub\dummy_exists.txt'
C:\temp\sub\dummy_exists.txt
[Good ] Copy '\\localhost\c$\temp\dummy_exists.txt' to 'C:\temp\sub'
[copy][overwrite] '\\localhost\c$\temp\dummy_exists.txt' -> 'C:\temp\sub\dummy_exists.txt'
C:\temp\sub\dummy_exists.txt
[Good ] Copy '\\localhost\c$\temp\dummy_exists.txt' to 'C:\temp\sub'
I think it should complain, that "dummy_does_not_exist.txt" does not exist!
Using latest source from github.
I want to maybe have a label on teamcity where I can download a zip file based on that label.
Hy
I have scenarios where configuration files are not only environment specific but also role specific. For example I have different RavenDb servers in place. For each ravendb server I have a configuration file for the ravendb instance. Practically I want to do the following:
server.CopyFile(@".\configs\{{Environment}}.{{ExecutingRole}}.Raven.Server.exe.config")
.ToDirectory(installDirectory).RenameTo(@"Raven.Server.exe.config");
I see from the code it would be possible by adding an ExecutingRole to the settings and then add the following;
protected void DeploymentStepsFor(Role inputRole, Action<ProtoServer> action)
{
var role = ServerRole.GetRole(inputRole);
Settings.Role = role.Name;
role.BindAction(action);
}
Attention: Quick hack.
Do you think that makes sense?
Daniel
This is really annoying when trying to deploy.
Take a look at the sample code and determine if it can be beefed up to meet this need.
foreach (string file in Directory.GetFiles("\\"))
{
var ft = new FileInfo(file);
ft.IsReadOnly = false;
}
Create a NuGet package.
Needs to report if it cannot find a certificate.
I need to be able to run with a silent switch.
Under the .NET 4.0 framework, dropkick can not load a deployment specification assembly from a remote location. The error message thrown by the CLR is as follows.
System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at dropkick.Engine.DeploymentFinders.AssemblyWasSpecifiedAssumingOnlyOneDeploymentClass.Find(String assemblyName) in c:\Solutions\dk-fc\product\dropkick\Engine\DeploymentFinders\AssemblyWasSpecifiedAssumingOnlyOneDeploymentClass.cs:line 45
at dropkick.Engine.DeploymentFinders.MultipleFinder.Find(String deployment) in c:\Solutions\dk-fc\product\dropkick\Engine\DeploymentFinders\MultipleFinder.cs:line 25
at dropkick.Engine.Runner.Deploy(String commandLine) in c:\Solutions\dk-fc\product\dropkick\Engine\Runner.cs:line 66
Need to be able to set permissions on reading the private key.
I have a command line of the following form:
"c:\Some Path With Spaces\dk.exe" execute /environment:DevFit /settings:"c:\Some Path With Spaces\settings" --silent
When I execute, I get the following error:
System.InvalidOperationException: Sequence contains more than one element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source) at dropkick.Engine.DeploymentCommandLineParser.ExtractCommandToRun(IEnumerable
1 commandLineElements)
at dropkick.Engine.DeploymentCommandLineParser.Set(DeploymentArguments arguments, IEnumerable`1 commandLineElements)
at dropkick.Engine.DeploymentCommandLineParser.Parse(String commandline)
at dropkick.Engine.Runner.Deploy(String commandLine)
This is a bug with the Magnum.CommandLineParser.MonadicCommandLineParser and underlying classes. I have issued a pull request (#6) in the phatboyg/Magnum project to fix the issue. Once that project is patched, dropkick will need to take in the new Magnum.dll.
It is really strange. When I run dropkick without any arguments I receive always the following exception:
DropkicK v0.4.13.0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Command: Trace
Environment: LOCAL
Role: ALL
Server Maps: '.\settings\LOCAL.servermaps' - Looks Good!
Settings Path: '.\settings\LOCAL.js' - Looks Good!
Looking for deployment dll 'C:\Users\danielmarbach\Documents\visual studio 2010\Projects\Deployment\Deployment2\bin\Debug\20120614-094240675.run.log' at 'C:\Users\danielmarbach\Documents\visual studio 2010\Projects\Deployment\Deployment2\bin\Debug\20120614-094240675.run.log'
System.IO.FileLoadException: The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at dropkick.Engine.DeploymentFinders.AssemblyWasSpecifiedAssumingOnlyOneDeploymentClass.Find(String assemblyName) in c:\Solutions\dk-fc\product\dropkick\Engine\DeploymentFinders\AssemblyWasSpecifiedAssumingOnlyOneDeploymentClass.cs:line 45
at dropkick.Engine.DeploymentFinders.SearchesForAnAssemblyNameContainingDeployment.Find(String assemblyName) in c:\Solutions\dk-fc\product\dropkick\Engine\DeploymentFinders\SearchesForAnAssemblyNameContainingDeployment.cs:line 34
at dropkick.Engine.DeploymentFinders.MultipleFinder.Find(String deployment) in c:\Solutions\dk-fc\product\dropkick\Engine\DeploymentFinders\MultipleFinder.cs:line 25
at dropkick.Engine.Runner.Deploy(String commandLine) in c:\Solutions\dk-fc\product\dropkick\Engine\Runner.cs:line 66
The assembly is named Deployment.dll. It resides in the same directory as the dk.exe
See phatboyg/Magnum#27 for problem description and (quick & quite dirty) fix.
Want to be able to install a certificate to a machine on deployment
In the world of SOx, the less people that know a password the better.
I would like to be able to pass a thumbprint to a machine and it be able to return the credentials based on hashing some salt with the private key of a certificate.
For a particular environment, no one will have access to the private key except the deployment person. The deployment person will not know the password, only the security person who set it up based on the same ideas that dropkick will use to get the credentials.
Found a todo in the remote command line executor which indicates that currently all remote tasks are hard coded. A simple idea to make the console smarter would be the following:
public interface IRemoteTaskCreator
{
Task Create(PhysicalServer server, string[] args);
}
[InvokedWith("create_queue")]
public class CreateLocalMsmqQueueTaskCreator : IRemoteTaskCreator
{
public Task Create(PhysicalServer server, string[] args)
{
var queuename = args[1];
var queueAddress = new QueueAddress(queuename);
var transactional = false;
if (args.Length > 2)
{
bool.TryParse(args[2], out transactional);
}
var task = new CreateLocalMsmqQueueTask(server, queueAddress, transactional);
return task;
}
}
public class InvokedWithAttribute : Attribute
{
public string InvokeCommand { get; private set; }
public InvokedWithAttribute(string invokeCommand)
{
InvokeCommand = invokeCommand;
}
}
A simple reflection mechanism could cache all inheritors of IRemoteTaskCreator in a dictionary with <InvokeCommand , IRemoteTaskCreator>. The remote console then simple does:
var result = new DeploymentResult();
var creator = ClassWhichHasReflectionMagic.CreateRemoteTaskCreator(args[0]);
var task = creator.Create(_server, argsWithoutFirstEntry);
result = task.Execute();
return result;
Simple. Easy. Extendable.
If the RemoteDropkickExecutionTask is unable to copy the remote log file back to the local folder it throws an error causing the deployment to stop.
This is easiest to replicate if the person running the deployment does not have write permission to the folder the deployment is run from as is usually the case when using a continuous build system.
Recommendation: instead of copying the file back to the local folder, just read the file from the remote location
to set permissions against.
and this still needs to actually be wired up.
In my case, my answer here was what solved my issue:
http://stackoverflow.com/questions/5935630/how-to-set-full-control-to-a-directory/6175523#6175523
** PropagationFlags.None was required in my case. I think dropkick didn't do this.
Be able to drop the acl inheritance from a folder so we can truly clear the permissions.
Some of the work was done here, but it needs to be finished out.
dropkick just silently fails, if a given Role has no corresponding entry in the current ServerMaps file. Maybe throw an exception, but show something.
I have a test Role: public static Role Test1 { get; set; }
, but no entry named "Test1" in ServerMaps.
Command line parameters:
dk.exe execute /deployment:D1.dll /settings:....\settings /roles:Test1
And the result (notice the typo "Teszt1"):
DropkicK v0.4.13.0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Command: Execute
Environment: LOCAL
Role: Test1Server Maps: '....\settings\LOCAL.servermaps' - Looks Good!
Settings Path: '....\settings\LOCAL.js' - Looks Good!
Looking for deployment dll 'D1.dll' at 'xxx\D1.dll'
Deployment Method: 'Specific Assembly Specified'
Deployment Found: 'D1'Server Mappings
'Teszt1'
'localhost'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Please review the settings above and when you are ready,
Press 'ctrl+c' to cancel.
Press enter to kick it out there
No error message, just back to console.
I know this is just RTFM, but confusing at a minimum. And not exactly evident, that something is missing, and pretty hard to figure out what just happened, if you don't know where to look.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.