在已部署的 Grails 应用程序上创建补丁的简单方法

发布于 2024-10-04 03:56:46 字数 506 浏览 1 评论 0原文

我在我的客户端服务器计算机上的 tomcat6 上部署了 grails 应用程序,但该应用程序仍然需要许多修复,因此客户端计算机上发现的每个错误或缺少功能,我创建一个补丁并通过 ftp 上的 .tar.gz 文件交付给客户端这将替换部署的文件夹。

我无法发送完整的 .war 文件,因为应用程序很大(~80M),因此发送更改的 .class 文件是我唯一的选择。但是创建补丁的过程太耗时,特别是在重建项目、清理目标文件夹并开始编译项目上的所有文件时。之后,我使用新的 target/classes 文件夹上的比较文件夹应用程序与旧的 target/classes 文件夹进行搜索不同的 .class 文件,并将其发送给客户端。

创建战争过程确实花了很多时间只是为了修复一个小问题,有没有一种方法更简单地在编译代码上获得不同的.class?因为我需要每 2-3 天创建一个补丁来修复客户经常报告的一些小问题。

谢谢,

i have a deployed grails apps on tomcat6 in my client server machine, but the application is still need many fix, so every bug founded or missing feature on client machine, i creating a patch and delivering to client via ftp on .tar.gz file that will replace on deployed folder.

i can't send a fully .war files because the apps is big (~80M), so sending a changes .class files is the only option i have. but the process to creating a patch is too time consuming, especially on rebuild the project, cleaning up the target folder and start to compile all files on project. after that i search the different .class files using on comparison folder apps on new target/classes folder compared to old target/classes folder, and send it to client.

the creating war process is really took many time just to fix a minor thing, is there a way more simple to get a different .class on compiled code? because i need to create patch on 2-3days each for fixing a little stuff that also routinely client reported.

thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

妥活 2024-10-11 03:56:46

我们构建 WAR 文件,然后将其解压到本地并同步本地分解的 WAR(使用 RSync)服务器上的分解 WAR(在开发人员 Windows 计算机上使用 Cygwin)。 RSync 协议非常高效,因此通过互联网进行部署非常快,但 WAR 文件生成仍然需要大量时间:(

我们在开发人员计算机和服务器上都有脚本,因此我们的部署机制非常轻松,如果您考虑 WAR 构建时间,另外,我们不会直接 ​​rsync 到生产目录,我们会等到 rsync 完成,然后在服务器上运行一个脚本,该脚本也会备份以前的生产版本,以防出现严重错误。 。

We build the WAR file, then unzip it locally and synchronize the locally exploded WAR (using RSync) with the exploded WAR on the server (using Cygwin on the developer Windows machines). The RSync protocol is very efficient so the deploy over the internet is very fast, but the WAR file generation still takes a lot of time :(

We have scripts on both the developer machines as well as on the server so our deploy mechanism is pretty painless, if you discount the WAR build time. Also, we don't rsync directly into the production directory, we wait until rsync is done and then run a script on the server which also backs up the previous production version in case something goes horribly wrong.

枫以 2024-10-11 03:56:46

我们所做的就是一个干净的

grails clean

然后创建一个没有jars的战争

grails war --nojars

上传然后是5mb(这需要一段时间)但它比50/80MB快。如果我们添加一个插件 tc,那么我们需要进行完整的上传/构建。

然后我们将战争解压缩到爆炸战争之上并重新启动 tomcat/jetty/等等。

希望这会有所帮助。

All we do is a clean

grails clean

Then create a war without jars

grails war --nojars

The upload is then 5mb (which takes a while) but it's quicker than 50/80MB. If we add a plugin tc then we need to do a complete upload/build.

We then unzip the war over the top of the exploded war and restart tomcat/jetty/etc..

Hope this helps.

铜锣湾横着走 2024-10-11 03:56:46

无法为 Grails 应用程序创建补丁。如果您向其交付应用程序的人愿意将库放入 tomcat 共享库目录中,请参阅 此链接 了解如何将 war 文件大小减少到几兆而不是 80。

There is no way to create a patch for a Grails application. If the person you are delivering the application to is willing to put librarys in a tomcat shared library directory see this link for info on how to reduce the war file size to a couple megs instead of 80.

空心空情空意 2024-10-11 03:56:46

从技术上讲,还有另一种在运行时更改代码的方法:它是 Groovy,因此您可以在运行时重新分配类方法,尽管

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

这样非常危险并且不能重新启动。

例如,您可以在 Groovy Web Console 中执行此操作。 Web 控制台暴露是另一个严重的安全漏洞。

我建议您将类检查到源代码管理中,并在目标计算机/目标网络上构建。 SVN流量经过压缩,因此不会花费很长时间来交付。

Technically, there is another way to change code in runtime: it's Groovy, so you can reassign class methods in runtime, like

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

Though, it's very dangerous and not restart-proof.

You can do it in, say, Groovy Web Console. It's another great security breach to have Web Console exposed.

I'd advice that you check your classes into source control, and build on the target machine/in target network. SVN traffic is compressed, so it won't take long to deliver.

口干舌燥 2024-10-11 03:56:46

另一种选择是使用源代码控制(像 Mercurial 或 git 这样的 DVCS 非常适合此操作),并让客户端提取您想要提供给他们的任何代码分支的只读版本。然后有一个构建脚本(gradle/ant/gant),可以下载/安装grails并编译生产war文件并部署它。

Another alternative would be to use source control (DVCS like mercurial or git work great for this), and have the client pull a read only version of whatever branch of your code you want to give them. Then have a build script (gradle/ant/gant) that can download/install grails and compile the production war file and deploy it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文