|
| 1 | +# Advanced Setup: Deployment options |
| 2 | + |
| 3 | +In this example, you will learn how to use the deployment options available with the v2 endpoints for CI/CD. |
| 4 | + |
| 5 | +This provides some control to the deployment process. |
| 6 | + |
| 7 | +| Option | Description | |
| 8 | +| --- | --- | |
| 9 | +| noBuildAndRestore | The Umbraco CI/CD Flow runs the deployment in an isolated instance before doing the actual deployment to cloud. In the isolated instance we will try to do a `Dotnet restore` and `Dotnet build` of the incoming solution. This is a safeguard to prevent CI/CD isolated instance from sending broken code to the Umbraco Cloud environment. Enabling this option will skip the `restore` and `build` process in the isolated instance. This can take a couple of minutes of the deployment process. The final deployment on the actual website still runs it's own Restore and Build, which cannot be skipped. | |
| 10 | +| skipVersionCheck | When deploying, we will do an automatic check for Cloud dependency downgrades. This is to prevent customers from downgrading the packages that may have been autou pgraded in Umbraco Cloud, by accident. Enabling this option will skip that check and let any deployments with downgraded packages through. This is generally not recommended | |
| 11 | + |
| 12 | + |
| 13 | +{% tabs %} |
| 14 | +{% tab title="Azure DevOps Bash" %} |
| 15 | +Locate the main entry pipeline file. It will usually be this one: `azure-release-pipeline.yaml`. |
| 16 | + |
| 17 | +```yml |
| 18 | + # Deploy to Umbraco Cloud |
| 19 | + # #### |
| 20 | + # you can edit the variables noBuildAndRestore and skipVersionCheck |
| 21 | + # use booleans but as strings |
| 22 | + - stage: CloudDeploymentStage |
| 23 | + displayName: Deploy To Cloud |
| 24 | + dependsOn: cloudPrepareArtifact |
| 25 | + condition: in(dependencies.cloudPrepareArtifact.result, 'Succeeded') |
| 26 | + variables: |
| 27 | + artifactId: $[ stageDependencies.cloudPrepareArtifact.PrepareAndUploadArtifact.outputs['uploadArtifact.artifactId'] ] |
| 28 | + jobs: |
| 29 | + - template: cloud-deployment.yml |
| 30 | + parameters: |
| 31 | + artifactId: $(artifactId) |
| 32 | + noBuildAndRestore: 'false' |
| 33 | + skipVersionCheck: 'false' |
| 34 | +``` |
| 35 | +
|
| 36 | +The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `'true'`. |
| 37 | + |
| 38 | + |
| 39 | +{% endtab %} |
| 40 | +{% tab title="Azure DevOps PowerShell" %} |
| 41 | +Locate the main entry pipeline file. It will usually be this one: `azure-release-pipeline.yaml`. |
| 42 | + |
| 43 | +```yml |
| 44 | + # Deploy to Umbraco Cloud |
| 45 | + # #### |
| 46 | + # you can edit the variables noBuildAndRestore and skipVersionCheck |
| 47 | + # use booleans |
| 48 | + - stage: CloudDeploymentStage |
| 49 | + displayName: Deploy To Cloud |
| 50 | + dependsOn: cloudPrepareArtifact |
| 51 | + condition: in(dependencies.cloudPrepareArtifact.result, 'Succeeded') |
| 52 | + variables: |
| 53 | + artifactId: $[ stageDependencies.cloudPrepareArtifact.PrepareAndUploadArtifact.outputs['uploadArtifact.artifactId'] ] |
| 54 | + jobs: |
| 55 | + - template: cloud-deployment.yml |
| 56 | + parameters: |
| 57 | + artifactId: $(artifactId) |
| 58 | + noBuildAndRestore: false |
| 59 | + skipVersionCheck: false |
| 60 | +
|
| 61 | +``` |
| 62 | + |
| 63 | +The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `true`. |
| 64 | + |
| 65 | + |
| 66 | +{% endtab %} |
| 67 | +{% tab title="GitHub Actions Bash" %} |
| 68 | +Locate the main entry pipeline file. It will usually be this one: `main.yml`. |
| 69 | + |
| 70 | +```yml |
| 71 | + # Deploy to Umbraco Cloud |
| 72 | + # #### |
| 73 | + # you can edit the variables noBuildAndRestore and skipVersionCheck |
| 74 | + # use booleans but as strings |
| 75 | + cloud-deployment: |
| 76 | + name: "Deploy to Cloud" |
| 77 | + needs: cloud-artifact |
| 78 | + uses: ./.github/workflows/cloud-deployment.yml |
| 79 | + with: |
| 80 | + artifactId: ${{ needs.cloud-artifact.outputs.artifactId }} |
| 81 | + targetEnvironmentAlias: ${{ vars.TARGET_ENVIRONMENT_ALIAS }} |
| 82 | + noBuildAndRestore: "false" |
| 83 | + skipVersionCheck: "false" |
| 84 | + secrets: |
| 85 | + projectId: ${{ secrets.PROJECT_ID }} |
| 86 | + umbracoCloudApiKey: ${{ secrets.UMBRACO_CLOUD_API_KEY }} |
| 87 | +``` |
| 88 | + |
| 89 | +The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `"true"`. |
| 90 | + |
| 91 | +{% endtab %} |
| 92 | +{% tab title="GitHub Actions PowerShell" %} |
| 93 | +Locate the main entry pipeline file. It will usually be this one: `main.yml`. |
| 94 | + |
| 95 | +```yml |
| 96 | + # Deploy to Umbraco Cloud |
| 97 | + # #### |
| 98 | + # you can edit the variables noBuildAndRestore and skipVersionCheck |
| 99 | + # use 0 for false and 1 for true |
| 100 | + cloud-deployment: |
| 101 | + name: "Deploy to Cloud" |
| 102 | + needs: cloud-artifact |
| 103 | + uses: ./.github/workflows/cloud-deployment.yml |
| 104 | + with: |
| 105 | + artifactId: ${{ needs.cloud-artifact.outputs.artifactId }} |
| 106 | + targetEnvironmentAlias: ${{ vars.TARGET_ENVIRONMENT_ALIAS }} |
| 107 | + noBuildAndRestore: 0 |
| 108 | + skipVersionCheck: 0 |
| 109 | + secrets: |
| 110 | + projectId: ${{ secrets.PROJECT_ID }} |
| 111 | + umbracoCloudApiKey: ${{ secrets.UMBRACO_CLOUD_API_KEY }} |
| 112 | +``` |
| 113 | + |
| 114 | +The fields: `noBuildAndRestore` and `skipVersionCheck` can be marked with a `1`. |
| 115 | + |
| 116 | +{% endtab %} |
| 117 | +{% endtabs %} |
0 commit comments