Jump to content

Maintain separate configs for live/dev like a boss :)


bernhard
 Share

Recommended Posts

On 3/14/2024 at 10:45 AM, millipedia said:

accidentally uploading a config-dev file to a live site

Same happened to me, as my IDE auto-uploaded this file because I had checked a setting to "upload a changed file" on save. Somehow it thought I changed the config-dev.php and uploaded it. Site was not reachable after that.

Link to comment
Share on other sites

On my side I use a script to upload site, there's 2 parts:

- A Ant project that synchronizes some folders/files from the source code to a "target" directory, add a version number and transpile SCSS to CSS, TypeScript to JS...
- A bash script that runs the Ant project, and if no error, use rsync to synchronize only changed files with the production server. It uses a file listing exclusions so I'm sure the site/config.php will never be uploaded, like the sessions or the cache.
This script is a Linux one because Linux have those powerful integrated tools like rsync, but I'm running Windows and executing the script with Microsoft Linux WSL.
I have another bash script for staging server, it's the same as for production except it also pushes a clean version of my local ProcessWire database to the staging server.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...