Skip to content

Commit

Permalink
Merge pull request #2412 from OctopusDeploy/sf/deployment-strategy-sw…
Browse files Browse the repository at this point in the history
…itch

Deployment strategy switch
  • Loading branch information
steve-fenton-octopus authored Aug 13, 2024
2 parents c37ef44 + 929b1b3 commit 4304673
Show file tree
Hide file tree
Showing 35 changed files with 363 additions and 363 deletions.
2 changes: 2 additions & 0 deletions dictionary-octopus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ dpkg
dryrun
Dspring
DWORD
elbv2
elif
Elyton
emptytitle
Expand Down Expand Up @@ -127,6 +128,7 @@ hotfixes
HSTS
htdocs
HTTPAPI
Humpty
hyperthread
hyperthreading
icontains
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
layout: src/layouts/Redirect.astro
title: Redirect
redirect: https://octopus.com/docs/deployments/patterns/blue-green-deployments/blue-green-deployments-in-iis
pubDate: 2023-01-01
redirect: https://octopus.com/docs/deployments/patterns/blue-green-deployments-with-octopus/blue-green-deployments-in-iis
pubDate: 2023-01-01
modDate: 2024-08-13
navSearch: false
navSitemap: false
navMenu: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
layout: src/layouts/Redirect.astro
title: Redirect
redirect: https://octopus.com/docs/deployments/patterns/blue-green-deployments/blue-green-in-octopus-environments
pubDate: 2023-01-01
redirect: https://octopus.com/docs/deployments/patterns/blue-green-deployments-with-octopus
pubDate: 2023-01-01
modDate: 2024-08-13
navSearch: false
navSitemap: false
navMenu: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
layout: src/layouts/Redirect.astro
title: Redirect
redirect: https://octopus.com/docs/deployments/patterns/blue-green-deployments
pubDate: 2023-01-01
redirect: https://octopus.com/docs/deployments/patterns/blue-green-deployments-with-octopus
pubDate: 2023-01-01
modDate: 2024-08-13
navSearch: false
navSitemap: false
navMenu: false
Expand Down
3 changes: 2 additions & 1 deletion src/pages/docs/deployment-patterns/canary-deployments.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
layout: src/layouts/Redirect.astro
title: Redirect
redirect: https://octopus.com/docs/deployments/patterns/canary-deployments
redirect: https://octopus.com/devops/software-deployments/canary-deployment/
pubDate: 2023-01-01
modDate: 2024-08-13
navSearch: false
navSitemap: false
navMenu: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
layout: src/layouts/Redirect.astro
title: Redirect
redirect: https://octopus.com/docs/deployments/patterns/rolling-deployments
redirect: hhttps://octopus.com/devops/software-deployments/rolling-deployment/
pubDate: 2023-01-01
modDate: 2024-08-13
navSearch: false
navSitemap: false
navMenu: false
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/deployments/aws/ecs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ To enable FireLens configuration, your Deploy Amazon ECS Service step needs to b

### Deployment section

