Quite some time ago I started a project ambitiously called Automated Deployment Engine. It was essentially a PowerShell, ARM, DSC toolchain that assisted with complex IaaS deployments and configuration of deployed endpoints. You defined what you wanted in a single set of config files, figuratively clicked ‘go’, and it deployed it all; with the occasional poke from you.
While the project worked, to a point, it became complex and complicated. It does however contain code that is extremely useful and should be realitively easy to extract and publish more targetted modules or PRs to other projects as required, such as;
- a library of standardised ARM templates with Pester tests,
- an Export-PowershellDataFile,
- a fixed xWebsiteAdminstration supporting managed identities,
- code for merging .PSD files based on key/value matches,
- dynamic DSC scripts based on complex configuration data,
- and other ‘stuff’.
I’ll be looking to pull these main parts out to create smaller modules, at almost a function level. By creating and publishing smaller modules they should be easier to manage and maintain. At least it will get them out into the open far quicker and perhaps help someone out.
As I’ll be rinsing and repeating a certain process multiple times it’s a good oportunity to create a project scaffold, to ensure each module is created to the same standard. I’m a fan of consistency. The major parts of this scaffold will be:
- Powershell – I’ll be using Powershell 7 as it will be released long before I finish
- Version Control – Git backed by an Azure DevOps Repo
- I may look into synching the repo with GitHub at some point
- Build – I’ll choose between PsBuild and Invoke-Build
- Each of the other toolchain components may need build tasks,
- I’ll look to integrate the build tasks with VsCode for local testing,
- Azure DevOps Pipelines will provide the CI/CD toolset.
- Documentation – will be generated from comment based help
- Markdown will be created by PlatyPs,
- Hosting will most likely be GoHugo and Github Pages.
- Code Analysis – PsScriptAnalyser will cover code standards and best practice,
- Code Testing – Pester – the scaffold will include standards tests for things like;
- each function is in a file of it’s own
- each function has an associated test
- command aliases have all been expanded
- comment based help has been populated (as this is what will populate the docs)
- you get the idea
- Release – Publishing to;
- Azure DevOps Artefacts feed (Dev)
- Powershell Gallery (Prod)
- The scaffold – Plaster will help us create the scaffold of everything above.
Over the next few…uh weeks, I hope, I’ll be creating the scaffold and will post about each of the major stages. Once the scaffold is done, I’ll start another series about the re-use of Automated Deployment Engine, where I’ll start with Export-PowershellData file to try and get that into the gallery – I’m sure there is still an open pull request for people wanting this.