D
D
Dmitry Karyakin2016-02-29 09:53:41
PHP
Dmitry Karyakin, 2016-02-29 09:53:41

How to automate the download of updates to the site?

I administer a WordPress site with a large number of templates with different designs. Update scheme:
step 1) Making changes to CSS/HTML/JS/PHP/Images, etc.
step 2) Change the CSS/JS version in PHP templates. For example, style.css?001 --> style.css?002 or script.js?003 --> script.js?004
step 3) Manually upload files via SFTP to the server
I want to automate steps 2.3. For example, it would be convenient to write the "Landing Update 1" script once, which automatically increments the versions in the corresponding .php template and uploads the necessary files (.css, .js, .php) or entire folders (c .jpeg, .png) to the server .
This is necessary not only because of laziness, but because sometimes you have to simultaneously roll out changes in several templates at once, as a result, there are many moments where you can make a mistake (for example, upload styles from one template to the folder with styles of another template or forget to update the php version file). With a test server, this work is doubled.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Kharitonov, 2016-02-29
@dmitrykaryakin

Start a git repository, work in it, you will not have file versions, but there will be a convenient history of all changes with the ability to roll back at any time.
If you have access to the server via SSH, write the following command to copy files from your computer to the server using rsync (you can try the scp utility, it seems to be available under windows as well):
rsync -avc /path/to/local/files [email protected] :/path/to/wordpress
If you don't have SSH, you can git clone the repository on a remote server, when updating, go there manually and do a git pull. There is a more complicated option, but ultimately more convenient, with a bare git repository on a remote server, you can google on the Internet what it is and how it is done.

S
Sergey, 2016-02-29
@gangstarcj

Why all these "style.css?001 --> style.css?002 or script.js?003 --> script.js?004"? Can't use one file and update it?
Try learning GIT, maybe it will help you solve your problem

@
@mgyk, 2016-02-29
_

Look at capistrano. And roll out automatically to several servers at once
jeremykendall.net/2013/11/24/php-and-capistrano-3-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question