-
Notifications
You must be signed in to change notification settings - Fork 99
Project Templates docs #3054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Project Templates docs #3054
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
4768a00
Add project template docs
IsaacCalligeros95 2c9809b
Update docs
IsaacCalligeros95 c7607b6
Update docs
IsaacCalligeros95 41163bd
Tidy-up
IsaacCalligeros95 a4981cd
Updates
IsaacCalligeros95 41ae0c2
Fix image name
IsaacCalligeros95 fef1cea
Fix image name
IsaacCalligeros95 c11446b
New images, some edits.
IsaacCalligeros95 caef834
New images, some edits.
IsaacCalligeros95 8584ba8
Rewrites
IsaacCalligeros95 e9ce85f
updates
IsaacCalligeros95 121680d
tidy-up
IsaacCalligeros95 b01a9ca
Fixing linting issue
IsaacCalligeros95 bdee29a
Tidy-up troubleshooting
IsaacCalligeros95 8a6f829
best practices updates
IsaacCalligeros95 e3baa95
Validation message
IsaacCalligeros95 fbd2848
Include initial cut of project template consumers
IsaacCalligeros95 f5ec2bf
Include initial cut of project template consumers
IsaacCalligeros95 326f5bc
Rename to templated projects
IsaacCalligeros95 026a825
Fix linting issues, tidy-up
IsaacCalligeros95 3b7cc12
Add installation guide
IsaacCalligeros95 29c5c7a
Edits
IsaacCalligeros95 87011f9
Addressing PR feedback
IsaacCalligeros95 485c67c
Pr feedback tidy up
IsaacCalligeros95 fe692f2
Include download link
IsaacCalligeros95 f2b1ac1
Addressing Marks PR comments
IsaacCalligeros95 f664982
Addressing Ryans Pr comments
IsaacCalligeros95 0968d62
Merge remote-tracking branch 'origin/main' into isaac/project-templat…
IsaacCalligeros95 10c8f58
Remove future direction placeholders & runbooks/triggers comments
IsaacCalligeros95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+17.7 KB
public/docs/i/1000/platform-hub/project-templates/project-template-selection.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.1 KB
public/docs/i/1000/platform-hub/project-templates/project-templates-list.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.3 KB
...ic/docs/i/1000/platform-hub/project-templates/project-templates-onboarding.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.1 KB
...ic/docs/i/1000/platform-hub/project-templates/project-templates-parameters.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.5 KB
...ocs/i/1000/platform-hub/project-templates/project-templates-process-editor.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.7 KB
...s/i/1000/platform-hub/project-templates/project-templates-process-overview.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20 KB
public/docs/i/1000/platform-hub/project-templates/project-templates-usage.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.9 KB
public/docs/i/1000/platform-hub/project-templates/project-templates-variables.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.6 KB
public/docs/i/1000/platform-hub/project-templates/templated-project-creation.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21.2 KB
public/docs/i/1000/platform-hub/project-templates/templated-project-values.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.7 KB
.../i/1000/platform-hub/project-templates/templated-project-version-selection.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.8 KB
...s/i/1000/platform-hub/project-templates/templated-project-version-settings.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+44.9 KB
public/docs/i/2000/platform-hub/project-templates/project-template-selection.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+79.7 KB
public/docs/i/2000/platform-hub/project-templates/project-templates-list.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.4 KB
...ic/docs/i/2000/platform-hub/project-templates/project-templates-onboarding.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+60.6 KB
...ic/docs/i/2000/platform-hub/project-templates/project-templates-parameters.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+87.2 KB
...ocs/i/2000/platform-hub/project-templates/project-templates-process-editor.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.2 KB
...s/i/2000/platform-hub/project-templates/project-templates-process-overview.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.9 KB
public/docs/i/2000/platform-hub/project-templates/project-templates-usage.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45.8 KB
public/docs/i/2000/platform-hub/project-templates/project-templates-variables.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.7 KB
public/docs/i/2000/platform-hub/project-templates/templated-project-creation.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.4 KB
public/docs/i/2000/platform-hub/project-templates/templated-project-values.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+66.6 KB
.../i/2000/platform-hub/project-templates/templated-project-version-selection.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+87.4 KB
...s/i/2000/platform-hub/project-templates/templated-project-version-settings.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.26 KB
public/docs/i/600/platform-hub/project-templates/project-template-selection.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.9 KB
public/docs/i/600/platform-hub/project-templates/project-templates-list.webp
Oops, something went wrong.
Binary file added
BIN
+5.78 KB
public/docs/i/600/platform-hub/project-templates/project-templates-onboarding.webp
Oops, something went wrong.
Binary file added
BIN
+10.1 KB
public/docs/i/600/platform-hub/project-templates/project-templates-parameters.webp
Oops, something went wrong.
Binary file added
BIN
+15.4 KB
...docs/i/600/platform-hub/project-templates/project-templates-process-editor.webp
Oops, something went wrong.
Binary file added
BIN
+6.99 KB
...cs/i/600/platform-hub/project-templates/project-templates-process-overview.webp
Oops, something went wrong.
Binary file added
BIN
+10 KB
public/docs/i/600/platform-hub/project-templates/project-templates-usage.webp
Oops, something went wrong.
Binary file added
BIN
+8.35 KB
public/docs/i/600/platform-hub/project-templates/project-templates-variables.webp
Oops, something went wrong.
Binary file added
BIN
+7.53 KB
public/docs/i/600/platform-hub/project-templates/templated-project-creation.webp
Oops, something went wrong.
Binary file added
BIN
+9.49 KB
public/docs/i/600/platform-hub/project-templates/templated-project-values.webp
Oops, something went wrong.
Binary file added
BIN
+10.8 KB
...s/i/600/platform-hub/project-templates/templated-project-version-selection.webp
Oops, something went wrong.
Binary file added
BIN
+15.1 KB
...cs/i/600/platform-hub/project-templates/templated-project-version-settings.webp
Oops, something went wrong.
Binary file modified
BIN
+11.6 KB
(110%)
public/docs/i/x/platform-hub/process-template-parameters.png
Oops, something went wrong.
Binary file added
BIN
+179 KB
public/docs/i/x/platform-hub/project-templates/project-template-selection.png
Oops, something went wrong.
Binary file added
BIN
+260 KB
public/docs/i/x/platform-hub/project-templates/project-templates-list.png
Oops, something went wrong.
Binary file added
BIN
+147 KB
public/docs/i/x/platform-hub/project-templates/project-templates-onboarding.png
Oops, something went wrong.
Binary file added
BIN
+206 KB
public/docs/i/x/platform-hub/project-templates/project-templates-parameters.png
Oops, something went wrong.
Binary file added
BIN
+294 KB
...ic/docs/i/x/platform-hub/project-templates/project-templates-process-editor.png
Oops, something went wrong.
Binary file added
BIN
+199 KB
.../docs/i/x/platform-hub/project-templates/project-templates-process-overview.png
Oops, something went wrong.
Binary file added
BIN
+51.4 KB
public/docs/i/x/platform-hub/project-templates/project-templates-usage.png
Oops, something went wrong.
Binary file added
BIN
+168 KB
public/docs/i/x/platform-hub/project-templates/project-templates-variables.png
Oops, something went wrong.
Binary file added
BIN
+163 KB
public/docs/i/x/platform-hub/project-templates/templated-project-creation.png
Oops, something went wrong.
Binary file added
BIN
+222 KB
public/docs/i/x/platform-hub/project-templates/templated-project-values.png
Oops, something went wrong.
Binary file added
BIN
+224 KB
...docs/i/x/platform-hub/project-templates/templated-project-version-selection.png
Oops, something went wrong.
Binary file added
BIN
+272 KB
.../docs/i/x/platform-hub/project-templates/templated-project-version-settings.png
Oops, something went wrong.
Binary file added
BIN
+311 KB
public/docs/img/platform-hub/project-templates/project-template-selection.png
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
public/docs/img/platform-hub/project-templates/project-template-selection.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":3378,"height":1912,"updated":"2026-03-16T01:33:12.596Z"} |
Binary file added
BIN
+487 KB
public/docs/img/platform-hub/project-templates/project-templates-list.png
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
public/docs/img/platform-hub/project-templates/project-templates-list.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":3414,"height":1958,"updated":"2026-03-09T23:21:06.499Z"} |
Binary file added
BIN
+309 KB
public/docs/img/platform-hub/project-templates/project-templates-onboarding.png
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
public/docs/img/platform-hub/project-templates/project-templates-onboarding.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":3430,"height":1828,"updated":"2026-03-09T23:21:06.549Z"} |
Binary file added
BIN
+399 KB
public/docs/img/platform-hub/project-templates/project-templates-parameters.png
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
public/docs/img/platform-hub/project-templates/project-templates-parameters.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":3438,"height":1930,"updated":"2026-03-09T23:21:06.650Z"} |
Binary file added
BIN
+518 KB
...ic/docs/img/platform-hub/project-templates/project-templates-process-editor.png
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
public/docs/img/platform-hub/project-templates/project-templates-process-editor.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":3428,"height":1982,"updated":"2026-03-09T23:35:20.646Z"} |
Binary file added
BIN
+345 KB
public/docs/img/platform-hub/project-templates/project-templates-variables.png
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
public/docs/img/platform-hub/project-templates/project-templates-variables.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":3446,"height":1972,"updated":"2026-03-09T23:21:06.848Z"} |
Binary file added
BIN
+281 KB
public/docs/img/platform-hub/project-templates/templated-project-creation.png
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
public/docs/img/platform-hub/project-templates/templated-project-creation.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":3258,"height":1930,"updated":"2026-03-16T01:33:12.665Z"} |
Binary file added
BIN
+408 KB
public/docs/img/platform-hub/project-templates/templated-project-values.png
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
public/docs/img/platform-hub/project-templates/templated-project-values.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":3430,"height":1758,"updated":"2026-03-16T01:33:12.768Z"} |
Binary file added
BIN
+384 KB
...docs/img/platform-hub/project-templates/templated-project-version-selection.png
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
public/docs/img/platform-hub/project-templates/templated-project-version-selection.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":3338,"height":1956,"updated":"2026-03-16T01:33:12.867Z"} |
Binary file added
BIN
+484 KB
.../docs/img/platform-hub/project-templates/templated-project-version-settings.png
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
public/docs/img/platform-hub/project-templates/templated-project-version-settings.png.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"width":3418,"height":1926,"updated":"2026-03-16T01:33:12.969Z"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
213 changes: 7 additions & 206 deletions
213
src/pages/docs/platform-hub/process-templates/best-practices.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,208 +1,9 @@ | ||
| --- | ||
| layout: src/layouts/Default.astro | ||
| pubDate: 2025-09-11 | ||
| modDate: 2025-09-11 | ||
| title: Process Templates best practices | ||
| subtitle: Best practices for creating process templates within Platform Hub | ||
| icon: fa-solid fa-lock | ||
| navTitle: Best Practices | ||
| navSection: Process Templates | ||
| description: Best practices for creating process templates within Platform Hub | ||
| navOrder: 160 | ||
| layout: src/layouts/Redirect.astro | ||
| redirect: /docs/platform-hub/templates/process-templates/best-practices | ||
| navMenu: false | ||
| navSearch: false | ||
| navSitemap: false | ||
| pubDate: 2026-03-05 | ||
| title: Process templates best practices (redirected) | ||
| --- | ||
|
|
||
| This document uses **Producer** and **Consumer** frequently. To avoid confusion, use these definitions: | ||
|
|
||
| - **Producer** - the user who creates and manages process templates in Platform Hub. | ||
| - **Consumer** - the user who uses the process templates in their deployment or runbook processes. | ||
|
|
||
| ## Process templates administration | ||
|
|
||
| ### Establish a naming standard | ||
|
|
||
| Use a [ Prefix ] - [ Template Name ] that is easy for everyone to understand the template's purpose. The [ Template Name ] should be succinct and informative. | ||
|
|
||
| The [ Prefix ] should inform everyone where the template should be used. For example: | ||
|
|
||
| - Deploy Process - [ Template Name ] for templates designed for deployments only. | ||
| - Runbook - [ Template Name ] for templates designed for runbooks only. | ||
| - Deploy and Runbook - [ Template Name ] for templates that can be used in deployments or runbooks. | ||
|
|
||
| :::figure | ||
|  | ||
| ::: | ||
|
|
||
| ### Establish what the major/minor/patch/pre-release means to your company | ||
|
|
||
| Process templates' versioning provides hints: | ||
|
|
||
| - Major (breaking changes) | ||
| - Minor (non-breaking changes) | ||
| - Patch (bug fixes) | ||
| - Pre-Release | ||
|
|
||
| There will be confusion unless you define what a breaking vs. non-breaking change means to you and your company. | ||
|
|
||
| A starting point of a policy can be: | ||
|
|
||
| - **Major** — The change requires the consumer to test it. The template changes how it fundamentally works, and it might delete existing parameters or add new ones. A consumer updating the template requires a PR in their project. | ||
| - **Minor** — The change generally doesn’t require the consumer to test it extensively, but it might have added or removed a parameter, which will require a PR by the consumer because it changes the deployment process. | ||
| - **Patch** No parameters were added or removed, and testing isn’t required (except by the consumer who reported the bug). The consumer doesn’t require a PR as the deployment process OCL doesn’t change. | ||
| - **Pre-Release** - Use for changes that aren’t ready for general use. | ||
|
|
||
| ### Leverage branch protection policies on the Platform Hub Git repository | ||
|
|
||
| Template changes should occur in a branch and be reviewed via a PR. To test the changes, use the Pre-Release feature within the versioning functionality. | ||
|
|
||
| ## Building Templates | ||
|
|
||
| ### Opt for several smaller templates over "all-in-one" templates | ||
|
|
||
| Creating a single process template containing all the steps required to deploy an application can be tempting. In practice, the "all-in-one" template falls apart at scale. | ||
|
|
||
| #### Not all applications use the same components | ||
|
|
||
| Consider this example: | ||
|
|
||
| - Application #1 - Deploys a container to Kubernetes with a SQL Server Backend | ||
| - Application #2 - Deploys a container to Kubernetes that monitors a queue | ||
|
|
||
| No matter what, you will create two templates. | ||
|
|
||
| - Option #1 - Create a template for each application combination | ||
| - Kubernetes + SQL Server | ||
| - Kubernetes + Queue | ||
| - Option #2 - Create a template for each component | ||
| - Kubernetes | ||
| - SQL Server | ||
|
|
||
| With option #2, you’ll have templates that can be mixed and matched with other application types. For example, the SQL Server template can be used for .NET apps running on Azure Web Apps, Linux, or Windows. | ||
|
|
||
| #### Some applications require steps before or after templates | ||
|
|
||
| Consider this deployment process: | ||
|
|
||
| :::figure | ||
|  | ||
| ::: | ||
|
|
||
| It uses three process templates, but they don’t all run back to back to back. Between the first process template, `Verify Build Artifacts`, and the second process template, `Deploy Databases`, a step to verify the infrastructure runs. Not all applications need that specific step to run between those templates. | ||
|
|
||
| Having multiple process templates allows application teams to insert steps before or after specific actions are performed. | ||
|
|
||
| #### A template for everybody is a template for nobody | ||
|
|
||
| A large all-in-one template requires significant complexity to account for multiple use cases. We’ve seen all-in-one templates follow the same pattern: | ||
|
|
||
| 1. The template starts out simple. | ||
| 2. More use cases are encountered and additional steps are added. Steps solely focused on business logic and creating output variables become the norm. | ||
| 3. Conditional run conditions for multiple steps become the default. The template becomes very brittle as people need to “hold it just right” for everything to work. | ||
| 4. Conditional steps start to fail randomly, or steps are skipped randomly because of a configuration change. | ||
| 5. Consumers are forced to update the templates repeatedly to fix the ever-growing list of bugs. | ||
| 6. Consumers start asking for the ability to cherry-pick steps when running the template. | ||
|
|
||
| Eventually, the template becomes unusable, and users want a complete rewrite or ask how they can get out of using the templates. | ||
|
|
||
| ### Follow the single responsibility principle | ||
|
|
||
| A template should have a single purpose. That doesn’t mean a single step, but a singular purpose that is easy for consumers to understand. Some examples include: | ||
|
|
||
| - Template to create a database on a server | ||
| - Template to destroy that database | ||
| - Template to verify build artifacts | ||
| - Template to deploy and verify an application on a Kubernetes cluster | ||
| - Template to deploy a database change | ||
|
|
||
| The template should include all the necessary steps to accomplish that task. Consider a template to deploy a database change. The company policy might be build a delta report and verify it before deploying. But DBAs don’t need to be bothered with every change, so only bother them when specific commands appear. For example, `Drop Database`. To accomplish that, the template would be: | ||
|
|
||
| :::figure | ||
|  | ||
| ::: | ||
|
|
||
| ### Parameters | ||
|
|
||
| Parameters should be the only way for information to be sent from consumers' deployment and runbook processes to process templates. | ||
|
|
||
| - Templates should not explicitly rely on output variables from other process templates. Template B shouldn’t have a hard-coded output variable from template A. | ||
| - Templates should not hardcode the names of project variables or variable set variables. They must be sent in via parameters. | ||
| - Any external references for items outside of Platform Hub - secrets, feeds, worker pools, tags - must be sent in via parameters. | ||
|
|
||
| ### Templates must be self-contained | ||
|
|
||
| A template should not expect other templates to be included in the deployment or runbook process. | ||
|
|
||
| - Use parameters for all inputs. | ||
| - The consumer, not the producer, should determine the order of the templates in the process. The consumer has context regarding the order of component deployments. | ||
| - All steps needed to accomplish the template's task must be included. | ||
|
|
||
| ### Keep consumer decision-making to a minimum | ||
|
|
||
| The consumer shouldn’t need to worry about: | ||
|
|
||
| - The number of steps required to accomplish a task | ||
| - The steps that can be skipped based on a decision within the template (alerting a DBA if the Drop Database command is found) | ||
| - The specific logic of how a task is accomplished. | ||
|
|
||
| A consumer should be able to say: | ||
|
|
||
| > I want to deploy to Kubernetes and verify the deployment using this information: | ||
| > | ||
| > - The container URL | ||
| > - The Git repository of the manifest files | ||
| > - The path to manifest files in that repository | ||
| > - The target tag of the cluster to deploy to | ||
| > - The verification script to run | ||
|
|
||
| It is the producer's job to figure out how to takes those parameters and deploy the container to Kubernetes. | ||
|
|
||
| ### Include notes for each step in the process template | ||
|
|
||
| Notes help the consumer understand the intent behind each step. If a deployment fails, it is easier for them to self-service why the failure occurs if they have that context. Sometimes, a step name is all that is required to understand the intent. However, assuming everyone will understand the context based on the name alone is dangerous. It is better to include notes by default. | ||
|
|
||
| :::figure | ||
|  | ||
| ::: | ||
|
|
||
| ## Producer-managed script steps in templates | ||
|
|
||
| A process template has two options for the `Run a script` step. | ||
|
|
||
| 1. Consumer-managed script steps, such as running a verification step after a deployment. The producer will not know the necessary tests to run, so they will ask the consumer to provide the script for the tests. | ||
| 2. Producer-managed script steps, such as creating a delta report from the provided database package and looking for dangerous commands. The script is created and managed by the producer to accomplish the goal of the template. | ||
|
|
||
| This section refers to the latter, producer-managed script steps. | ||
|
|
||
| ### Store the script inline with the template | ||
|
|
||
| Since the template is already in version control, referencing another git repo for the script is redundant. | ||
|
|
||
| If multiple templates need to reference the same script, that indicates they are doing too much. They likely aren’t following the above best practices (single responsibility principle, self-contained, etc.). | ||
|
|
||
| ### Output variables intended for business decisions should only be used by the template | ||
|
|
||
| It is common for a script step to make a set of decisions and create an output variable. For example, the first step in this template looks for dangerous commands in the migration scripts and sets an output variable when those commands are found. | ||
|
|
||
| Those kinds of output variables should only be used by the template itself. | ||
|
|
||
| :::figure | ||
|  | ||
| ::: | ||
|
|
||
| ### Output variables must be surfaced via logs when intended for outside steps to use | ||
|
|
||
| When a template explicitly creates output variables to be used by other steps they must be logged for the consumer to know. For example, a template that retrieves values from a key vault and sets them as output variables. | ||
|
|
||
| - When possible, allow the consumer to provide a list of output variables - for example, telling the key vault which secrets to retrieve. | ||
| - When that is not possible, log all the output variables created. | ||
| - If another process template will use those output variables, they should be sent in as parameters. There should never be a hard link between templates. | ||
|
|
||
| ### Log everything | ||
|
|
||
| Octopus supports different levels of logs: | ||
|
|
||
| - Write-Verbose - writes a verbose log (hidden by default) | ||
| - Write-Info - writes an info log (visible on task log screen by default) | ||
| - Write-Highlight - writes the information to the task summary screen | ||
| - Write-Error - writes an error message | ||
|
|
||
| Use those log levels and write messages frequently. This aids in debugging when a deployment or runbook run fails. Logs are like an umbrella - better to have it and not need it than need it and not have it. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.