Skip to content

Commit 99925f4

Browse files
authored
Merge pull request #7525 from jesp209i/task/cicd-deployment-options
CICD Advanced setup - deployment options
2 parents 7050db0 + 4fb268e commit 99925f4

File tree

5 files changed

+137
-0
lines changed

5 files changed

+137
-0
lines changed

umbraco-cloud/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
* [Configuring a CI/CD pipeline](build-and-customize-your-solution/handle-deployments-and-environments/umbraco-cicd/samplecicdpipeline/README.md)
6969
* [Azure DevOps](build-and-customize-your-solution/handle-deployments-and-environments/umbraco-cicd/samplecicdpipeline/azure-devops.md)
7070
* [GitHub Actions](build-and-customize-your-solution/handle-deployments-and-environments/umbraco-cicd/samplecicdpipeline/github-actions.md)
71+
* [Advanced Setup: Deployment options](build-and-customize-your-solution/handle-deployments-and-environments/umbraco-cicd/samplecicdpipeline/advanced-deployment-options.md)
7172
* [Advanced Setup: Deploy to multiple targets](build-and-customize-your-solution/handle-deployments-and-environments/umbraco-cicd/samplecicdpipeline/advanced-multiple-targets.md)
7273
* [Migrate from V1 to V2](build-and-customize-your-solution/handle-deployments-and-environments/umbraco-cicd/samplecicdpipeline/migrate.md)
7374
* [Deployment Artifact best practice](build-and-customize-your-solution/handle-deployments-and-environments/umbraco-cicd/samplecicdpipeline/artifact-best-practice.md)
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Advanced Setup: Deployment options
2+
3+
Here you will learn how to use the deployment options available with the v2 endpoints for CI/CD.
4+
5+
This provides control over the CI/CD deployment process within the isolated instance before your code is pushed to the Cloud environment.
6+
7+
## Option: skipVersionCheck
8+
9+
During deployment, the system automatically checks for downgrades of Cloud dependencies. This prevents accidental downgrades of packages that may have been automatically upgraded on Umbraco Cloud.
10+
11+
Enabling **skipVersionCheck** will bypass that safeguard and allow deployments that include downgraded packages.
12+
13+
{% hint style="info" %}
14+
This option increases risk and is not recommended for normal workflows. Only enable it when you understand the package differences and accept the potential consequences.
15+
{% endhint %}
16+
17+
## Option: noBuildAndRestore
18+
19+
The Umbraco CI/CD flow runs the deployment in an isolated instance and performs `dotnet restore` and `dotnet build` to catch obvious build issues before deploying to Cloud. Enabling **noBuildAndRestore** skips the restore and build steps in that isolated instance, which can shorten deployment time by a few minutes.
20+
21+
Keep in mind the final Kudu deployment on the Cloud environment will still run **restore**, **build**, and **publish**; those steps cannot be skipped.
22+
23+
## How to enable the options
24+
25+
All pipeline scripts generally follow the same structure, but there are a few small details to be aware of.
26+
27+
{% tabs %}
28+
{% tab title="Azure DevOps Bash" %}
29+
Locate the main entry pipeline file. It will usually be this one: `azure-release-pipeline.yaml`.
30+
31+
```yml
32+
# Deploy to Umbraco Cloud
33+
# ####
34+
# you can edit the variables noBuildAndRestore and skipVersionCheck
35+
# use booleans but as strings
36+
- stage: CloudDeploymentStage
37+
displayName: Deploy To Cloud
38+
dependsOn: cloudPrepareArtifact
39+
condition: in(dependencies.cloudPrepareArtifact.result, 'Succeeded')
40+
variables:
41+
artifactId: $[ stageDependencies.cloudPrepareArtifact.PrepareAndUploadArtifact.outputs['uploadArtifact.artifactId'] ]
42+
jobs:
43+
- template: cloud-deployment.yml
44+
parameters:
45+
artifactId: $(artifactId)
46+
noBuildAndRestore: 'false'
47+
skipVersionCheck: 'false'
48+
```
49+
50+
The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `true`.
51+
52+
53+
{% endtab %}
54+
{% tab title="Azure DevOps PowerShell" %}
55+
Locate the main entry pipeline file. It will usually be this one: `azure-release-pipeline.yaml`.
56+
57+
```yml
58+
# Deploy to Umbraco Cloud
59+
# ####
60+
# you can edit the variables noBuildAndRestore and skipVersionCheck
61+
# use booleans
62+
- stage: CloudDeploymentStage
63+
displayName: Deploy To Cloud
64+
dependsOn: cloudPrepareArtifact
65+
condition: in(dependencies.cloudPrepareArtifact.result, 'Succeeded')
66+
variables:
67+
artifactId: $[ stageDependencies.cloudPrepareArtifact.PrepareAndUploadArtifact.outputs['uploadArtifact.artifactId'] ]
68+
jobs:
69+
- template: cloud-deployment.yml
70+
parameters:
71+
artifactId: $(artifactId)
72+
noBuildAndRestore: false
73+
skipVersionCheck: false
74+
75+
```
76+
77+
The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `true`.
78+
79+
80+
{% endtab %}
81+
{% tab title="GitHub Actions Bash" %}
82+
Locate the main entry pipeline file. It will usually be this one: `main.yml`.
83+
84+
```yml
85+
# Deploy to Umbraco Cloud
86+
# ####
87+
# you can edit the variables noBuildAndRestore and skipVersionCheck
88+
# use booleans but as strings
89+
cloud-deployment:
90+
name: "Deploy to Cloud"
91+
needs: cloud-artifact
92+
uses: ./.github/workflows/cloud-deployment.yml
93+
with:
94+
artifactId: ${{ needs.cloud-artifact.outputs.artifactId }}
95+
targetEnvironmentAlias: ${{ vars.TARGET_ENVIRONMENT_ALIAS }}
96+
noBuildAndRestore: "false"
97+
skipVersionCheck: "false"
98+
secrets:
99+
projectId: ${{ secrets.PROJECT_ID }}
100+
umbracoCloudApiKey: ${{ secrets.UMBRACO_CLOUD_API_KEY }}
101+
```
102+
103+
The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `true`.
104+
105+
{% endtab %}
106+
{% tab title="GitHub Actions PowerShell" %}
107+
Locate the main entry pipeline file. It will usually be this one: `main.yml`.
108+
109+
```yml
110+
# Deploy to Umbraco Cloud
111+
# ####
112+
# you can edit the variables noBuildAndRestore and skipVersionCheck
113+
# use 0 for false and 1 for true
114+
cloud-deployment:
115+
name: "Deploy to Cloud"
116+
needs: cloud-artifact
117+
uses: ./.github/workflows/cloud-deployment.yml
118+
with:
119+
artifactId: ${{ needs.cloud-artifact.outputs.artifactId }}
120+
targetEnvironmentAlias: ${{ vars.TARGET_ENVIRONMENT_ALIAS }}
121+
noBuildAndRestore: 0
122+
skipVersionCheck: 0
123+
secrets:
124+
projectId: ${{ secrets.PROJECT_ID }}
125+
umbracoCloudApiKey: ${{ secrets.UMBRACO_CLOUD_API_KEY }}
126+
```
127+
128+
The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `1`.
129+
130+
{% endtab %}
131+
{% endtabs %}

