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

12/8/2008 3:29:04 PM
Gravatar
Total Posts 21

Re: How to deploy from Monodevelop

Thanks Joe,

I will look into creating a project on CodePlex as you suggest.  I am happy to add you as a coordinator and to link the projects.  I notice that you are not using Subversion on CodePlex yet.  Mind me asking what is holding you back?  Merge?

As for the license, do you see a reason not to go with the GPL?  I know that the LGPL is less restrictive but this in an application not a library.  I am assuming that the license can be changed on CodePlex later if need be. What made you select the CPL for mojoPortal?

Perhaps we should have another thread for the installer.

Justin

12/9/2008 8:07:53 AM
Gravatar
Total Posts 18439

Re: How to deploy from Monodevelop

Hi Justin,

My friend you continue to impress! I just had a peek at your start on the mojoPortal installer, I'll respond more about it on that thread.

Yes, I'm still waiting for the Codeplex Team to complete the needed merge feature. Last I heard it got delayed because they had some other priorities that came up. They still say they wil have it working soon, but I don't know exactly what soon means, my guess is another 4-8 weeks. But there is no hurry from my point of view, I can continue to use the Novell Forge svn server indefinitely. Its not a requirement of Codeplex that you use their repository as long as you are making source code releases on Codeplex. Having a presence on Codeplex is very helpful as thats the go to place for .NET folks looking for open source code. You could host your ReleaseIt repository at Novell Forge or google code or sourceforge and still make it available on Codeplex.

Licensing pre-amble: I am not qualified to give any legal advice, anything I say here is a laymans understanding (or misunderstanding).

For your ReleaseIt project, actually I see no problem going with the GPL, in fact thats probably the best choice now that I think of it, but for the mojoPortal Installer it would pose potential risks and snags, that I would like to avoid by not using GPL.

The problem (and perhaps benefit) of GPL is its viral clause, which basically says if your app depends on GPL code your app must also be released under the GPL. Now if you own all the copyright for the code you can dual license under GPL and some other commercial license to customers. This is the business model of MySql and quite a few other open source projects. In order to contribute code to those projects contributers must transfer copyright of any contribution to the project, otherwise MySql would have no ability to use the code under their commercial license. So, users can use MySql free, but if you embed it in your app and want to release it under a commercial license you have to buy a commercial license from MySql to be able to include it in your app.

I chose not to use the GPL or this model in mojoPortal. Licensing under GPL would make it less attractive for others to easily build and sell applications based on mojoPortal because they would have to buy a commercial license from me. Some people would do that and perhaps I could have made some money that way but my goal is for more people to use mojoPortal so I don't want to scare people away with the GPL. I want them to be able to bundle apps that plug into mojoportal with mojoPortal and I want them to be able to license their app using any license they want. I just don't want them to be able to obscure the fact that mojoPortal is in the package. It has to be in the documentation or fine print saying that it includes mojoPortal and mojoPortal is licensed under the CPL. I "think" the CPL gives me this support because they can't sub-license mojoportal except under the same terms as the CPL, but it allows them to license applications they bundle with mojoPortal under any license because it doesn't have the linking clause of the GPL. You can have a dependency on CPL code without the having to license as CPL, but you can't take the core of mojoportal and derive a new work and change the license.

Because of the viral clause inthe GPL, I cannot use GPL code in mojoPortal. So for example I can't distribute a release of mojoPortal pre-configured for MySql because the MySql Connector for. NET is licensed under the GPL. Note that the terms of the GPL only cover distribution, not use, so I package a separate data layer for MySql which I license under GPL to comply with the connector dependency, but the end user has to install it on top of a mojoportal package already configured for something else. Actually, there is an exception clause attached to the MySql connector that does allow it to be packaged, but my analysis is that I'm safer not doing that. The GPL does allow distribution as mere aggregation, so I can for example package the MySql connector with the source code in a single download without falling prey to the viral clause. I think in the installer project if the user picks MySql we will need to prompt with a license agreement showing the GPL.

Another GPL issue that came up recently is that I started using the ExtJs javascript library which was under LGPL, and then after version 2.0.2 they changed the license to GPL and I can no longer get upgrades and therefore no longer implementing anything new with EstJs. I removed use of ExtJs tabs and swtitched to YUI.

So, for the installer, while I think it might be ok for the installer to be GPL, I'd like to avoid it in case I'm wrong and err on the side of caution. A case could be made that mojoportal has a dependency on the installer and then the viral clause could bite me. I'd prefer to go with CPL but willing to go with even a more liberal license. CPL is not one of the listed choices on Codeplex, but if you ask them they can put any license you want. I had them put CPL there for me.

For the installer, I'd like to have the code in the same repository as mojoPortal.

Best,

Joe

12/14/2008 1:26:25 PM
Gravatar
Total Posts 21

Re: How to deploy from Monodevelop

Joe,

I replied about the installer on the other thread.  To quickly resond to your comments here though, I am happy with hosting the installer in the main mojoPortal repository and agree that we should use the CPL to keep life simple as that is what mojoPortal itself uses.

