Closed ElijahLynn closed 6 years ago
This seems doable with terminus multidev:list
grab the branch names and then pass the names to xargs terminus multidev:create
.
This would also be dependent on https://github.com/pantheon-systems/terminus-site-clone-plugin/issues/9 (Push all branches, not just master)
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.
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.
@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.
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.
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?
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.
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.
Yeah, :+1:! We can close this.
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.
Re-creating multidev ENVs would be ideal to make this more complete.