部署wordpress

tech2022-09-27  68

部署wordpress

As a PHP application, WordPress is often deployed using an older method: uploading files via FTP. This can be stressful and time consuming, especially when a heavy duty WordPress project has to be deployed.

作为PHP应用程序,WordPress通常使用较旧的方法进行部署:通过FTP上传文件。 这可能是压力大且耗时的,尤其是当必须部署重型WordPress项目时。

There are quite a few tools like: Jenkins, Beanstalk, and Deploy; which promise a pain-free WordPress deployment via an automated approach. However, in this article, I’ll be introducing you to a powerful Ruby package — Wordmove, which offers a very fast and easy automated WordPress website deployment.

有很多工具,例如: Jenkins , Beanstalk和Deploy ; 通过自动化的方法,可以实现无痛的WordPress部署。 但是,在本文中,我将向您介绍一个功能强大的Ruby程序包-Wordmove,它提供了非常快速,轻松的自动化WordPress网站部署。

那么,什么是Wordmove? (So, What Is Wordmove?)

Wordmove is a little Ruby gem that lets us automatically mirror our local WordPress installation and database data back and forth, from our local development machine to the remote staging server.

Wordmove是一个小小的Ruby宝石,它使我们能够从本地开发机器到远程登台服务器来回自动镜像本地WordPress安装和数据库数据。

We can simply think of Wordmove as a Capistrano for WordPress, with complete push and pull capabilities. Or perhaps if we are very familiar with GitHub, we can think of Wordmove as Git, our remote WordPress acting as our GitHub repo, and our local WordPress installation as the local cloned fork of our repo.

我们可以简单地将Wordmove视为WordPress的Capistrano,具有完整的推拉功能。 或者,如果我们对GitHub非常熟悉,我们可以将Wordmove视为Git,将远程WordPress用作GitHub存储库,将本地WordPress安装视为存储库的本地克隆fork。

Wordmove comes with a full support for both OS X and Linux operating systems, and also has support for SSH connections, while FTP is planned to be discontinued at some point of future development.

Wordmove完全支持OS X和Linux操作系统,还支持SSH连接,而FTP 计划在将来的开发中停止使用 。

Wordmove的好处 (Benefits of Wordmove)

Deploy Local WordPress to Live Site: Wordmove provides an automated and easy approach to deploying our WordPress site to a production server. We don’t have to go through the time consuming manual process, a simple command: wordmove push --all does all the work.

将本地WordPress部署到实时站点: Wordmove提供了一种自动化,简单的方法来将WordPress站点部署到生产服务器。 我们不必执行耗时的手动过程,只需执行一个简单的命令: wordmove push --all就可以完成所有工作。

Push and Pull Capability: Wordmove enables us to push new changes to the production server, and also pull new changes like updated database from the production server. When backing up WordPress files and database manually, Wordmove can come in handy in making the process quite a bit faster.

推和拉功能: Wordmove使我们能够将新的更改推到生产服务器,也可以从生产服务器拉新的更改,例如更新的数据库。 当手动备份WordPress文件和数据库时,Wordmove可以使流程更快一些。

Ability to Specify what to Push/Pull only: Wordmove understands that we won’t be interested in pushing all WordPress files at all time, so it comes with an option to specify what to push — database, plugins, themes, or uploaded media files only.

能够仅指定要推送/拉动的内容: Wordmove理解我们不会一直对所有 WordPress文件都感兴趣,因此它带有一个选项来指定要推送的内容-数据库,插件,主题或上载的媒体文件只要。

Work with Multiple Enviroments at a Time: It also allows us to work with multiple environments at a time, if we have staging site, production site etc. See this wiki article Multiple Environment Explained which has what you need to know.

在一次处理多个Enviroments工作:它也使我们能够与多种环境下正常工作的时间,如果我们已经举办场地,生产场地等看到这个wiki文章多环境解释其中有你所需要知道的。

It’s Super Fast: Pushing and pulling WordPress files with Wordmove is amazingly fast and easy. This is because Wordmove uses rsync which makes copying of files super quick and about 5-10 times as fast as FTP.

它的速度非常快:使用Wordmove推入和拉出WordPress文件非常便捷。 这是因为Wordmove使用rsync,它使文件的复制速度非常快,大约是FTP的5-10倍。

安装Wordmove (Installing Wordmove)

Installing Wordmove is quiet easy, for Windows users. Ruby has to be installed first on the machine before moving on to install Wordmove. Windows doesn’t come with Ruby pre-installed, compared to Linux and some other Operating Systems. After installation, then we can proceed to run this command in the terminal or command prompt.

对于Windows用户而言,安装Wordmove非常容易。 在继续安装Wordmove之前,必须先在计算机上安装Ruby。 与Linux和其他一些操作系统相比,Windows没有预装Ruby。 安装后,我们可以继续在终端或命令提示符中运行此命令。

gem install wordmove

gem install wordmove

It’s important to note that, Wordmove does not come with any official support for Windows, see the windows (un)support disclaimer here; however, it doesn’t mean Wordmove doesn’t work on Windows (I personally use Wordmove on Windows). It is just that the Wordmove developers can’t help with problems concerning a Windows environment, just in case we have any issues.

