How to deploy from Monodevelop

mojoPortal is no longer supported on mono. This forum is here for archival purposes.

This thread is closed to new posts. You must sign in to post in the forums.
11/25/2008 12:44:14 AM
Gravatar
Total Posts 21

How to deploy from Monodevelop

Hello,

Ok, I am sure this is a silly question but how does one deploy from Monodevelop on Linux?  On mojoportal.com there are instructions for how to deploy the compiled files from Web but they are Windows specific.  What should I be doing on Linux?

I have been working on mojoPortal for a couple weeks now and have moved to Monodevelop on Linux (using Mono obviously) and I have been copying the compiled DLLs over manually.  I am thinking there has to be abetter way and I am the only fool not doing it.

Thanks.

Justin

11/25/2008 6:06:41 AM
Gravatar
Total Posts 18439

Re: How to deploy from Monodevelop

Its not a silly question. There is not currently an easy way to do it. I wish there was a tool like UnLeashIt that could run on linux, seems like it would not be too difficult to build a cross platform WinForms app like that to copy the files based on extension. What I actually do is package my windows build for pgsql, then I replace all the dlls with the ones I compiled on linux. In the past I've also used a Samba share on my linux machine so I could use UnLeashIt from my windows box.

At one time, Dean Brettle had implemented a deploy project in the MonoDevelop solution, but it had some errors on some linux systems so I removed it somehwere along the way. The files for it still live in svn under the mono_errata folder. There are some bash scripts for deployment there that could be revived and updated. I think they were overly ambitious in that the deployment also tries to setup the db and other things. Prpbably a good solution would be to weed out that part and just use the file copying stuff to deploy to a local folder without C# source code as UnLeashIt does. If you care to take a crack at it feel free.

Best,

Joe

11/28/2008 12:05:55 AM
Gravatar
Total Posts 21

Re: How to deploy from Monodevelop

Thanks Joe.

I see what you mean about the scripts being ambitious. I may take a crack at cleaning it up sometime or even in creating a Linux GUI application like UnLeashIt. I will have to get myself to a Windows box and run UnLeashIt first to see what it looks like.

For them moment, my quick and dirty take away is the following command:

tar cvzf newstuff.tar.gz `find . -print | egrep '\.(aspx|ascx|asax|html|htm|config|js|xml|xsl|gif|jpg|png|css|db|ico|htc|dll)$'`

This leaves me with a tarball (newstuff.tar.gz) that I can then simply extract into the parent directory of my development site. After that I can run Setup/Default.aspx to upgrade the database.

Is there something else I need to do other than to copy the files with those extensions? Is this all UnLeashIt does?  Any extensions that I am missing?

Justin

11/28/2008 5:33:30 AM
Gravatar
Total Posts 18439

Re: How to deploy from Monodevelop

Hi Justin,

Sounds like you found a solution in line of code! I'm really not good at all the linux command line stuff myself.

Yes, that is exactly what UnLeastIt does, it enables you to create a package without the C# source code by configuring which file extensions to include.

I'm not sure if it has an option to zip the package, I just zip it afterwards with winzip, but before doing that I may also do a little cleanup like change Web.config to <compilation debug="false"

I clean out the .xml files from the bin to make the package a little smaller. Also I usually package from a build of a clean checkout folder rather than the one I test from as otherwise it deploys images and content thast I've added in my testing. Also don't want to include my development user.config in the package so using a clean checkout for packaging helps.

A WinForms GUI to do this on linux would be awesome. UnleashIt lets you save "profiles" about source and target locations and file masks. It lets you specify file masks of which files to include. Being able to change those extensions easy is important. For example moving to framework 3.5 we will need to add .svc and .xap and probably others. Profiles are not that important if you can easily browse to source and target folders,but the ability to manage the extensions included is important. Other than that, all it does is copy the files. UnLeashIt also has some ftp abilities, but I don't ever use it.

Your list of file extensions is not complete. Off hand I notice it is missing resx, maybe others too, I have a list of them on this page that I try to keep up to date.

Best,

Joe

11/28/2008 5:33:05 PM
bob
Gravatar
Total Posts 126
YAF developer

Re: How to deploy from Monodevelop

For testing purposes, I use mono apache config, which points right to the directory where I compile the project (/Web) and don't remove the .svn garbage.  