umbraco-cloud/build-and-customize-your-solution/handle-deployments-and-environments/umbraco-cicd/samplecicdpipeline/azure-devops.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ If you have frontend assets that needs to be built (using tools like npm/yarn or
243243

244244
Please follow the above guide first.
245245

246+
* [Deployment options](advanced-deployment-options.md)
246247
* [Deploy to multiple targets](advanced-multiple-targets.md)
247248

248249
## Further information

umbraco-cloud/build-and-customize-your-solution/handle-deployments-and-environments/umbraco-cicd/samplecicdpipeline/github-actions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ If you have frontend assets that needs to be built (using tools like npm/yarn or
275275

276276
Please follow the above guide first.
277277

278+
* [Deployment options](advanced-deployment-options.md)
278279
* [Deploy to multiple targets](advanced-multiple-targets.md)
279280

280281
## Further information

umbraco-cloud/build-and-customize-your-solution/handle-deployments-and-environments/umbraco-cicd/umbracocloudapi.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ You can use the deploymentId to query the Get Deployment status endpoint.
235235
It is not recommended to enable the `skipVersionCheck`. This is to ensure that versions of the different Umbraco packages in the Cloud environment aren't overwritten by older versions. There may be instances where you would like to deploy an older artifact. In those instances it is possible to enable this setting to skip the step.
236236

237237
Enabling the `noBuildAndRestore` only disabled the restore and build inside the isolated instance. Once the system pushes the source code to the environment a build and publish operation will run as usual. One minute or more can be saved during the deployment process by enabling this option.
238+
239+
For more information on using the `skipVersionCheck` and `noBuildAndRestore` setting in the pipeline , see the [Advanced Setup: Deployment options](./samplecicdpipeline/advanced-deployment-options.md) article.
240+
238241
{% endhint %}
239242

240243
### Get Deployment status

0 commit comments

Comments
 (0)