简体   繁体   English

针对不同环境自动部署JavaScript项目

[英]Automated deployment of JavaScript project for different environments

I was looking for similar problems and, of course, there exists many but I would like to know if someone uses a similar project like us and how you have deal with it. 我一直在寻找类似的问题,当然,有很多问题,但是我想知道是否有人使用像我们这样的类似项目,以及您如何处理它。

We are working on a project where: - Client side is completely based on JavaScript, with Dojo Toolkit framework, which makes AJAX request to our server side. 我们正在研究一个项目,其中:-客户端完全基于JavaScript,并带有Dojo Toolkit框架,该框架向我们服务器端发出AJAX请求。 - Server side based on Java+Spring+Hibernate which implements some REST API. -基于Java + Spring + Hibernate的服务器端,实现了一些REST API。

We are managin the two parts as different projects, that is, for the server side we are using maven and for each change our CI server runs tests. 我们将这两个部分作为不同的项目进行管理,也就是说,对于服务器端,我们正在使用maven;对于每次更改,CI服务器都将运行测试。 The important step here is we can configura maven with profiles so the CI can create a package ready for pre-production or production environments using different property files. 此处的重要步骤是我们可以使用配置文件配置Maven,以便CI可以使用不同的属性文件创建可用于预生产或生产环境的软件包。

The client side is a bunch (with a nice structure) of HTML, CSS and JavaScript files. 客户端是一堆(结构不错的)HTML,CSS和JavaScript文件。 Like the server side, on the client side we have property file to point the client to the right place (like the development server side). 像服务器端一样,在客户端,我们有属性文件可将客户端指向正确的位置(例如开发服务器端)。

The question is: which could be the best way on this scenario to automate the client side?development? 问题是:在这种情况下,哪种方法可能是自动化客户端的最佳方法?开发? I mean, run JavaScript tests on CI and autodeploy to the right environment using the appropriate property file. 我的意思是,在CI上运行JavaScript测试,并使用适当的属性文件自动部署到正确的环境。

Thanks. 谢谢。

While someone gives you a proper and complete answer you might want to have a look at a similar question I did. 当有人给您一个正确而完整的答案时,您可能想看看我做过的类似问题。 Javascript web app and Java server, build all in Maven or use Grunt for web app? Javascript Web应用程序和Java服务器,全部在Maven中构建还是将Grunt用于Web应用程序?

I am trying different options out there but most probably we will finish using Grunt for the client side. 我正在尝试其他选项,但是最有可能我们将在客户端使用Grunt。 Maven exec to call it and build everything (client + server) with different profiles. Maven exec调用它并使用不同的配置文件构建所有内容(客户端+服务器)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM