An easy way to create a patch for the application of expanded faces

I have deployed grails applications on tomcat6 on my client server computer, but the application still needs to be fixed a lot, so every error is based or missing on the client machine, I create a patch and deliver the client via ftp to .tar.gz, which will be replaced by the expanded folder.

I cannot send fully .war files because the applications are large (~ 80M), so sending changes to .class files is the only option I have. but the process of creating a patch is too time-consuming , especially to rebuild the project , clear the target folder and start compiling all the files in the project. after that I look at different .class files using the applications of the comparison folder in the new target / classes folder compared to the old target / classes folder and send it to the client.

it really took a long time to create the war process to fix a minor thing, is there a simpler way to get another .class on compiled code ? because I need to create a patch for 2-3 days each to fix a small amount, which is also regularly reported to the client.

thanks,

+4
source share
5 answers

We create a WAR file, then unzip it locally and synchronize the locally exploded WAR (using RSync ) with the exploded WAR on the server (using Cygwin on Windows development computers). The RSync protocol is very efficient, so deploying over the Internet is very fast, but generating the WAR file still takes a lot of time :(

We have scripts both on the developer's machines and on the server, so our deployment mechanism is pretty painless if you reduce the build time of the WAR. In addition, we do not rsync directly into the production directory, we wait until rsync is complete, and then run the script on a server that also supports the previous production version in case something goes horribly wrong.

+2
source

All we do is clean

grails clean 

Then create a war without cans

 grails war --nojars 

Downloading is 5 MB (this takes some time), but faster than 50/80 MB. If we add the tc plugin, we need to do a full load / build.

Then we deploy the war to the top of the blown up war and restart tomcat / jetty / etc ..

Hope this helps.

+2
source

Unable to create patch for Grails application. If the person you are delivering the application to is ready to put the libraries in the shared directory of the tomcat library, see this link for information on how to reduce the file size warfare to a few megabytes instead of 80.

0
source

Technically, there is another way to change the code at runtime: it's Groovy, so you can reassign class methods at runtime, for example

 MyDomainClass.metaclass.'static'.'method' = { some closure; } 

Although, it is very dangerous and does not restart.

You can do this, say, Groovy Web Console . This is another serious security issue with which you opened the web console.

I would advise you to check your classes for source control and build on the target machine / on the target network. SVN traffic is compressed, so it does not take much time.

0
source

Another alternative would be to use source control (such as DVCS, such as mercurial or git, are great for this), and ask the client to pull out a read-only version of any branch of your code that you want to give. Then create a script construct (gradle / ant / gant) that can download / install grails and compile the military war file and deploy it.

0
source

All Articles