Skip to content

Add automated infrastructure provisioning scripts#230

Merged
mekererenate-web merged 13 commits into
developfrom
vagrant-infrastructure-renate
May 13, 2026
Merged

Add automated infrastructure provisioning scripts#230
mekererenate-web merged 13 commits into
developfrom
vagrant-infrastructure-renate

Conversation

@mekererenate-web

Copy link
Copy Markdown
Collaborator

This PR adds three PowerShell scripts to automate
the full infrastructure redeploy process.

Scripts added

scripts/backup-database.ps1

  • Backs up the live PostgreSQL database from the
    current DB droplet to your laptop before deleting

scripts/create-infrastructure.ps1

  • Creates 3 new DigitalOcean droplets
  • Installs PostgreSQL and restores the database
  • Installs Docker on manager and worker
  • Initialises Docker Swarm and joins the worker
  • Saves new IPs automatically for the deploy step

scripts/deploy-existing.ps1

  • Copies all config files to the new manager
  • Writes the .env file with correct IPs
  • Deploys the minitwit stack
  • Deploys the monitoring stack

How to use tomorrow

Step 1 - backup while old droplets are still alive:
.\scripts\backup-database.ps1

Step 2 - delete the 3 old droplets on DigitalOcean

Step 3 - create everything fresh:
.\scripts\create-infrastructure.ps1 -Apply

Step 4 - deploy the app:
.\scripts\deploy-existing.ps1

Notes

  • No changes to app code, Docker images or compose files
  • Dry run by default, only runs with -Apply flag
  • SSH key ID set to 56072776 (minitwit-local)

@codacy-production

codacy-production Bot commented May 8, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sonarqubecloud

Copy link
Copy Markdown

@mekererenate-web

Copy link
Copy Markdown
Collaborator Author

Monitoring also added. I dont know no one has loooked at this pull requet looks good to me, i have to accept it because its been a lreally ong time and we have to hand in the report tomorrow!

@mekererenate-web mekererenate-web merged commit 9d7239b into develop May 13, 2026
3 of 5 checks passed
@mekererenate-web mekererenate-web deleted the vagrant-infrastructure-renate branch May 14, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant