I'm making website for one organization in Django
. Everything works fine, but every time I wan't to change something, I try it on local "mirror" (all files are copied) of the website and if everything works well, I "push" it to the actual webpage. Sometimes, e.g small templates edits etc. I do on the actual webpage, since It is boring to make new copy.
我正在为Django的一个组织制作网站。一切正常,但每次我都不想改变一些东西,我会在网站的本地“镜像”(所有文件都被复制)上尝试,如果一切正常,我会“推”到实际的网页。有时,例如小模板编辑等我在实际的网页上做,因为制作新副本很无聊。
So my question is: Is there something like github commit-push
system for developing sites? Something, what would allow me to do one way sync from actual webpage to my (not necessarily local) copy and after trying these changes on this copy I could just "push" to the main (only changed files of course)?
所以我的问题是:是否有类似github commit-push系统的东西用于开发网站?什么,什么会允许我从实际网页到我的(不一定是本地)副本进行单向同步,并且在这个副本上尝试这些更改后,我可以“推”到主(当然只有更改的文件)?
Thanks
谢谢
1 个解决方案
#1
0
You might want to have a look at Fabric. It's essentially a wrapper around ssh and an excellent tool for all your deployment needs. With Fabric you write so called "tasks" in Python that do all the repetitive stuff you would normally do in the shell.
你可能想看看Fabric。它本质上是ssh的包装器,是满足您所有部署需求的出色工具。使用Fabric,您可以在Python中编写所谓的“任务”,它可以执行您通常在shell中执行的所有重复操作。
To update your production environment against your development environment (or vice versa) some common things to do are:
要针对您的开发环境更新您的生产环境(反之亦然),一些常见的事情是:
- ssh into server
- ssh到服务器
- activate virtualenv
- 激活virtualenv
- cd to your project directory
- cd到你的项目目录
- git update
- git更新
- collect static files
- 收集静态文件
- touch the wsgi file
- 触摸wsgi文件
- copy over some media files (via rsync, sftp or whatever)
- 复制一些媒体文件(通过rsync,sftp或其他)
- dump or import a database
- 转储或导入数据库
- ...
- ...
Now with Fabric you wrap all this stuff in tasks, that can later be run from your development environment.
现在使用Fabric,您可以将所有这些内容包装在任务中,以后可以从您的开发环境中运行。
It might take a while until you have written and combined all the tasks for your specific environment and needs, but it's very well worth the effort.
可能需要一段时间才能为您的特定环境和需求编写和组合所有任务,但这非常值得付出努力。
#1
0
You might want to have a look at Fabric. It's essentially a wrapper around ssh and an excellent tool for all your deployment needs. With Fabric you write so called "tasks" in Python that do all the repetitive stuff you would normally do in the shell.
你可能想看看Fabric。它本质上是ssh的包装器,是满足您所有部署需求的出色工具。使用Fabric,您可以在Python中编写所谓的“任务”,它可以执行您通常在shell中执行的所有重复操作。
To update your production environment against your development environment (or vice versa) some common things to do are:
要针对您的开发环境更新您的生产环境(反之亦然),一些常见的事情是:
- ssh into server
- ssh到服务器
- activate virtualenv
- 激活virtualenv
- cd to your project directory
- cd到你的项目目录
- git update
- git更新
- collect static files
- 收集静态文件
- touch the wsgi file
- 触摸wsgi文件
- copy over some media files (via rsync, sftp or whatever)
- 复制一些媒体文件(通过rsync,sftp或其他)
- dump or import a database
- 转储或导入数据库
- ...
- ...
Now with Fabric you wrap all this stuff in tasks, that can later be run from your development environment.
现在使用Fabric,您可以将所有这些内容包装在任务中,以后可以从您的开发环境中运行。
It might take a while until you have written and combined all the tasks for your specific environment and needs, but it's very well worth the effort.
可能需要一段时间才能为您的特定环境和需求编写和组合所有任务,但这非常值得付出努力。