简体   繁体   English

版本控制和测试网站

[英]Version Control & Testing Web Sites

I am new to Version Control. 我是版本控制的新手。 Just setup an SVN Server on my Ubuntu. 只需在Ubuntu上设置SVN服务器即可。 It works but I am wondering how do I test those files (Web Pages)? 它可以工作,但是我想知道如何测试这些文件(网页)? I suppose I want to commit changes and see how it looks on the server. 我想我要提交更改,并查看更改在服务器上的外观。 When I look at the repo folder, its all the SVN files. 当我查看repo文件夹时,它是所有的SVN文件。 How might I test those uploaded files then? 那我该如何测试那些上传的文件?

I could test them locally but I what I want is a more accurate test on server. 我可以在本地测试它们,但是我想要的是在服务器上进行更准确的测试。 What might be a good way of automatically coping these commits to the web root for example? 例如,将这些提交自动处理到Web根的好方法可能是什么? Currently using SVN but perhaps it similar with GIT? 当前正在使用SVN,但也许与GIT类似?

You really do not want to commit before checking if the code works the way you want to. 您真的不想在检查代码是否按您想要的方式工作之前提交。 You would end up doing countless commit just to correct layout problems. 您最终将进行无数次提交,只是为了纠正布局问题。

You should either have a local webserver where you try your code before committing, or modify directly the code on your external server, eg via sftp and an ide that save files over network trasparently. 您应该具有一个本地Web服务器,然后在提交之前在其中尝试您的代码,或者直接在外部服务器上修改该代码,例如通过sftp和可透明地通过网络保存文件的ide。

Once your code is ready there are various way to deploy it, such as rsync or fabric. 准备好代码后,可以通过多种方式进行部署,例如rsync或Fabric。 Sorry for the shortness but it's such a big topic 对不起,很简短,但这是一个很大的话题

Subversion doesn't address the problem you're having, which is related to building and/or deploying your code. Subversion不能解决您遇到的与构建和/或部署代码有关的问题。 How you address this depends on your web development stack and the size of your project, but an acceptable workflow looks like: 解决方法取决于您的Web开发堆栈和项目的大小,但是可接受的工作流程如下:

  1. Write your code using whatever editor tools you're comfortable with. 使用您喜欢的任何编辑器工具编写代码。
  2. Commit the changes to Subversion. 将更改提交到Subversion。
  3. Run your deployment tool, pulling from your repository and deploying to your local machine. 运行部署工具,从存储库中提取并部署到本地计算机。
  4. Preview your changes. 预览您的更改。 If you need to make more changes, start again at step 1. 如果您需要进行更多更改,请从步骤1重新开始。
  5. Run your deployment tool, pulling from your repository and deploying to your production server. 运行部署工具,从存储库中提取并部署到生产服务器。

Deployment may be a project all on its own, depending on how many steps are involved. 部署可能完全是一个项目,具体取决于所涉及的步骤。

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

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