Trouble setting up Staging to use 'staging' branch

I’d like to setup my staging server to pull from the staging branch in my repo.
I set up the branch locally, added a remote to track staging remote, and pushed changes up.

In staging/wordpress_sites i changed the repo to staging.
I ran
ansible-playbook server.yml -e env=staging

, and

./ staging

without errors.
But the changes do not reflect on staging. It seems like Trellis is still pulling from the master Branch.
As though Trellis is not picking up the change, somehow. I verified, in the remote repo that the changes had pushed up properly to staging.
What am I doing wrong? / Is this just a bad idea?


I humbly retract my issue.
I made my change to wordpress_sites on the staging branch, and ran server.yml from the master branch.
Making the change to the master branch and re-provisioning seems to have worked.
Time for another coffee, I think.

But does anyone have any thoughts on having a separate branch for staging? I know it could eventually cause some confuision. Is this unnecessary?
I decided to do this, because I’m on a Slack team and I have it setup to alert the team, whenever I push to the master branch. I wanted to try out my changes on staging first, and then alert the team when I’ve verified and pushed the changes to the master branch. The team here is a designer and like, content manager. I’m the only dev.
Anyone have any experience with this?
Thanks, Zach

Yes, I would suggest having a staging branch, whether you’re on a team or not. I generally call it staging or develop.

This is important when you work on feature branches, and even more important when you work on a team. You can merge to staging and deploy any feature that is finished and needs feedback or even possibly a work in progress. Other people may be doing the same. The point is to keep each feature in it’s own branch, and possibly in your own fork of the project.

By doing this, you can work on a feature until completion, Only then do you submit a pull request from your feature branch to master branch, and when it’s merged to master, you deploy to production your finished code and only your finished code.

If you use the same branch for staging and production, what happens when someone commits something they’re still working on, but you need to deploy to production? Can’t.

1 Like

:raised_hands: Branches

The branch to be deployed is determined not by the branch that is active on your local machine, nor by the environment you specify in your deploy command (e.g., ./ <environment>

Rather, the branch to be deployed is determined by the value of the branch parameter in the wordpress_sites on your local (control) machine. I’m guessing you left the default of

branch: master

when maybe you needed

branch: my-staging-branch
1 Like