Open kirtangajjar opened 4 years ago
I think the best syntax to have is a rsync-ish syntax. Then later we can add a flag in site create to mark a site as prod/dev so that a prod site is not accidentally overwritten.
To clone a site
ee site clone <src> <dest>
-- pull --
# will clone rtcamp.com from remote to local with same name
ee site clone root@rtcamp.aws.rstuff.in:rtcamp.com .
# will clone rtcamp.com from remote to local in rtcamp.local
ee site clone root@rtcamp.aws.rstuff.in:rtcamp.com rtcamp.local
-- push --
# will clone rtcamp.com in local with same name
ee site clone . root@rtcamp.aws.rstuff.in:rtcamp.com
# will clone rtcamp.com in local to rtcamp.local
ee site clone rtcamp.com root@rtcamp.aws.rstuff.in:rtcamp.dev
-- alternate syntax --
ee site clone --push <command>
ee site clone --pull <command>
ee site push <command>
ee site pull <command>
To sync a site, syntax could be same, but with additional parameters - --skip-db
, --skip-files
, --skip-uploads
(for wp)
cc @rahul286
@kirtangajjar can you include syntax for local? More like symlink mode that @mrrobot47 is experimenting for shallow copies to create per branch on same server for rtcamp.com a few client projects.
rsync
This gives me an idea!
Maybe we can create ee sync
as an underlying command which works like rsync
. It can have a flag e.g. --create
which basically tells EE that if dest site doesn't exist. Create it!
Then we can add a syntactic sugar where ee clone
➞ ee sync --create
🤔
I somehow feel if we handle data transfer part well, then ee sync
may act as a base for backup/restore
where dest rather than being EE server, could be s3/Google Drive or ftp or any other storage supported by say duplicity.
We better try to standardize flags such as --skip-db
, --skip-files
, --skip-uploads
etc
To implement this feature, we need to determine the correct site create
parameters for all site types. We cannot keep this logic in site-command because it will create a cyclic dependency to site-type-php/wp. So I think it's best to keep create a separate package for it.
cc @mrrobot47
Update: After our discussion, it seems that it's fine to keep it in a single package for now since there isn't any code-based dependency in it. Will separate it in future if it seems necessary.
Hello folks, there are a few updates over here.
We will add a flag called --ssl=<self,le,custom> which will allow users to specify SSL preference for the newly created site. This is needed because cloning a site from a remote to a local development environment will have an SSL issue.
SSL certs will be copied from the source when the source and destination sitename are the same. If the source site has le
, the dest site will be created by --ssl=custom
. Once the certs will be copied, ee db entry in the destination will be changed to le
.
We will be adding support for additional parameters for SSH which users will be able to specify these will also be used in rsync.
Few ideas:
Overall, ask fewer questions to the user.
Create a command to sync 2 sites.
After implementing this feature, the
site clone
feature will also become really easy to implement.Releated issues: https://github.com/EasyEngine/feature-requests/issues/22 https://github.com/EasyEngine/feature-requests/issues/43 https://github.com/EasyEngine/feature-requests/issues/54