You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: umbraco-cloud/set-up/project-settings/umbraco-cicd/samplecicdpipeline/azure-devops.md
+27-14Lines changed: 27 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,8 @@ Now we can move on to setting up a pipeline.
63
63
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).
64
64
65
65
{% hint style="info" %}
66
+
TODO fix links
67
+
66
68
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.
67
69
{% endhint %}
68
70
@@ -78,13 +80,13 @@ For a pipeline that uses Powershell scripts you will need the following files:
78
80
*`Get-LatestDeployment.ps1`
79
81
*`Get-ChangesById.ps1`
80
82
*`Apply-Patch.ps1`
81
-
*`New-Deployment.ps1`
82
-
*`Add-DeploymentPackage.ps1`
83
+
*`Add-DeploymentArtifact.ps1`
83
84
*`Start-Deployment.ps1`
84
85
*`Test-DeploymentStatus.ps1`
85
86
* From the `powershell/azuredevops` folder
86
87
*`azure-release-pipeline.yml`
87
88
*`cloud-sync.yml`
89
+
*`cloud-artifact.yml`
88
90
*`cloud-deployment.yml`
89
91
90
92
**Do the following to prepare the pipeline:**
@@ -110,13 +112,13 @@ For a pipeline that uses Bash scripts you will need the following files:
110
112
*`get_latest_deployment.sh`
111
113
*`get_changes_by_id.sh`
112
114
*`apply-patch.sh`
113
-
*`create_deployment.sh`
114
-
*`upload_package.sh`
115
+
*`upload_artifact.sh`
115
116
*`start_deployment.sh`
116
117
*`get_deployment_status.sh`
117
118
* From the `bash/azuredevops` folder
118
119
*`azure-release-pipeline.yml`
119
120
*`cloud-sync.yml`
121
+
*`cloud-artifact.yml`
120
122
*`cloud-deployment.yml`
121
123
122
124
**Do the following to prepare the pipeline:**
@@ -138,6 +140,8 @@ For a pipeline that uses Bash scripts you will need the following files:
138
140
139
141
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.
140
142
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
+
141
145
* Now go to the repository in Azure and click on "Set up build".
@@ -153,6 +157,7 @@ The pipeline needs to know which Umbraco Cloud project to deploy to. In order to
153
157
154
158
* Now you are on the "Review your pipeline YAML" screen
155
159
* 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
156
161
* Click on "Variables"
157
162
158
163
<figure><imgsrc="../../../../.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.
186
191
187
192
## High level overview of the pipeline components
188
193
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.
190
196
191
197
The scripts demonstrates the following:
192
198
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
195
202
196
203
### Main
197
204
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.
199
206
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.
201
210
202
211
### Cloud-sync
203
212
204
213
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.
205
214
206
215
If you don't want the pipeline to commit back to the triggering branch, this is where you need to change the pipeline.
207
216
208
-
### Cloud-deployment
217
+
### Cloud-artifact
209
218
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.
211
220
212
221
There are a couple of things here to be aware of:
213
222
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.
216
229
217
230
{% 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.
0 commit comments