Specify the minimum and maximum health percentages for the resulting service. These settings enable scenarios such as [Rolling deployments](/docs/deployments/patterns/rolling-deployments). When the maximum health percentage is set above 100% ECS will attempt to start new tasks before bringing down old ones. On the other hand, the minimum health percentage will allow ECS to bring down tasks when the cluster does not have enough capacity to handle the load.
Specify the minimum and maximum health percentages for the resulting service. These settings enable scenarios such as [rolling deployments](https://octopus.com/devops/software-deployments/rolling-deployment/). When the maximum health percentage is set above 100% ECS will attempt to start new tasks before bringing down old ones. On the other hand, the minimum health percentage will allow ECS to bring down tasks when the cluster does not have enough capacity to handle the load.

:::figure
![ECS Step Deployment section](/docs/deployments/aws/ecs/images/ecs-deployment.png)
Expand Down
24 changes: 12 additions & 12 deletions src/pages/docs/deployments/azure/cloud-services/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,35 @@ import AzureCloudServicesDeprecated from 'src/shared-content/deprecated-items/az

Octopus Deploy supports deployment of [Azure Cloud Services](http://azure.microsoft.com/en-us/services/cloud-services/). This page will walk you through, step by step, setting up a deployment using the Octopus built-in **Deploy an Azure Cloud Service** step.

## Step 1: Packaging \{#DeployingapackagetoanAzureCloudService-Step1-Packaging}
## Step 1: Packaging

An Azure cloud service package is normally compiled into a `.cspkg` file. This file will need to be [re-packed into a supported package](/docs/packaging-applications) for Octopus to consume. The easiest way to do this currently is to either create a simple zip file or use the [NuGet.exe command line tool](https://docs.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference). For example, the resulting NuGet package will look like this:

:::figure
![](/docs/deployments/azure/cloud-services/3278363.png "width=500")
:::

### Upload to a NuGet feed \{#DeployingapackagetoanAzureCloudService-UploadtoaNuGetfeed}
### Upload to a NuGet feed

In order to make the NuGet package accessible to Octopus it needs to be uploaded to a [package repository](/docs/packaging-applications/package-repositories). The built-in Octopus package repository is accessible from **Library ➜ Packages** and is a suitable place to upload your Cloud Service NuGet package:

:::figure
![Package feed](/docs/deployments/azure/cloud-services/package-feed.png "width=500")
:::

## Step 2: Create an Azure account \{#DeployingapackagetoanAzureCloudService-Step2-CreateanAzureAccount}
## Step 2: Create an Azure account

If you haven't already, create an [Azure Management Certificate Account](/docs/infrastructure/accounts/azure) to grant Octopus Deploy access to your Azure Subscription.

## Step 3: Create the Azure Cloud Service deployment step \{#DeployingapackagetoanAzureCloudService-Step3-CreatetheAzureCloudServicedeploymentstep}
## Step 3: Create the Azure Cloud Service deployment step

Add a new Azure Cloud Service Deployment Step to your project. For information about adding a step to the deployment process, see the [add step](/docs/projects/steps) section.

:::figure
![](/docs/deployments/azure/cloud-services/5865904.png "width=170")
:::

## Step 4: Configure your Azure Cloud Service step \{#DeployingapackagetoanAzureCloudService-Step4-ConfigureyourAzureCloudServicestep}
## Step 4: Configure your Azure Cloud Service step

Once an Account is selected, the list of Cloud Services and Storage Accounts available to the Azure subscription associated with the chosen Account will be populated for you to choose from.

Expand All @@ -58,7 +58,7 @@ Once an Account is selected, the list of Cloud Services and Storage Accounts ava
Any of the settings above can be switched to use a variable binding expression. A common example is when you use a naming convention for your different cloud services, like **MyCloudService_Production** and **MyCloudService_Test** - you can use environment-scoped variables to automatically configure this step depending on the environment you are targeting.
:::

### Deployment features available to Azure Cloud Service steps \{#DeployingapackagetoanAzureCloudService-DeploymentfeaturesavailabletoAzureCloudServicesteps}
### Deployment features available to Azure Cloud Service steps

The following features are available when deploying a package to an Azure Cloud Service:

Expand Down Expand Up @@ -107,7 +107,7 @@ if ($Deployment -ne $null -AND $Deployment.DeploymentId -ne $null) {
```
See the [Azure PowerShell documentation](/docs/deployments/azure/running-azure-powershell) for more information.

## Deployment process \{#DeployingapackagetoanAzureCloudService-Deploymentprocess}
## Deployment process

Deployment to an Azure Cloud Service proceeds as follows (more details provided below):

Expand All @@ -125,7 +125,7 @@ Deployment to an Azure Cloud Service proceeds as follows (more details provided
12. Deploy the Cloud Service Package (see 'Customizing the deployment process' section below).
13. Any configured or packaged `PostDeploy` scripts are executed.

### Extract the Cloud Service package \{#DeployingapackagetoanAzureCloudService-ExtracttheCloudServicePackage}
### Extract the Cloud Service package

Cloud Service Package files are extracted during deployment, in order to make available features such as .NET Configuration Transforms and Variable Substitution.

Expand All @@ -141,7 +141,7 @@ Based on customer reports and Azure community discussions, we believe Microsoft
The issues around timeouts and slow re-repackaging can be mitigated by passing in the variable `Octopus.Action.Azure.CloudServicePackageExtractionDisabled` and setting the value to `true`. However, in doing so, variable substitution will no longer be available.
:::

### Variable substitutions in Cloud Service configuration file \{#DeployingapackagetoanAzureCloudService-VariablesubstitutionsinCloudServiceconfigurationfile}
### Variable substitutions in Cloud Service configuration file

Octopus will attempt to modify your `.cscfg` file. For example, take the following configuration:

Expand All @@ -166,19 +166,19 @@ Octopus will attempt to modify your `.cscfg` file. For example, take the followi

If a variable named `HelloMessage` is defined in your Octopus project variables, Octopus will automatically update it in the configuration file. You can also name the variable `Humpty.Worker/HelloMessage` to scope the setting to a specific web/worker role.

### Customizing the deployment process \{#DeployingapackagetoanAzureCloudService-Customizingthedeploymentprocess}
### Customizing the deployment process

The deployment is performed using the [open-source Calamari project](https://github.com/OctopusDeploy/Calamari). For backwards compatibility, Octopus will look for a PowerShell script called `DeployToAzure.ps1`. If a file with this name exists within your package, Octopus will invoke it. Otherwise, Octopus will continue to use it's bundled [Sashimi.AzureCloudService](https://github.com/OctopusDeploy/Sashimi.AzureCloudService) library.

:::div{.hint}
If you choose to override the deployment script, remember that your `DeployToAzure.ps1` file must exist at **the root** of your package. It cannot be located in a subfolder. For reference, you can see how this filename is detected in your extracted package [here](https://github.com/OctopusDeploy/Sashimi.AzureCloudService/blob/main/source/Calamari/DeployAzureCloudServicePackageBehaviour.cs).
:::

## Deploying to multiple geographic regions \{#DeployingapackagetoanAzureCloudService-Deployingtomultiplegeographicregions}
## Deploying to multiple geographic regions

When your application is deployed to more than one geographic region, you are likely to need per-region configuration settings. You can achieve this result in many different ways, but the two most popular methods we have seen are:

1. [Cloud Regions](/docs/infrastructure/deployment-targets/cloud-regions/): enable [rolling deployments](/docs/deployments/patterns/rolling-deployments) across multiple geographic regions.
1. [Cloud Regions](/docs/infrastructure/deployment-targets/cloud-regions/): enable [rolling deployments](/docs/deployments/patterns/rolling-deployments-with-octopus) across multiple geographic regions.
2. Environment-per-region: by creating an environment per region you can leverage [lifecycles](/docs/releases/lifecycles) to create a strict release promotion process.

Both methods allow you to modify your deployment process and variables per-region, but have slightly different release promotion paths. Choose the one that suits you best.
Expand Down
6 changes: 3 additions & 3 deletions src/pages/docs/deployments/azure/cloud-services/vip-swap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The guide demonstrates how to perform a VIP swap when deploying to Azure Cloud S

## Using VIP swaps for blue/green deployments

VIP swap is a great way for you to implement [Blue-green deployments](/docs/deployments/patterns/blue-green-deployments) using Azure Cloud Services and Octopus Deploy. The typical process is to:
VIP swap is a great way for you to implement [blue/green deployments](https://octopus.com/devops/software-deployments/blue-green-deployment/) using Azure Cloud Services and Octopus Deploy. The typical process is to:

1. Deploy a fully configured application into the "staging" slot in Azure.
2. Run manual/automated tests on your "staging" slot.
Expand All @@ -24,7 +24,7 @@ VIP swap is a great way for you to implement [Blue-green deployments](/docs/depl

In order to complete this guide you should have a Cloud Service project set up in Octopus Deploy that is deploying to the staging or production slot. Please see our documentation for [setting up an Azure Cloud Services deployment in Octopus](/docs/deployments/azure/cloud-services) for more information.

## Environment configuration \{#VIPSwap-Environmentconfiguration}
## Environment configuration

The easiest way to configure Octopus for VIP swapping is to map Cloud Service slots to Octopus environments. By default a Cloud Service has a staging and production slot. In order to map this in Octopus, create Staging and Production environments:

Expand All @@ -46,7 +46,7 @@ With this setting enabled Octopus will attempt to swap the staging and productio
![](/docs/deployments/azure/cloud-services/vip-swap-binding.png "width=500")
:::

## Performing a VIP swap \{#VIPSwap-PerformingaVIPswap}
## Performing a VIP swap

In order to perform a VIP swap you must have a deployment in your Cloud Service production slot. The first time you create a release and deploy it to Staging and then Production it will not VIP swap. On subsequent deployments to Staging and then Production a VIP swap will occur:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ When the `Deploy an Azure Web App` step gets executed, the below actions will ha

When your application is deployed to more than one geographic region, you are likely to need per-region configuration settings. You can achieve this result in many different ways, but the two most popular methods we have seen are:

1. [Cloud Regions](/docs/infrastructure/deployment-targets/cloud-regions/): enable [rolling deployments](/docs/deployments/patterns/rolling-deployments) across multiple geographic regions.
1. [Cloud Regions](/docs/infrastructure/deployment-targets/cloud-regions/): enable [rolling deployments](/docs/deployments/patterns/rolling-deployments-with-octopus) across multiple geographic regions.
2. Environment-per-region: by creating an environment per region you can leverage [lifecycles](/docs/releases/lifecycles) to create a strict release promotion process.

The example we've discussed here is the most common scenario for deploying Azure Web Apps: a single package that contains an ASP.NET Web Application and some Web Jobs in the same release cadence. It is possible to implement more complex deployment scenarios where the ASP.NET Web Application and each Web Job follow independent release cadences. In this case you would build multiple packages using the folder structure expected by the Azure Web App hosting framework discussed earlier. Once you've done that you can simply reuse the same Azure Web App Deployment Target to deploy each package when they are released.
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/deployments/custom-scripts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Octopus can execute scripts from a variety of locations, all with different bene

1. You can author and store your scripts directly in Octopus. Learn about the [run a script step](/docs/deployments/custom-scripts/run-a-script-step/) and [deploy a package step](/docs/deployments/packages).
2. You can author your scripts and publish them as step templates for other projects to use. Learn about [step templates](/docs/projects/custom-step-templates).
3. You can develop your scripts and store them in a source control repository, like git, and Octopus can execute these scripts from within a package. Learn about [deployment process as code](/docs/deployments/patterns/deployment-process-as-code/) and [running scripts in packages](/docs/deployments/custom-scripts/scripts-in-packages).
3. You can develop your scripts and store them in a source control repository, like git, and Octopus can execute these scripts from within a package. Learn about [deployment process as code](/docs/deployments/patterns/deployment-process-as-code) and [running scripts in packages](/docs/deployments/custom-scripts/scripts-in-packages).
4. You can develop your scripts and store them in GitHub, then publish them as a release, which can be consumed by Octopus. Learn about [using the GitHub feed](/docs/packaging-applications/package-repositories/github-feeds).
5. And finally you can also store your scripts in git, and source them directly from the git repository. Learn about [run a script step](/docs/deployments/custom-scripts/run-a-script-step#choosing-where-to-source-scripts)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Choosing the right combination of **Target** and **Roles** enables some really i
| ----------------- | ---------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| Deployment target | `web-server` `app-server` | The script will run on each deployment target with either of the `web-server` or `app-server` roles | The variables scoped to the deployment target will be available to the script. For example, `Octopus.Machine.Name` will be the deployment target's name | Apply server hardening or ensure standard pre-requisites are met on each deployment target |
| Octopus Server | | The script will run once on the Octopus Server | Scope variables to the Step in order to customize variables for this script | Calculate some output variables to be used by other steps or run a database upgrade process |
| Octopus Server | `web-server` | The script will run on the Octopus Server on behalf of the deployment targets with the `web-server` role. The script will execute once per deployment target | The variables scoped to the deployment target will be available to the script. For example, `Octopus.Machine.Name` will be the deployment target's name | Remove web servers from a load balancer as part of a [rolling deployment](/docs/deployments/patterns/rolling-deployments) where access to the load balancer API is restricted |
| Octopus Server | `web-server` | The script will run on the Octopus Server on behalf of the deployment targets with the `web-server` role. The script will execute once per deployment target | The variables scoped to the deployment target will be available to the script. For example, `Octopus.Machine.Name` will be the deployment target's name | Remove web servers from a load balancer as part of a [rolling deployment](/docs/deployments/patterns/rolling-deployments-with-octopus) where access to the load balancer API is restricted |

## Choosing where to source the script {#choosing-where-to-source-scripts}

Expand Down
Loading

0 comments on commit 4304673

Please sign in to comment.