pantheon-systems / terminus-site-clone-plugin

A Terminus plugin that adds the `site:clone` command to facilitate cloning sites on Pantheon
MIT License
21 stars 11 forks source link

Re-create multidev ENVs #11

Closed ElijahLynn closed 6 years ago

ElijahLynn commented 6 years ago

Re-creating multidev ENVs would be ideal to make this more complete.

ElijahLynn commented 6 years ago

This seems doable with terminus multidev:list grab the branch names and then pass the names to xargs terminus multidev:create.

ElijahLynn commented 6 years ago

This would also be dependent on https://github.com/pantheon-systems/terminus-site-clone-plugin/issues/9 (Push all branches, not just master)

ataylorme commented 6 years ago

Right now the plugin is intended to clone one environment from a Pantheon site to a new Pantheon site as that is not something possible in the dashboard. It does not do a full clone of all site history, backups, etc. Perhaps the name is a bit confusing.

I outlined the starter site use case I had in mind when building the plugin in this blog post. @ElijahLynn can you expand on your use case? I'm curious why you need to clone everything to a new site (what problem does that solve) and how often that need is occurring.

ElijahLynn commented 6 years ago

Well, the actual use case is to just rename the site. The customer wants foo instead of foo-com. So that is what I actually want, I spoke with support and was told that isn't possible and pointed towards this plugin.

ataylorme commented 6 years ago

@ElijahLynn Seems like what you want is to have a new site created and copy all environments to that new site. I think that is more of an edge case than the intended use case for this plugin so I don't want to add it directly.

However, you can run terminus site:clone multiple times, once for each environment on the source (foo) site. Rather than doing so manually, it can be done in a bash script.

I've added an example to the repo at examples/create-new-site-and-clone-all-envs/terminus-new-site-clone-all-envs.sh. Let me know how that works for you.

ElijahLynn commented 6 years ago

Wow, that was above and beyond what I was expecting, bonus points for you Andrew! I'll test it out soon and let you know how it goes and then we can close this.

ElijahLynn commented 6 years ago

Just tested it and since our admin had already created the site, I commented out lines 13:38 to create the new "site". But that also means that test and live are not showing "N commits ready to deploy from X environment", since the test and live clones are using the --no-code option, which makes sense since we cannot push to test and live (I realize they are just tags). How should I go about this? Should we delete the site completely and start over?

ElijahLynn commented 6 years ago

Actually, seems like the latest pantheon_{test,live}_N tags were deployed and {test,live} are correct but the dashboard is not aware of them.

ElijahLynn commented 6 years ago

OH. I am just still getting used to pantheon, the </> Code tab has the correct commits, I was looking at Deploys tab. I think all is well.

ElijahLynn commented 6 years ago

Yeah, :+1:! We can close this.

ataylorme commented 6 years ago

Great, glad it worked well for you! I am going to close the other issues as well. If you feel they still need to be considered please re-open them.