Needs work
Project:
Hostmaster (Aegir)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Sep 2010 at 19:55 UTC
Updated:
20 Jan 2014 at 21:33 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
helmo commentedIn my opinion it would make most sense to include this in platform creation.
It would be nice to go to an existing platform and create a task to create a new platform version. Especially in cases where a makefile is used for the platform this could come in handy.
I'm not sure if we could just copy the existing platform tree in case no platform files exist for the new platform and a makefile is not present either.
Comment #2
Robin Millette commentedsubbing
Comment #3
steven jones commentedChanging the title to reflect what's wanted here.
Comment #4
helmo commentedJust thinking out loud here about how this would look....
Create new platform task type in hostmaster,
* called "clone platform" or just "clone" if that doesn't lead to confusion.
* type is available when a makefile is specified for the platform
* Create new platform node based on makefile
* Path and name should be derived from a predetermined scheme
*
<distribution>-<core version>-<distribution-version>-<build tag/code>e.g. openatrium-6.x-1.0-aegir1
* Other platform properties should be copied, autonomously if possible via hooks otherwise (e.g. in hosting_profile_roles)
Pro: this should be possible without changes to provision
Con: does not work for users who don't use makefiles
Comment #5
anarcat commentedi like having provision-clone also work on platforms.
Comment #6
steven jones commentedComment #7
steven jones commentedtagging
Comment #8
helmo commentedAn addition to provision would be nice here.
It should:
* copy the platform tree
** excluding the sites/* folders, but still copy sites/all and sites/default
Advantages:
* work for platforms without a makefile
* Prevent having updated version in the platform clone
* Allow for cloning a platform to a different server
Notes:
* It's tempting to use hardlinks, but screwing up is easy. As applying a patch could change both platforms
I'm hacking on some prototype code for this.... see patches.
I've neglected to indent some pieces to keep the diff clean.
Comment #9
anarcat commentedthat's cool, marking proper status.
Comment #10
helmo commentedI've worked a bit more on this.
* UI now works from hostmaster site
* compatibility with hosting_pathauto
* Selecting a target server
A few todo's remain open, comments would be appreciated.
Comment #11
helmo commentedSome open questions:
* Is it ok to handle sites and platforms in provision-clone, or should these be split?
* I manually call rsync or should we use drush_core_call_rsync()
* Can I run
provision_backend_invoke('@hostmaster', 'hosting-import', array($platform_alias));from drush_provision_drupal_provision_clone in provision or from the hosting module via a hook drush_provision_drupal_post_provision_cloneComment #12
Anonymous (not verified) commentedHi helmo,
Thanks for your work on this!
Answers to your questions:
1) It's ok to have it all in platform/clone.provision.inc if that's what you mean. We do the same with provision-delete and provision-verify.
2) I think it would be best to try and be consistent with what we do in verify, e.g when rsyncing to remote hosts.. at least in terms of what function we call. Note that the provision.context.inc uses drush_core_call_rsync() with an array of options, which might be nicer, because drush_core_call_rsync seems to accept 'exclude-sites' as an argument (see drush rsync --help). In general I am keen to rely on Drush's built-in support for such things.
3) This would be better as a post hook in the hosting_clone feature, and it could just call the hosting_import function directly in that case (I think? Presuming we can get the new platform alias name back from the provision context.. we should be able to because we import sites in a post hook in frontend too)
A couple notes on the patches:
1) We have a couple of print_r() and commented out test code in both hosting and provision patches.. and possibly whitespace as I can see modified lines where the code isn't actually changing
2) Typo 'platfomr' in the provision patch
These are just cosmetic at a first glance - I will try to test the actual functionality of the patches soon.
Thanks again!
Comment #13
helmo commentedI've now updated the patch to use drush_core_rsync to make use of the exclude-sites option.
This does depend a bit on Drush 5, and some of it's issues #1596916: include-vcs option gets passed directly to rsync
I've removed the debug code.
Just the provision patch at the moment.
Comment #14
anarcat commentedplease mark proper status.
Comment #15
helmo commentedWell, although any review is welcome I left it at needs work because I only updated the provision side, the hosting patch still needs to be updated. I just ran out of time.
Comment #16
Robin Millette commentedComment #17
ergonlogicNew features need to be implemented in Aegir 3.x, then we can consider back-porting to Aegir 2.x.