1

Question: What is everyone doing to deploy (capistrano) and the redeploy after the client has changed files on production?

Background: I have a site in production now. I have deploying down pat with a custom Capistrano script. Life is (was) great...until the client started editing templates directly on the server (as they should since they won't be doing deploys like me).

My NEW deploy steps now look like this:

  1. Grab a DB dump of the Production database
  2. Import this DB dump into my local database
  3. Delete all local templates from my dev folder and ensure the template group folders have write privileges
  4. Synchronize the templates locally to recreate the files (locally in the EE admin)

Problem is Git sees these files as changed and it just doesn't seem right.

There must be a better way! One thought is to sftp all templates from Production to local, which would grab the newly edited templates files, but even that seems a bit crazy.

Suggestions?

  • 2
    Kevin - if my client were editing templates (they don't) I would (s)ftp the template files down the same way I sync the file uploads folder. Not great, but can't think of a better way myself. – CreateSean Jun 5 '14 at 13:42
1

I would definitely recommend not having the client edit Template files, but if you must (like my current situation), based on @CreateSean's comment, I now do the following:

Before Editing

  1. Pull the latest copy from Git
  2. Grab a DB dump of the Production database
  3. Import this DB dump into your local database
  4. Grab all template files from Production through SFTP (where ssh-prod is my ssh credentials for Production):

    $ cd TEMP
    $ sftp -rp ssh-prod:/web/templates .    
    
  5. Paste and overwrite the downloaded templates folder in your local dev directory

  6. Grab all images from the Production server if you want a complete data set (in a similar sftp fashion).
0

I'd say the client shouldn't be changing anything on production other than content (a whole other synching issue).

If changes needed to be made then they should be made in a dev environment and pushed to a code repository then deployed after testing. That's why we have dev->staging->production workflows.

If the client has the technical nous to make these template changes is it not reasonable to assume they could learn to use Git in a basic way and join the "regular" development process?

  • Thanks @foamcow, I agree. However, I think my EE setup might be slightly abnormal. The site has many different types of pages + styles, so the site nav structure was created using template groups and template files (ie. about_us.group contains location.html, contact.html, faq.html). The site isn't a simple Blogging/News site. There are channels for News, Events, etc. but most one-off page content is directly in the template files. I use the Pages module for random pages that required special URLs (from the old site). – Kevin Zych Jun 6 '14 at 1:19
  • I'd say that's even more of a reason to get your client on board using the 'proper' development process and pushing changes to the repo, then deploying from there. – foamcow Jun 6 '14 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.