google-code-export / fluent-build

Automatically exported from code.google.com/p/fluent-build
1 stars 0 forks source link

Using fluent-build as a deployment tool #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is not really an issue, but just wanted to give you some feedback.

I've tried using "dropkick" (https://github.com/chucknorris/dropkick) a fluent 
deployment framework for deploying builds.

However, I ran into a lot of friction: My deployment with "dropkick" got really 
messy & complex. So, I "dropped" it entirely (pun intended). :)

I got a crazy idea and I decided to try and use fluent-build for deployment.

My "deployment"/(BuildFile) is working out quite well. Here's what I did (which 
might give you some suggestions in making it more deployment friendly):

1. Created a console project with a "class WebDeploy : BuildFile" and wrote my 
deployment requirements.

2. Referenced fb.exe & FluentBuild.dll in the above project.

3. Wrote a small DeployRunner wrapper:

***
public static class DeployRunner
{
  public static void Main(string[] args)
  {
    Console.WriteLine( "Continue with deployment?" );

    var ans = Console.ReadLine().ToUpper();
    if( ans.StartsWith("YES"))
    {
      typeof(Program) // FB.EXE's PROGRAM
       .CallMethod( "StartRun", Flags.StaticAnyVisibility,
           new object[]
            {
               Assembly.GetExecutingAssembly(),
               typeof(WebDeploy)
             }
       );
    }
  }
}
***
//NOTICE: I had to do some reflection to Invoke to your "StartRun" method.

4. Compiled & ILMerged all assemblies with my WebDeploy.exe as the main primary 
executable.

... now, all I need to do is copy WebDeploy.exe which contains everything it 
needs to get the latest build from TeamCity, and "install" it on the webserver, 
swapping App_Offline.htm, deleting old files, unzipping the latest build, and 
re-applying ACL permissions.

:)

Perhaps you could set the visibility of Program's StartRun to public to avoid a 
reflective call and be a little more open. :)

Thanks,
Brian

Original issue reported on code.google.com by bcha...@gmail.com on 30 May 2011 at 12:45

GoogleCodeExporter commented 9 years ago

Original comment by DaveWood...@gmail.com on 15 Jun 2011 at 8:38