We have two staging PSU servers behind a load balancer. They connect to an SQL DB and are set up for two-way sync with the staging branch in Git.
We have two production PSU servers behind a load balancer. They connect to an SQL DB and have a one-way sync set up to the main branch in git.
When the code is ready to move from staging to production, we merge it from the staging branch to the main branch.
We currently develop on the staging servers, but we want to start developing locally.
The idea is to do feature branches off the staging branch and use them locally. Then, merge those branches into the staging branch for testing before merging them into the main branch.
My question is, does that make sense? Is there a better way? How does everyone else handle this?
This is exactly how I would envision the development flow would take place for larger teams. Typically, the issue is that local development is hard due to resource limitations like API keys or permissions.
What you’re describing is how I would see most developers working with git flow setting things up. For some teams, this type of development may be overkill but for larger teams, it’s how I would go.
It also depends a bit on your tooling whether this is the right way to go. PSU is not a feature rich git client so managing PRs, merge conflicts etc, would be better done in a different editor.
I’m not OP, but I use a variable named Environment in my variables.ps1. It uses the name of the server hosting PSU to determine the environment. Then I conditionally set variables like script parameter values based on the value of $Environment:
I’m reading the “Single Users and Smalls Teams with a Staging Branch” section. Say I am using the dev/prod PSU servers with dev/main branches as described. Two way sync with dev, and 1 way sync with prod/main. When I PR dev branch to main, wouldn’t .universal\schedules.ps1 (and maybe other config files that have changed) get included along with my other changes? Maybe I need a .gitignore to prevent this?