简体   繁体   English

部署应用程序应遵循的方法

[英]Approach to be followed for deploying the application

We have developed a web based application in java(STRUTS 2.0). 我们已经在java(STRUTS 2.0)中开发了一个基于Web的应用程序。 Now we want to deploy the application. 现在我们要部署该应用程序。 The client is having one pre UAT environment ,UAT environment and a production environment. 客户具有一个预UAT环境,UAT环境和一个生产环境。

Now when we are deploying for pre-UAT we have created the copy of our project and renamed it to pre-UAT. 现在,当我们部署UAT之前时,我们已经创建了项目的副本,并将其重命名为UAT之前。 Similarly we are planning for UAT environment and one we already have for development. 同样,我们正在计划UAT环境,并且已经在开发中。 So in all we will be having 3 copies of our code. 因此,总共会有3个代码副本。

I want to ask is this approach correct or what is the standard approach followed. 我想问一下这种方法是正确的还是遵循的标准方法是什么? This is not our final release as we are first releasing a version and then we will be working on other modules. 这不是我们的最终版本,因为我们先发布一个版本,然后再开发其他模块。

So please can anyone guide me for approach to follow for creating this 3 different environments.Thanks in advance 因此,请任何人可以指导我介绍创建这3个不同环境的方法。

I am not sure what you refer to by "we will be having 3 copies of our code". 我不确定您所指的是“我们将拥有3个代码副本”。 If you are implying that you actually copied the code-base around multiple times, please stop reading and refer to this: 如果您暗示您实际上多次复制了代码库,请停止阅读并参考以下内容:

Why is "copy and paste" of code dangerous? 为什么“复制和粘贴”代码很危险?

And once you finish reading, do some research about source control and how to use branching/tagging for concurrent development. 阅读完后,对源代码控制以及如何使用分支/标记进行并发开发进行一些研究。


If you were referring to multi-environment deployment : 如果您指的是多环境部署

Assuming your application is designed correctly (and I'm treading very carefully here), one WAR file (you were mentioning you're using Tomcat, so I am concluding that your application is packaged as a WAR) should be sufficient. 假设您的应用程序设计正确(在这里我要非常小心),一个WAR文件(您刚才提到您正在使用Tomcat,因此我认为您的应用程序打包为WAR)就足够了。 The application code should be environment-independent and should read its environment-specific configuration from external resources, such as a database, configuration files or JNDI. 应用程序代码应独立于环境,并应从外部资源(例如数据库,配置文件或JNDI)读取其特定于环境的配置。

If your application code is environment-independent, then all you need to do is simply deploy the WAR file to each of the environments (the same WAR file), plus the environment-specific set of external artifacts (such as configuration files). 如果您的应用程序代码与环境无关,那么您只需将WAR文件部署到每个环境(同一个WAR文件),再加上特定于环境的一组外部工件(例如配置文件)。

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

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