I use GitFlow workflow, and will often want to deploy a feature branch to a remote stage server, and not the default branch that is in my environment’s wordpress_sites.yml.
My way of doing this has been to modify the environment’s wordpress_sites.yml before running the deploy playbook, to set the branch value each time, and then running
Is there a way to specify the branch to deploy from the command line as an argument, without changing the file each time? Is some argument like -e "site=mysite.com env=staging branch=feature/myfeature" possible?
I looked but couldn’t find anything. My method is working, but not ideal.
@fullyint is this still a valid option to deal with the deploy of different branches?
i saw that it is an old post (2018), so I am wondering if it is still the best solution or there is a better way these days with the latest version of trellis.
as @mmccaff , I would like to deploy a branch with a new feature on the staging and then if all ok also on the production, so I am looking for a good way to deal with this.
This seems a pretty neat solution - what do you think could be better?
Also, I’m still learning managing a repo and git, but why would you deploy a branch to Production? Wouldn’t you test your branch on staging and the merge it into master and deploy that? I’m curious about your use case…
it is ok to me, I was just wondering if there is some trellis’s new feature for this, because this post is 2 years old, and I know that trellis is always on the move
I am doing a sort of A/B testing, the client wants to see how the page performs with a different layout, so I thought that creating a branch would be a good option for this scope. (not sure if there is a better approach for this).