Skip to content

Commit 1dadf38

Browse files
committed
Add azure devops description
1 parent 9983af1 commit 1dadf38

File tree

1 file changed

+27
-14
lines changed
  • umbraco-cloud/set-up/project-settings/umbraco-cicd/samplecicdpipeline

1 file changed

+27
-14
lines changed

umbraco-cloud/set-up/project-settings/umbraco-cicd/samplecicdpipeline/azure-devops.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Now we can move on to setting up a pipeline.
6363
While working with the project on your local machine, follow these steps to prepare the pipeline, using the [samples from the repository](https://github.com/umbraco/Umbraco.Cloud.CICDFlow.Samples).
6464

6565
{% hint style="info" %}
66+
TODO fix links
67+
6668
Download the provided sample scripts as ZIP from the [GitHub repository](https://github.com/umbraco/Umbraco.Cloud.CICDFlow.Samples/tree/main). Click on "Code" and then choose "Download ZIP". Then unzip it and use those files for the next steps.
6769
{% endhint %}
6870

@@ -78,13 +80,13 @@ For a pipeline that uses Powershell scripts you will need the following files:
7880
* `Get-LatestDeployment.ps1`
7981
* `Get-ChangesById.ps1`
8082
* `Apply-Patch.ps1`
81-
* `New-Deployment.ps1`
82-
* `Add-DeploymentPackage.ps1`
83+
* `Add-DeploymentArtifact.ps1`
8384
* `Start-Deployment.ps1`
8485
* `Test-DeploymentStatus.ps1`
8586
* From the `powershell/azuredevops` folder
8687
* `azure-release-pipeline.yml`
8788
* `cloud-sync.yml`
89+
* `cloud-artifact.yml`
8890
* `cloud-deployment.yml`
8991

9092
**Do the following to prepare the pipeline:**
@@ -110,13 +112,13 @@ For a pipeline that uses Bash scripts you will need the following files:
110112
* `get_latest_deployment.sh`
111113
* `get_changes_by_id.sh`
112114
* `apply-patch.sh`
113-
* `create_deployment.sh`
114-
* `upload_package.sh`
115+
* `upload_artifact.sh`
115116
* `start_deployment.sh`
116117
* `get_deployment_status.sh`
117118
* From the `bash/azuredevops` folder
118119
* `azure-release-pipeline.yml`
119120
* `cloud-sync.yml`
121+
* `cloud-artifact.yml`
120122
* `cloud-deployment.yml`
121123

122124
**Do the following to prepare the pipeline:**
@@ -138,6 +140,8 @@ For a pipeline that uses Bash scripts you will need the following files:
138140

139141
The pipeline needs to know which Umbraco Cloud project to deploy to. In order to do this you will need the `Project ID` and the `API Key`. [This article](./#obtaining-the-project-id-and-api-key) describes how to get those values.
140142

143+
You will also need the alias of the environment you want to target. [This article](./#getting-environment-aliases-to-target) described how you can see a list of environments you can target here. Note the environment alias you want to target.
144+
141145
* Now go to the repository in Azure and click on "Set up build".
142146

143147
<figure><img src="../../../../.gitbook/assets/azuresetupbuild.png" alt=""><figcaption><p>Azure DevOps Repository</p></figcaption></figure>
@@ -153,6 +157,7 @@ The pipeline needs to know which Umbraco Cloud project to deploy to. In order to
153157

154158
* Now you are on the "Review your pipeline YAML" screen
155159
* Replace the `##Your project Id here##` with the Project Id you got from Umbraco Cloud Portal
160+
* Replace the `##Your target environment alias here##` with the alias of the environment you want to target
156161
* Click on "Variables"
157162

158163
<figure><img src="../../../../.gitbook/assets/azdevops-pipeline-variables.png" alt=""><figcaption><p>Pipeline variables in Azure DevOps</p></figcaption></figure>
@@ -186,36 +191,44 @@ While working on your project locally, add a new Document type.
186191

187192
## High level overview of the pipeline components
188193

189-
The mentioned scripts are provided as a starting point. It is recommended that you familiarize yourself with the scripts and with documentation related to how to use Azure DevOps.
194+
The mentioned scripts are provided as a starting point.
195+
It is recommended that you familiarize yourself with the scripts and with documentation related to how to use Azure DevOps.
190196

191197
The scripts demonstrates the following:
192198

193-
* How to sync your Azure DevOps repository with the [left-most project environment](../../../../deployment/) in Umbraco Cloud
194-
* How to deploy changes to the left-most project environment in Umbraco Cloud
199+
* How to sync your Azure DevOps repository with an environment in Umbraco Cloud via the environment alias
200+
* How to prepare and upload an artifact that can be used for a deployment
201+
* How to deploy changes to an environment in Umbraco Cloud, targeted via the environment alias
195202

196203
### Main
197204

198-
The `azure-release-pipeline.yaml` is the main pipeline, and is the one that will be triggered on a push to `main` branch. You can configure a different trigger behavior in this file.
205+
The `azure-release-pipeline.yaml` is the main pipeline, and is the one that will be triggered on a push to the `main` branch in your repository. You can configure a different trigger behavior in this file.
199206

200-
You can add your Build and Test stage between the `cloudSyncStage` and `cloudDeploymentStage` stages. Keep in mind that you do not need to retain the dotnet build artifact for upload later. The `cloudDeploymentStage` job will take care of packaging all your source code and upload to Umbraco Cloud.
207+
You can add your Build and Test stage between the `cloudSyncStage` and `cloudPrepareArtifact` stages. Keep in mind that you do not need to retain the dotnet build artifact for upload later. The `cloudPrepareArtifact` job will take care of packaging all your source code and upload to Umbraco Cloud.
208+
209+
If you add Build and Test stages after `cloudSyncStage` make sure that you checkout the updated code in case there were applied a git patch to your repository.
201210

202211
### Cloud-sync
203212

204213
The `cloud-sync.yml` shows how you can sync your Azure DevOps repository with the left-most environment of your Cloud project. In this sample, it accepts any change from the API and applies and commits it back to the branch which triggered the pipeline. However the commit does not trigger the pipeline again.
205214

206215
If you don't want the pipeline to commit back to the triggering branch, this is where you need to change the pipeline.
207216

208-
### Cloud-deployment
217+
### Cloud-artifact
209218

210-
The `cloud-deployment.yml` shows how you can deploy your repository to the left-most environment of your Cloud project. The sample shows how to prepare for deployment, request the deployment and wait for cloud to finish.
219+
The `cloud-artifact.yml` shows how you can prepare and package an artifact and finally upload it to Umbraco Cloud.
211220

212221
There are a couple of things here to be aware of:
213222

214-
* We are overwriting the `.gitignore` file with `cloud.gitignore`. This is a way to accommodate your gitignore-needs when working locally. For instance you might want to ignore frontend builds, but you want them build and published to cloud.
215-
* We have a special `cloud.zipignore` file. This is a convenient way to tell the pipeline which files **not** to include when creating the zip package to send to cloud.
223+
* The sample is overwriting the `.gitignore` file with `cloud.gitignore`. This is a way to accommodate your gitignore-needs when working locally. For instance you might want to ignore frontend builds, but you want them build and published to cloud.
224+
* The sample contains a special `cloud.zipignore` file. This is a convenient way to tell the pipeline which files **not** to include when creating the zip package to send to cloud.
225+
226+
### Cloud-deployment
227+
228+
The `cloud-deployment.yml` shows how you can deploy to a named environment of your Cloud project. The sample shows how to request the deployment and wait for cloud to finish the operation.
216229

217230
{% hint style="info" %}
218-
If you have frontend assets that needs to be built (using tools like npm/yarn or others), you should add the needed steps before `Zip Source Code`. This is to ensure that the fresh frontend assets will be part of the package to be sent to Umbraco Cloud.
231+
If you have frontend assets that needs to be built (using tools like npm/yarn or others), you should add the needed steps before `cloudPrepareArtifact`. This is to ensure that the fresh frontend assets will be part of the package to be sent to Umbraco Cloud.
219232
{% endhint %}
220233

221234
## Further information

0 commit comments

Comments
 (0)