P.S. Gentoo doesn't have 2.0 ebuild to the moment, so I can't do somthing like testing or development :-(

12/1/2008 1:52:13 AM
Gravatar
Total Posts 21

Re: How to deploy from Monodevelop

Bob,

I do something similar.  I run Mono's XSP 2.0 web server in place right in the Web directory of the source tree.  This works pretty well for development but it still leaves the problem of how to get the new files from development to production.

Apache is a better web server but I it is just so easy to run XSP since it will make web root in whatever directory you start it in.  No configuration required and no extra layers to wonder about when things get strange.

My production web server is Apache though of course.

Justin

12/1/2008 2:16:46 AM
Gravatar
Total Posts 21

Re: How to deploy from Monodevelop

Joe,

You mentioned a WinForms GUI for deployment.  I am not sure what the rules are but I thought I would share where some of my weekend went this week:

http://www.moneybuddy.ca/releaseit/ReleaseIt.exe

It is pretty rough around the edges but, on my machine at least, it does the basic job of moving files with desired extensions from one place to another.  I have never used Windows Forms before so this is really a newbie effort.  Also, I pretty much copied the look of UnleashIt which I hope does not offend anyone.

It does not support profiles and in fact does not even allow you to add masks at this point as they are hard-coded.  It was really just an experiment.  Now that it's poor quality is public I might be embarrassed into fixing those problems but I am not sure if anybody is even likely to use it.  On the bright side, there is no installation as it is only a single executable.  I think all the extensions mentioned on the link you provide above are included.

Someone in the situation I was in two weeks ago may find it useful after reading your instructions on deployment using UnleashIt and wondering what to do on Linux.  The Windows Forms make it feel a bit alien on Linux but it runs.

It was compiled on my Ubuntu Intrepid machine with Monodevelop 1.9.1 on Mono 2.0.1.  It think it should run fine on both Linux/Mono and Windows with .NET 2.0 or better.

Justin

12/1/2008 8:53:21 AM
Gravatar
Total Posts 18439

Re: How to deploy from Monodevelop

Hey Justin,

Its a pretty darn good start if you ask me! I'm impressed. I just tried it on my Vista machine and it worked. While it was running the title bar said not responding. My guess is this could be resolved by doing the file processing on a different thread than the UI. Haven't tried it yet on linux.

I like the name of it too, I'd probably make the logo look different than UnLeashIt so as not to step on any toes.

Probably could have a hard coded set of predefined masks but create an xml file in the user profile to store the mask list. I'm pretty sure thats what UnLeashIt does, they create an xml file with the default profile mappings but you can edit it or create new ones andit just creates a new xml file I think.

I think this tool will be useful to anyone doing web development on any platform.

I wonder if you'd be interested in helping with a additional project that I have in mind but don't have time to do myself. I'd like to make a general purpose web installer. VS has some project templates to make msi installers but these are not cross platform so I'd like to make a winforms app that can install mojoPortal (and conceivably other web apps) for both Windows and Linux. Obviously those would require different implementations so the app would detect if tis running on windows or not and branch the logic (maybe we would use one dll for windows and one for linux).

What I'd like to be able to do is embed the release .zip files and be able to just run the exe to install or upgrade. The user picks the target folder (perhaps we suggest one) the app deploys the files, detects if apache or IIS is installed and configures the web site or app if its not already configured.

The user could pick which db platform and the app would deploy the correct data dlls from the embeded zips. Possibly the user can enter a connection string and we test it and write it into user.config if it works. For upgrades it could detect if the user.config file is already there and test the connection string it has.

Its an ambitious idea so I understand if you're not interested or too busy but thought I'd throw the idea out there. I'd be willing to implement the windows logic branch for configuring IIS.

The reason I'm interested in this is I think having an easier way to install and configure mojoPortal both on windows and on linux would make it much more popular. Really most people will use hosting companies and this won't help them but for companies with their own web server or people just evaluating on their own machines it would be fantastic. I could just do the msi thing but I'd really like a cross platform solution.

In any case, with a little polish ReleaseIt could replace UnLeashIt in my workflow.

Best,

Joe

12/2/2008 7:38:19 PM
Gravatar
Total Posts 21

Re: How to deploy from Monodevelop

Joe,

Thank you for the kind feedback.  Of course, now I have to make it suck less.  I would enjoy having a tool used in your project.

A better GUI will have to come later but I bolted on a giant "New File Mask" button so the list of masks is now expandable.  I guess that makes it future proof!  I also replaced the logo. Nothing fancy but it will do for the moment.

You are correct that it was running in a single thread.  The files are copied in a background thread now.  Try it out if you have a moment and let me know what you think.

Still no profiles...  I had looked at the XML files used by UnLeashIt and they seem simple enough.  If I do add profiles, it should not be a problem to make the XML compatible.  Still, even without profiles all you need to do to deploy mojoPortal is select your directories and click the deploy button.

http://www.moneybuddy.ca/releaseit/ReleaseIt.exe

I am very flattered that you would ask me to help with a project.  Obviously you have not seen my code. :-)  It is an interesting proposal and I agree that it would make mojoPortal much more accessible.  I also admire your committment to cross-platform.  Sadly, I have a shortage of time myself and I not a professional developer.