重要的是要注意,Wordmove不附带对Windows的任何官方支持,请参见Windows(un)support免责声明 ;请参见 但是,这并不意味着Wordmove在Windows上不起作用(我个人在Windows上使用Wordmove)。 只是如果我们有任何问题,Wordmove开发人员就无法解决与Windows环境有关的问题。

用法 (Usage)

wordmove help Tasks: wordmove help [TASK] # Describe available tasks for one or more specific task wordmove init # Generate a brand new Movefile wordmove pull # Pulls WordPress data from remote host to the local machine wordmove push # Pushes WordPress data from local machine to remote host

移动文件 (Movefile)

Wordmove requires a Movefile — a YAML file with all the local and remote host information, which simply serves as a configuration file, see an example here, before any push or pull operations can be done. To create a Movefile, go to (cd in command line) in the WordPress root directory and then copy this:

Wordmove需要一个Movefile —一个YAML文件,其中包含所有本地和远程主机信息,该文件仅用作配置文件,请参阅此处的示例,然后才能执行任何推或拉操作。 要创建Movefile,请转到WordPress根目录中的CD(在命令行中输入cd),然后将其复制:

wordmove init

wordmove init

This command generates a new Movefile in our WordPress root directory, we open it with any text editor and edit it with our settings. See this wiki article Movefile Configuration Explained to understand more about the supported configuration, and to have a more in-depth knowledge about Movefile.

此命令在WordPress根目录中生成一个新的Movefile,我们使用任何文本编辑器将其打开,然后使用设置进行编辑。 请参阅此Wiki文章Movefile Configuration Explained,以了解有关受支持的配置的更多信息,以及对Movefile的更深入的了解。

将所有WordPress安装推送到远程服务器 (Pushing All WordPress Installations to a Remote Server)

Wordmove allows us to push all WordPress installations to our remote server by simply running a one line command in the terminal or command prompt without any stress.

Wordmove允许我们通过简单地在终端或命令提示符中运行一个命令行来将所有WordPress安装推送到我们的远程服务器,而无需施加任何压力。

wordmove push --all

wordmove push --all

Isn’t that great? After running the simple command, all WordPress installations will be transferred to our production site. When pushing only new files or modified files, we use the same command, as Wordmove will check the file differences and push only edited or new files; so no need to be worried about getting duplicate files pushed.

那不是很好吗? 运行简单命令后,所有WordPress安装程序都将转移到我们的生产站点。 当仅推送新文件或修改的文件时,我们使用相同的命令,因为Wordmove将检查文件差异并仅推送已编辑的文件或新文件; 因此无需担心会推送重复的文件。

从远程拉 (Pulling from Remote)

Wordmove also allows us to pull some files from our remote server to our local server easily. We can simply run a pull command with an additional option of what to pull, for instance, let’s assume we want to pull an updated database, and new uploads, we run:

Wordmove还允许我们轻松地将一些文件从远程服务器拉到本地服务器。 我们可以简单地运行带有附加选项的pull命令,例如,假设我们要提取更新的数据库,并运行新上传的文件:

wordmove pull -dbu

wordmove pull -dbu

Where dbu stands for database and uploads. See usage and flags explained for a comprehensive list of available flags and their explanations.

dbu代表database and uploads 。 有关可用标志及其说明的完整列表,请参见用法和标志说明。

推送特定文件夹 (Pushing Specific Folder)

Wordmove understands that we won’t be pushing all our WordPress files at all times, so it comes with an option to specify a group of files to be pushed; either our plugin files, themes, or uploads for example. Assuming we modified our theme, we can commit the changes to our remote server by running this command:

Wordmove知道我们不会一直推送所有的WordPress文件,因此它带有一个选项来指定要推送的文件组; 例如我们的插件文件,主题或上载。 假设我们修改了主题,我们可以通过运行以下命令将更改提交到远程服务器:

wordmove push -t

wordmove push -t

Where -t stands for themes, -u for uploads, p for plugins and d for database, depending on what we’re pushing.

其中-t代表主题 , -u代表上载 , p代表插件 , d代表数据库 ,这取决于我们要推送的内容。

结论 (Conclusion)

Automated deployment saves us the time of doing repetitive tasks every time we start to deploy our WordPress project. It also helps to minimize the down time during deployment and eliminate common human errors such as missing files or uploading wrong files.

自动化部署可以节省我们每次开始部署WordPress项目时重复执行任务的时间。 它还有助于最大程度地减少部署期间的停机时间,并消除常见的人为错误,例如丢失文件或上传错误的文件。

In this article, I have introduced you to Wordmove, the powerful WordPress deployment tool which helps to ensure an easy and super fast WordPress deployment. I’ve given you an overview of it’s benefits and demonstrated how to perform a basic push and pull operation using it.

在本文中,我向您介绍了Wordmove,它是功能强大的WordPress部署工具,可帮助确保轻松,快速地进行WordPress部署。 我已概述了它的好处,并演示了如何使用它执行基本的推入和拉出操作。

If you’ve tried Wordmove, please feel free to share your experiences or opinions with us using the comments section below.

如果您尝试过Wordmove,请随时使用下面的评论部分与我们分享您的经验或意见。

翻译自: https://www.sitepoint.com/wordmove-wordpress-deployment-tool/

部署wordpress

最新回复(0)