How to auto-discover new PSU Apps without manual intervention? (multi environment setup)
Platform: PowerShell Universal (PSU) v5.6.8
Branches: Labo (Development/Testing) and Prod (Production).
CI/CD: GitLab pipelines using sync-back.ps1 (to capture UI changes) and deploy.ps1 (to push Git changes to servers).
Secrets: Local Vault stored within the LiteDB database.
General workflow
Configurations per environment:
A key part is the .universalfolder. SInce both environments live in the same repo,I tackle this with :
A config/ directory with 2 sub directories, one per environment.
config/labo/ contains the .universal files for the Labo environment.config/prod/ contains the .universal files for the Production environment.During the CI/CD process, the pipeline is responsible for selecting the correct folder. When deploying to Labo, it takes the contents of config/labo/ and places them into the .universal folder on the server. It does the same for Prod using config/prod/.
The CI/CD Mechanism
GitLab CI/CD pipeline serves as the sngle source of truth.
Because PSU allows administrators to make changes directly in the Web UI (which modifies the files on the server), I run a sync-back pipeline. (to be honest, the sync back rarely captures changes).
This captures those “live” changes, commits them to Git, and ensures the repository stays in sync with the actual state of the server.
This all looks like this:
Labo branch & Prod branch
.
├── .universal/ # Resolved registry during deployment
├── config/
│ ├── labo/ # Labo-specific .universal files
│ └── prod/ # Prod-specific .universal files
├── dashboards/ # Dashboard .ps1 files
├── scripts/ # Automation .ps1 files
└── ci-scripts/ # Pipeline automation
├── sync-back.ps1 # Captures UI changes back to Git
└── deploy.ps1 # Pushes Git changes to the server
Problem
In 1 line: Getting the new application/endpoint/… to exist in PROD without manual intervention.
When I merge a new app or dashboard from Labo to Prod, the production instance doesn’t automatically “discover” the new files. (read: it sees a new dashboar, it doesn’t automatically add that to the .universal/dashboards.ps1 file.)
I have tried with Sync-PSUConfiguration but that doesnt work.
I read that deleting the database and just relauncing the server should auto-discover everything.
But since i use a local vault with PSU, i can’t do that because then I throw my vault away.
My Current (Manual) Solution
To get around this, I am currently forced to perform a manual workaround:
What I’m Looking For
The manual method works perfectly but is not ideal.
I am looking for a way that is fully automatic.
Anyone has any ideas?