I have the following setup: A local debian maschine with a LAMP setup. Now I need to work with a PHP project which is administered via git (or GitLab in special).
我有以下设置:具有LAMP设置的本地debian maschine。现在我需要使用一个PHP项目,它通过git(或特殊的GitLab)管理。
If I (or other developers) join the project, I must do several thinks:
如果我(或其他开发人员)加入该项目,我必须做几个想法:
- Create a MySQL database
- 创建一个MySQL数据库
- Import the MySQL schema
- 导入MySQL架构
- Create a vHost for Apache
- 为Apache创建一个vHost
- ...
- ...
If I update the project after a time of inactivity, I must update several thinks:
如果我在一段时间不活动后更新项目,我必须更新几个想法:
- Changes in MySQL schema
- MySQL架构的变化
- Insert/Update/Delete records
- 插入/更新/删除记录
- ...
- ...
And this must to be done by every single developer. Now I search a solution to automate this workflow. I once considered Apache Ant and I think the tool can create a solution.
这必须由每个开发人员完成。现在我搜索一个解决方案来自动化这个工作流程。我曾经考虑过Apache Ant,我认为该工具可以创建一个解决方案。
In the Ant file I can create workflows for the database, the vhost and other things. Additional I need a tool to manage MySQL migrations (Phinx maybe?). This tool can I trigger by Ant also, so I can automate the MySQL updates in/after a checkout process.
在Ant文件中,我可以为数据库,vhost和其他东西创建工作流。另外我需要一个工具来管理MySQL迁移(Phinx可能吗?)。我也可以通过Ant触发此工具,因此我可以在结帐过程中/之后自动执行MySQL更新。
But this complete idea is created by myself. I have no experience with such kinds of processes. And it is very hard to search for this topic if you dont have any experience because I found so many topics and sides about continuous integration, continuous delivery, different tools so that I cant separate what is relevant for my need.
但这个完整的想法是由我自己创造的。我没有这种过程的经验。如果您没有任何经验,那么很难找到这个主题,因为我发现了很多关于持续集成,持续交付,不同工具的主题和方面,因此我无法区分与我的需求相关的内容。
Unfortunately I need help and advice to find the right/best way for my case.
不幸的是,我需要帮助和建议,为我的案例找到正确/最好的方法。
PS: Sorry for any grammar mistakes. English is not my native language.
PS:对不起任何语法错误。英语不是我的母语。
1 个解决方案
#1
0
One of the ways to manage local development environments, gaining popularity recently, is using some kind of virtualization, via VMs or containers. Vagrant and Docker are two most popular solutions. Usually they are accompanied by a provisioner tools, like Ansible or Chef. The idea is that you'll need to maintain in an actual state an image (or multiple images) of your development environment. Newcommers will need to install the same tool and bootstrap the environment. Dig the internet to find more.
管理本地开发环境的方法之一,最近获得普及,是通过虚拟机或容器使用某种虚拟化。 Vagrant和Docker是两种最受欢迎的解决方案。通常它们伴随着一个供应工具,如Ansible或Chef。我们的想法是,您需要在实际状态下维护开发环境的图像(或多个图像)。新手需要安装相同的工具并引导环境。挖掘互联网以找到更多。
If you containerize and version your DB this way, you won't need any migration tools at all (hopefully): the tool of your choice will handle versions by design. But you will be still free to use Phinx or other solution, like Liquibase or FlyWay. The migrations is this case can be versioned with Git, next to your main code base.
如果您以这种方式对数据库进行容器化和版本化,则根本不需要任何迁移工具(希望如此):您选择的工具将按设计处理版本。但您仍然可以*使用Phinx或其他解决方案,如Liquibase或FlyWay。这种情况下的迁移可以使用Git进行版本控制,在主代码库旁边。
#1
0
One of the ways to manage local development environments, gaining popularity recently, is using some kind of virtualization, via VMs or containers. Vagrant and Docker are two most popular solutions. Usually they are accompanied by a provisioner tools, like Ansible or Chef. The idea is that you'll need to maintain in an actual state an image (or multiple images) of your development environment. Newcommers will need to install the same tool and bootstrap the environment. Dig the internet to find more.
管理本地开发环境的方法之一,最近获得普及,是通过虚拟机或容器使用某种虚拟化。 Vagrant和Docker是两种最受欢迎的解决方案。通常它们伴随着一个供应工具,如Ansible或Chef。我们的想法是,您需要在实际状态下维护开发环境的图像(或多个图像)。新手需要安装相同的工具并引导环境。挖掘互联网以找到更多。
If you containerize and version your DB this way, you won't need any migration tools at all (hopefully): the tool of your choice will handle versions by design. But you will be still free to use Phinx or other solution, like Liquibase or FlyWay. The migrations is this case can be versioned with Git, next to your main code base.
如果您以这种方式对数据库进行容器化和版本化,则根本不需要任何迁移工具(希望如此):您选择的工具将按设计处理版本。但您仍然可以*使用Phinx或其他解决方案,如Liquibase或FlyWay。这种情况下的迁移可以使用Git进行版本控制,在主代码库旁边。