For ReleaseIt, I am leaning towards the GPL.  Again, I think this keeps life simple.  I can foresee wanting to use code from other projects and it seems likely that these projects will be available via the GPL.  I want to avoid the situation you had with ExtJs.

To be fair, your issue with ExtJs is really that they changed the license not so much that they moved to the GPL.  If they had moved to a commercial license or any of a number of other Open Source licenses, you would have had the same issue.  Of course, you can legally continue to distribute the last LGPL release although I can certainly understand why you would want to move to another better supported project.

I am also not a lawyer or an expert os my comments should perhaps go to /dev/null as they say.  That said, I think the "viral" moniker for the GPL can be a little misleading and can scare people more than it should.

To my knowlege, no license can force you to change the liceinsing of your own code.  Rather, the licenses simply specifiy the criteria by which other people's code can be distributed.  The GPL says that you any derived works also have to be licensed as GPL.  So, if you are judged to be producing a derived work (infringing on the copyright of the GPL code provider) you have a few choices:

1) Remove the GPL code from your project

2) Release your source code under the GPL to comply with the GPL

3) Distribute the GPL portion independently from the rest of your application

In the ExtJs case you chose option number one.  In your MySQL example you chose option number three.  The fact that the other code is GPL makes option two a choice but that choice is never forced on you.

My own interpretation is that if MySQL has an exception for packaging you are safe doing so.  If for some reason the MySQL guys were to object and inform you that you were violating their license (GPL) you would then have to take one of the three actions above.  So, the risk you are taking by packaging the MySQL connector today is that you may later have to start doing what you are doing now.

I am not trying to second guess the choices you have made for your project.  I am very greatful for your work and have no problem using it in the way that you prefer.  I am a MySQL/mojoPortal user.  I just worry that others might misunderstand what you are saying and assume the the GPL was somehow a "dangerous" license that could force them to release their own code as GPL when they do not want to.  I have seen opponents of the GPL or of Open Source software imply that this is how the GPL works.

Also, if we release something under the GPL and then that causes problems we can simply change the license of our own code to something that works.  Again, the GPL cannot force anything on you.  What it can do of course, is keep code you release as GPL perpetually available under the GPL.  So, you have to be careful not to let the genie out of the bottle if you do not understand copyleft and what the GPL does.

I hope my reply does not come off as combative.  Again, I am not questioning your choices.  My own interest in the GPL is simply that I would like there to be a large body of great code/software that I can use and deploy in my own projects while allowing developers to commericalize their work if they chose to.  So far, it seems that the GPL is the best mechanism I have seen for this so it is good for me if more people use it.

Justin

 

12/15/2008 7:09:50 AM
Gravatar
Total Posts 18439

Re: How to deploy from Monodevelop

Hi Justin,

Sounds good to me. I think the GPL is a reasonable choice for ReleaseIt. In any case its just a developer tool so it doesn't impact on mojoportal like the installer so as long as you're cool with the installer being CPL I think we are all set from a collaboration standpoint.

Now we can still discuss the pros and cons of licenses in general as a point of interest, but its perfectly fine if we don't agree on every point. I certainly don't consider myself an authority on the topic.

I don't see the the GPL as dangerous per se, its an important license, but I think not understanding it can be very dangerous and its easy to misunderstand it. There are a lot of open source licenses which grant various freedoms, but the GPL has a political and social agenda involved with it and it defines freedoms in a very specific way that actually limits your freedom to use it. This is why things like the Mono project are not GPL. Licenses like BSD and MIT and even LGPL give you freedom to do pretty much whatever you like, but the linking clause of the GPL coerces you to license your own code under the GPL or not depend on any GPL code. Your option 3 can only work if you don't really have a dependency (meaning your application can runwithout the GPL code or the GPL code is easily replaced). So the danger is for those who don't understand this to start developing a product they would like to sell and they depend on some GPL library which can't easily be replaced then later find they must comply with the GPL. So the danger is finding out too late about the requirements of using GPL code and finding that you can't sell your product without also giving away the source code and giving away the source code means most people will take the free code and not buy your product. If you can find a way to remove the GPL dependency then you can recover your plan and move on but it may not be easy to find or develop replacement code, it can be a big setback. So the danger as I see it is that there seem to be a lot of people who don't understand the GPL, they get the "free as in beer" part but nothing more and they think open source just means you get it free and can do what you want. The fact that it is in general true with some license that you can get the code for free and do whatever you want with it means this is more on an issue for GPL than other licenses because people have to understand more in order to not make mistakes.

I certainly don't mean to disparage the GPL, its an extremely important license (probably the most important), and in general I'm in support of the goals of the FSF but not in any absolutist way. Eventually all software may become free but giving away all of your code makes it very difficult to make a living. Sure there are a few examples of profitable open source business and I am trying to build one too but its very difficult. If I got enough donations to live I'd give away all of my code but it just doesn't happen so I need to sell some products on top of mojoportal or else go back to working in the corporate world and have less time for improving mojoportal.

Best,

Joe

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