|
1 | 1 | # Migrate from V1 to V2 |
| 2 | +We wanted to improve on the original flow based on all the feedback received from users of the feature. |
| 3 | + |
| 4 | +Here we will go through how to migrate from V1 samples to V2 samples. |
| 5 | + |
| 6 | +{% hint style="info" %} |
| 7 | +Be advised that both scripts and pipeline files have changes. |
2 | 8 |
|
3 | | -todo todo todo |
| 9 | +Familiarize you self with the new samples. |
| 10 | + |
| 11 | +If you customized the flow or the V1 scripts please take extra care to incorporate your changes. |
| 12 | +{% endhint %} |
| 13 | + |
| 14 | +You keep using the old endpoints and samples, but you will miss out on the enhancements. We currently don't have any plans to deprecate the V1 endpoints. |
4 | 15 |
|
5 | 16 | ## What has changed? |
6 | | -We wanted to improve on the original flow based on all the feedback received from users of the feature. |
7 | | -Here are some of the highlights: |
8 | | -- New endpoints |
9 | | -- Target environment must be supplied on get-diff and deploy steps |
10 | | -- More options when deploying |
11 | | -- Rewritten scripts to target new endpoints |
| 17 | +The biggest enhancement is the ability to target different environments. You are now able to target the flexible and the leftmost mainline environment. |
| 18 | +We have created new endpoints to accommodate this enhancement, meaning you will have to supply a target environment alias in some requests. |
| 19 | + |
| 20 | +Also the initial flow has been slightly changed. The upload of a deployment package is no longer tied to a "deployment-meta", but rather is a completely separate step. Every uploaded artifact can be queried by the api, similar to querying deployments via the api. |
| 21 | + |
| 22 | +When you request a deployment you now also need to supply an artifactId. Also more options are available when deploying. |
| 23 | + |
| 24 | +To showcase how to use the new V2 endpoints and flow, we have created some updated samples. |
| 25 | + |
| 26 | +# Migrate Azure DevOps |
| 27 | +Start by deleting the scripts and yaml files you initially got from the CICD samples: |
| 28 | +- Delete the Yaml/yml: |
| 29 | + - `azure-release-pipeline.yaml` |
| 30 | + - `cloud-sync.yml` |
| 31 | + - `cloud-deployment.yml` |
| 32 | + |
| 33 | +You probably only have either PowerShell or Bash. |
| 34 | +- PowerShell files to delete: |
| 35 | + - `Add-DeploymentPackage.ps1` |
| 36 | + - `Apply-Patch.ps1` |
| 37 | + - `Get-ChangesById.ps1` |
| 38 | + - `Get-LatestDeployment.ps1` |
| 39 | + - `New-Deployment.ps1` |
| 40 | + - `Start-Deployment.ps1` |
| 41 | + - `Test-Deployment.ps1` |
| 42 | +- Bash files to delete: |
| 43 | + - `apply_patch.sh` |
| 44 | + - `create_deployment.sh` |
| 45 | + - `get_changes_by_id.sh` |
| 46 | + - `get_deployment_status.sh` |
| 47 | + - `get_latest_deployment.sh` |
| 48 | + - `start_deployment.sh` |
| 49 | + - `upload_package.sh` |
| 50 | + |
| 51 | +Now copy the scripts from the sample repositorys V2 folder to the corresponding folder in you repo: |
| 52 | +- If you prefer PowerShell: |
| 53 | + - All .ps1 files in `V2/powershell` should be copied to `devops/powershell` |
| 54 | + - All .yaml/.yml in `V2/powershell/azuredevops` should be copied to `devops` |
| 55 | +- If you prefer Bash: |
| 56 | + - All .sh files in `V2/bash` should be copied to `devops/scripts` |
| 57 | + - All .yaml/.yml in `V2/bash/azuredevops` should be copied to `devops` |
12 | 58 |
|
13 | | -## Move directly from V1 to V2 scripts |
14 | | -This assumes you have only changes the parameters mentioned in the original guide |
| 59 | +Now we need some important values: Project id and Target environment alias. |
| 60 | +- [This section](./samplecicdpipeline/README.md#obtaining-the-project-id-and-api-key) explains how to get the project id. |
| 61 | +- [This section](./samplecicdpipeline/README.md#getting-environment-aliases-to-target) explains how to get the environment alias. |
15 | 62 |
|
16 | | -# azdevops |
| 63 | +Now open the `azure-release-pipeline.yaml` in your favorite editor. |
| 64 | +You need to replace `##Your project Id here##` with the project Id and the value `##Your target environment alias here#` with the environment alias. |
17 | 65 |
|
| 66 | +You can use any of the available aliases, but to get similar functionality as before you should select the environment described as `Leftmost mainline`. |
18 | 67 |
|
19 | | -# github |
| 68 | +# GitHub |
0 commit comments