Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
388 views
in Technique[技术] by (71.8m points)

wordpress - 在有状态CMS中将后台与Github同步(Synchronise back-office with Github in a stateful CMS)

For the continuous integration and deployment of websites, I am using this pipeline:

(为了持续集成和部署网站,我使用以下管道:)

在此处输入图片说明

But for many CMS like wordpress, prestashop, magento and others, the configuration of the website and the installation of plugins is done in the back-office of the deployed website.

(但是对于许多CMS,例如wordpress,prestashop,magento等,网站的配置和插件的安装都是在已部署网站的后台进行的。)

For now, I am building the docker image on top of the CMS base image, then replacing all the /var/html directory with the files in github.

(现在,我在CMS基本映像之上构建docker映像,然后将所有/ var / html目录替换为github中的文件。)

Then Kubernetes is deploying the containers and plug a database and a persistent storage

(然后Kubernetes正在部署容器并插入数据库和持久性存储)


Hence, this is breaking my pipeline: imagine that someone is installing and configuring a plugin in the back-office, then someone else is doing a modification on a file and pushes it to github.

(因此,这打破了我的工作流程:假设有人正在后台中安装和配置插件,然后其他人正在对文件进行修改并将其推送到github。)

The github repo doesn't have the info that a plugin was installed and will build and deploy a new image without it.

(github存储库没有安装插件的信息,如果没有该信息,它将构建和部署新映像。)

How to integrate all the modifications done in the back-office in my github repository?

(如何在我的github存储库中集成后台中完成的所有修改?)

  ask by Antoine C. translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The solution we use is an override of the DB class.

(我们使用的解决方案是覆盖DB类。)

So we monitor a number of tables (Configuration, module, hook, etc ...) and we store all queries about it in a sql file.

(因此,我们监视许多表(配置,模块,挂钩等),并将所有关于它的查询存储在sql文件中。)

So during commit, we also have a .sql actions to perform on the database side.

(因此,在提交期间,我们还有一个.sql操作要在数据库端执行。)

Once deployed, either you manually execute the sql, or a script detect that new SQL are present and executes.

(部署后,您可以手动执行sql,也可以通过脚本检测到并执行新的SQL。)

In this way we are always up to date.

(这样,我们始终保持最新状态。)

This solution we developed in the form of Prestashop modules to track all actions.

(我们以Prestashop模块的形式开发了此解决方案,以跟踪所有操作。)

Regards

(问候)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...