Code Monkey home page Code Monkey logo

dropkick's People

Contributors

akoslukacs avatar danielmarbach avatar davidduffett avatar drusellers avatar ferventcoder avatar gaikotsu2 avatar laazyj avatar miensol avatar mmooney avatar mpareja avatar rossbeehler avatar steinjak avatar thedersen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dropkick's Issues

Notify the user, if a role has no corresponding path in .ServerMaps

dropkick just silently fails, if a given Role has no corresponding entry in the current ServerMaps file. Maybe throw an exception, but show something.

Example:

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: Test1

Server 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.

Bug: Remote Execution Task errors while retrieving remote log file

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

Enhancement: Overwrite ReadOnly Files

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;
           }

BUG: Security API doesn't always set the FULL access rule correctly

I remember searching stackoverflow to find out why permission weren't being set right. I looked at the ACL routine in dropkick and it turned out there was a lot of things dropkick was doing that didn't really set the "full access" rule correctly (ie: bug).

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.

Enhancement: Use an X509 Certificate to gain credentials

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.

CopyFile task swallows file not found message

Or something like that...

Steps to reproduce:

Deploayment definition:

            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 one file

Create a file at \\localhost\c$\temp\dummy_exists.txt

Run it :)

Output:

[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.

Bug: Loading deployment spec from a remote location causes error

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

Process cannot access the file because it is used by another process

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

BUG: Can't set the PathForWebsite value

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.

Question: Assembly.LoadFrom in finder

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

BUG: Spaces in path cause command line parser to crash

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(IEnumerable1 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.

Remote msmq creation alert

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.

Access currently executing role

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

RemoteCommandLine Execution Idea to make smarter

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.