I imagine that your project idea has the potential to grow quite complicated.  Were you thinking that the zip files would be embedded in the installer or would it grab them off the web?  A quick and dirty solution would be to just extract the files into a directory without officially "installing" them.  To do an actual install on Windows would mean getting them into "Add/Remove Programs" in the control panel.  On Linux you would need first to detect what package manager to use (eg. apt-get/deb on Ubuntu or RPM stuff on Suse/Red Hat.  On both systems you would need to test for dependencies with .NET or Mono and again figure out how each system handles those packages.

The configuration stuff would be very useful of course.  In fact, this would be useful even without the rest of the installer. II can see using it when compiling from source as well as a stand-alone tool.  Perhaps a profiles idea like from UnLeashIt would work so that connection strings and the like can be easily restored into a mojoPortal installation.  I would have used this myself a few times recently.  Some of the same complexity as above exists of course.  Would you just want to assume IIS on Windows and Apache on Linux or would the web server have to be detected?

If someone was going to do this, I think it might make sense to break it into pieces.  For example, you could start with a tool that just automated the process of downloading an extracting the correct zip files.  This would have saved somebody like me from downloading the wrong files for Mono for example.  Next, you could build a tool to automate some of the configuration.  Next you can start combining tools.  For example, you could integrate some of the configuration automation into a tool like ReleaseIt for developers.  The full blown installation soup to nuts stuff can come after the building blocks are in place.

Maybe I am thinking about it in the wrong way but I think this way you could at least make progress and have something better in baby steps.  The enemy of a good plan is the dream of a perfect one they say and I worry about doing too much at once.  Along the way, a user of one of the partial tools might actually become interested enough to help improve them.  Eventually it could be quite slick.  What are your thoughts?

Of course, I should make sure I finish my own projects though before I sign up for more.

12/3/2008 7:04:46 PM
Gravatar
Total Posts 21

Re: How to deploy from Monodevelop

A few changes to ReleaseIt...

www.moneybuddy.ca/releaseit/ReleaseIt.exe

There is now very rudimentary profile support.  At startup, the file default.riprofiles is loaded if it exists and the file masks, source directory, and target directory are loaded from it.  If it does not exist a built-in profile is used.  Hitting the "Save Profile" button at any point saves the current settings to default.riprofiles in the directory from which ReleaseIt was launched.

default.riprofiles is an XML file that I believe is compatible with the profiles files from UnLeashIt.  ReleaseIt does not support multiple profiles in the XML at this point.

If you are always moving files between the same two directories, or if you need custom file masks, the ability to save a profile will save you having to specify them each time.  Now that it exists, the profile support should improve over time.  It works well enough for me at the moment though.

There is also much better error and exception handling under the hood now.  Probably still needs improvement though.

Justin

 

12/4/2008 6:26:22 AM
Gravatar
Total Posts 18439

Re: How to deploy from Monodevelop

Hi Justin,

ReleaseIt is really shaping up nicely! Great work!

Obviously you have not seen my code. :-)

Well regardless of how it looks, its working code, and I suspect it looks good enough, and you are just humble. In any case I'd be glad to help maintain it or enhance it over time, if you'd like to share the code. What I think would be ideal is to setup a project for it on Codeplex and make it a related project to mojoPortal so we can have a link between them. If you'd like to set it up and then make me a coordinator, that should give us both an ability to commit to a repository using svn and make it possible to link the projects. Or if you'd like me to set it up I can do it if you send me the source zip. Would need to pick a license to release under, preferably something very free like LGPL or MsPl, but its your decision. The only problem on codeplex is that svn merge doesn't work yet though they are working on fixing it. Committing to the same tree works but we would have to be careful to coordinate if we were both working on the same files. I've got enough to do that I probably won't be in your way and would just let you run with it. I'd be happy to review the code and offer feedback and if you get to a point where you're too busy but something else needs to be done I could help then.

About the web installer ideas, I agree building it in steps would be the way to go, starting with the most useful things first, and encapsulating the steps into libraries. From my perspective the downloading part is not essential as I can package the appropriate zips with the program either as embedded resources or just having it look for specific named zip files in the same folder as the exe. I'd like to be able to compile a new installer with each release and package all the release files as embedded resources. There would really just be one complete set of files pre-configured for MS SQL, then a separate zip for each data layer with just the data dlls which would replace the MS SQL version. I'd also have a zip for the mono compiled ones which would be used if it detects Mono or perhaps by a radio button in the UI. So the user would pick the database from a list and the correct data dlls will be installed.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.