|
2 | 2 | Order: 20
|
3 | 3 | Title: Continuous Delivery
|
4 | 4 | Description: |
|
5 |
| - Continuous Delivery is the default versioning mode. In this mode, |
6 |
| - GitVersion calculates the next version and will use that until that is |
7 |
| - released. |
| 5 | + Sometimes you just want the version to keep changing and deploy continuously |
| 6 | + to an testing system. In this case, Continuous Delivery is a good mode to |
| 7 | + operate GitVersion by. |
8 | 8 | RedirectFrom: docs/reference/versioning-modes/continuous-delivery
|
9 | 9 | ---
|
10 | 10 |
|
11 |
| -Continuous Delivery is the practice of having a deployment pipeline and is the |
12 |
| -default mode in GitVersion. Each stage of the pipeline gets the code going |
13 |
| -through the pipeline closer to production. |
| 11 | +Continuous Delivery is the process of checking into a branch, running all the |
| 12 | +tests and if everything goes green it is automatically pushed to a testing system. |
14 | 13 |
|
15 |
| -The topic itself is rather large, here we will just focus on the building and |
16 |
| -creation of _releasable_ artifacts. This is only a part of continuous delivery |
17 |
| -as a whole, with the hard part being the ability to measure the impacts of what |
18 |
| -you have deployed into production. |
| 14 | +A good case for Continuous Delivery is when using Octopus deploy, as you |
| 15 | +cannot publish the same version of a package into the same feed. |
19 | 16 |
|
20 |
| -In essence continuous delivery means: |
21 |
| - |
22 |
| -* Your code is automatically built and tested |
23 |
| -* If any of the automated tests fail, the team's #1 priority is to fix the |
24 |
| - build |
25 |
| -* If the build is green, the application can be deployed at any time |
26 |
| - * Ideally the business should make that decision |
27 |
| - * The same artifacts which were built and tested should be deployed |
28 |
| - * That means no rebuilding everything when you are deploying |
29 |
| - |
30 |
| -Continuous delivery does not work well with GitFlow. The reason is that you are |
31 |
| -required to _merge_ to main to do a release, triggering a rebuild and a new |
32 |
| -set of artifacts to go through your pipeline. Depending on how long your |
33 |
| -pipeline is, this could be a while. |
34 |
| - |
35 |
| -GitHubFlow is a better fit for Continuous delivery, the [mainline |
36 |
| -development][mainline] model means that every merged feature branch will be |
37 |
| -built as a _stable_ version and if the build/builds go green then you are free |
38 |
| -to deploy to production at any time. |
39 |
| - |
40 |
| -## Usage |
41 |
| - |
42 |
| -By default, GitVersion is set up to do Continuous Delivery on all branches but |
43 |
| -`develop`, which is set up with [Continuous Deployment][continuous-deployment]. |
44 |
| -To change the mode to Continuous Delivery, change your |
45 |
| -[configuration][configuration] to: |
46 |
| - |
47 |
| -```yaml |
48 |
| -mode: ContinuousDelivery |
49 |
| -``` |
| 17 | +For this mode we follow the logic in [this blog post by Xavier Decoster][blog] |
| 18 | +on the issues of incrementing automatically. |
50 | 19 |
|
51 | 20 | ## How Continuous Delivery affects GitVersion
|
52 | 21 |
|
53 |
| -The thing about continuous delivery is that there will be _multiple_ candidates |
54 |
| -to deploy to production and it is a human choice to deploy. This means that |
55 |
| -GitVersion will build **the same semantic version** until that version is |
56 |
| -deployed. For instance: |
57 |
| -
|
58 |
| -* 1.1.0+5 |
59 |
| -* 1.1.0+6 |
60 |
| -* 1.1.0+7 <-- This is the artifact we release, tag the commit which created |
61 |
| - this version |
62 |
| -* 1.1.1+0 |
63 |
| -
|
64 |
| -Tags are required in this mode to communicate when the release is done as it's |
65 |
| -an external manual process. |
| 22 | +Continuous delivery is good when you deploy continuously to an testing system. |
66 | 23 |
|
67 |
| -## Resources |
| 24 | +* 1.1.0-3 |
| 25 | +* 1.1.0-2 (tag: 1.1.0-2) <-- This is the version which has been deployed on testing |
| 26 | +* 1.1.0-1 |
| 27 | +* 1.1.1-0 |
68 | 28 |
|
69 |
| -* [Continuous Delivery on Wikipedia][wikipedia] |
70 |
| -* [Continuous Delivery, the book][book] |
| 29 | +Tags are not required but optional in this mode to communicate when the release |
| 30 | +is done as it's an automated process. |
71 | 31 |
|
72 |
| -[book]: https://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912 |
73 | 32 | [configuration]: /docs/reference/configuration
|
74 |
| -[continuous-deployment]: /docs/reference/modes/continuous-deployment |
75 |
| -[mainline]: /docs/reference/modes/mainline |
| 33 | +[blog]: https://www.xavierdecoster.com/semantic-versioning-auto-incremented-nuget-package-versions |
76 | 34 | [wikipedia]: https://en.wikipedia.org/wiki/Continuous_delivery
|
0 commit comments