如何自动同步到 Aptana Studio 3 中的本地文件夹/项目?
我能够在项目 A 中的两个本地文件夹(从项目 A 到项目 B)之间建立连接。 然后可以使用项目 A 中的上下文菜单手动上传/下载。 但是两个位置之间的自动同步怎么样? 我认为这对于 FTP 等协议是可能的,但当目标是本地目录时则不然。 这是缺少的功能还是有技巧?
编辑:下面的答案/评论解释了事实上Aptana同步功能并不是一个完整的同步逻辑,而是一个“保存时上传”功能,只有在eclipse中保存文件时才会触发。我建议 Apatana 相应地重命名它,因为它可能会令人困惑。有了这种新的理解,下面的答案就更有意义了。
有关更多背景信息,这里是我对一个网站的设置:
A) 几个开发项目:一个核心 PHP 框架项目 (drupal),它链接(如 eclipse 链接文件夹)到几个模块项目。核心和模块项目是独立的 Eclipse 项目,拥有从 drupal.org 上的上游存储库克隆的自己的 git 存储库。通过这种方式,模块的升级可以独立于其他模块和核心来完成。
B) 一个开发服务器项目:包含要部署在开发 Web 服务器上的文件。需要是上面 A) 中提到的核心项目的副本,但作为核心源项目中链接文件夹但需要成为该项目中的纯文件副本的模块除外。该项目有自己的 git 存储库,与上述存储库不同,其目的是对整个网站进行快照。
C) 一个生产服务器项目:包含要部署在实时 Web 服务器上的文件。在 B 的开发服务器存储库的克隆中使用单独的分支)
我希望 Aptana Studio 可以自动实现 A 到 B 之间的同步。 手动操作工作正常,链接资源从 A 复制到 B。 不过我希望这个过程是自动的,即当项目 A 中的文件发生更改时,它们会自动复制到项目 B。
I'm able to set up a connection in project A between two local folders, from project A to project B.
Manual upload/download is then possible using the contextual menu in project A.
But how about automatic sync between the two locations?
I see this possible for protocols such as FTP, but not when the target is a local directory.
Is this a missing feature, or is there a trick?
Edit: the answer/comments below explain that in fact Aptana sync feature is not a full sync logic but rather an 'upload when saving' feature that only gets triggered upon saving a file in eclipse. I would advise Apatana to rename it accordingly because it can be confusing. With this new understanding the answer below makes more sense.
For more background info here's my setup for one web site:
A) Several development projects: one core PHP framework project (drupal) which links (as in eclipse linked folders) to several module projects. Core and module projects are separate eclipse projects with their own git repo cloned from upstream repos on drupal.org. This way upgrading a module can be done independently from other modules and from core.
B) One development server project: contain the files to be deployed on the development web server. Needs to be a copy of the core project mentioned above in A), except that modules which are linked folders in core source project but need to become plain files copies in this project. This project has its own git repository different from the above repositories, and serves the purpose of snapshoting the whole web site.
C) One production server project: contain the files to be deployed on the live web server. Uses a separate branch in a clone of the development server repo from B)
I was hoping Aptana Studio could automate the sync between A to B.
Manual operations work fine, linked resources are copied from A to B.
However I'd like this process to be automatic, i.e. when files change in project A, they're automatically copied to project B.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个解决方法,使用 FTP 服务器作为桥梁:
设置从项目 A 到 FTP 服务器的连接 (http://wiki.appcelerator.org/display/tis/FTP%2C+SFTP%2C+和+FTPS+部署)并确保选择“自动将我的更改与远程站点同步”;
使用右键菜单“部署”>“建立从项目 A 到项目 B 的连接”连接>添加新连接;
右键单击“项目 A”并选择“属性”>“项目 A”文件传输,然后在“连接”组合框中选择“项目 B”并选中“使用默认连接”。
现在,当您在项目 A 中保存文件修改时,它应该会自动上传到项目 B。
希望这会有所帮助。
There is a workaround, using a FTP server as a bridge:
Set up a connection from Project A to a FTP server (http://wiki.appcelerator.org/display/tis/FTP%2C+SFTP%2C+and+FTPS+Deployment) and make sure "Automatically sync my changes with the remote site" is selected;
Set up a connection from Project A to Project B using the right-click menu Deploy > Connections > Add New Connection;
Right-click on Project A and select Properties > File Transfer, then in the Connection combo box, select Project B and check "User the connection as default".
Now when you save a file modification in Project A, it should get automatically uploaded to Project B.
Hope this helps.