bwood / quicksilver-settingsphp

Quicksilver experiment
0 stars 0 forks source link

Since the site is in 'git' mode file system permissions will prevent the copy #1

Open bwood opened 8 years ago

bwood commented 8 years ago

Since the site is in 'git' mode file system permissions will prevent the copy:

$ terminus  workflows watch --site=openucb-751-team
[2016-01-11 17:26:03] [info] Watching workflows...
[2016-01-11 17:45:08] [info] Started 0ac4a8d0-b88b-11e5-8901-bc764e10d7c2 Sync code on "dev" (dev)
[2016-01-11 17:45:50] [info] Finished Workflow 0ac4a8d0-b88b-11e5-8901-bc764e10d7c2 Sync code on "dev" (dev)
[2016-01-11 17:45:53] [info]
------ Operation: Preserve current settings.php finished in 11s ------

Warning: fopen(/srv/bindings/79242cdca51b40e58e884a3189c08ded/code/sites/default/settings.php): failed to open stream: Permission denied in /srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/backup_settings.php on line 3

Warning: fwrite() expects parameter 1 to be resource, boolean given in /srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/backup_settings.php on line 4

Warning: fclose() expects parameter 1 to be resource, boolean given in /srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/backup_settings.php on line 5

Warning: copy(/srv/bindings/79242cdca51b40e58e884a3189c08ded/code/sites/all/settings.php): failed to open stream: Permission denied in /srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/backup_settings.php on line 7

[2016-01-11 17:45:53] [info]
------ Operation: Restore settings.php finished in 3s ------
/srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/restore_settings.php: Attempting to operate on /srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/../sites/default/settings.php.

Warning: rename(/srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/../sites/default/settings.php-copy,/srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/../sites/default/settings.php): No such file or directory in /srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/restore_settings.php on line 4

Warning: fopen(/srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/../sites/default/settings.php): failed to open stream: Permission denied in /srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/restore_settings.php on line 5

Warning: fwrite() expects parameter 1 to be resource, boolean given in /srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/restore_settings.php on line 6

Warning: fclose() expects parameter 1 to be resource, boolean given in /srv/bindings/79242cdca51b40e58e884a3189c08ded/code/private/restore_settings.php on line 7

Possible solutions:

  1. If there were a way to put the site into SFTP mode at the beginning of backup_settings.php and return it to GIT mode at the end of the script (and use a similar approach in restore_settings.php), this might work. But even if monkeying with the connection mode in these Quicksilver hooks were possible, it might not play nicely with Pantheon's workflows...
  2. A more manual process could be defined for updating the existing sites. It would go something like this:

2.a. git pull the site to local computer and copy settings.php outside of the working copy of the repo. 2.b. Apply updates. 2.c. git pull again and overwrite settings.php with the copy created in 2.a. 2.d. git commit. git push.

But I was really hoping for a seamless solution that would happen automatically on Apply Updates. There is a large number of existing sites that we need to accommodate.

greg-1-anderson commented 8 years ago

See #2

joshkoenig commented 8 years ago

If there were a way to put the site into SFTP mode at the beginning of backup_settings.php and return it to GIT mode at the end of the script (and use a similar approach in restore_settings.php), this might work.

This is technically possible now, but is a bit of a kludge and not something I would recommend going after at scale in production.

However, this is definitely the spirit of where we want to take things, and we have some ideas on how to get here. In the mean-time I think Greg (see above) is looking into your use case.

bwood commented 8 years ago

I really appreciate you guys reading through this!