Zack Williams | ccaa38a | 2021-11-16 15:36:05 -0700 | [diff] [blame^] | 1 | Release Process |
| 2 | =============== |
| 3 | |
| 4 | Prerequisites |
| 5 | ------------- |
| 6 | |
| 7 | SD-Core makes the following assumptions about the components are included in a |
| 8 | release: |
| 9 | |
| 10 | Git tags |
| 11 | """""""" |
| 12 | |
| 13 | Code receives Git tags as a part of the CI process |
| 14 | |
| 15 | * Tag content comes from a **VERSION** file within the repo, and tags are |
| 16 | created only the version is a SemVer released version (example: ``1.2.3``, no |
| 17 | ``-dev`` or ``-rc`` extensions) |
| 18 | |
| 19 | * Tagging is *only done by the CI system* (Jenkins), which pushes tags to git |
| 20 | repos after a submit/merge of code which changes the **VERSION** file. |
| 21 | |
| 22 | * CI system enforces tag uniqueness - no two commits have the same released |
| 23 | version tags. |
| 24 | |
| 25 | * You can't re-release or "fix" a version that has problem - make a new |
| 26 | version with fixes in it. |
| 27 | |
| 28 | Docker container images |
| 29 | """"""""""""""""""""""" |
| 30 | |
| 31 | All docker images are tagged based on their git tags. |
| 32 | |
| 33 | * For released versions, the CI system should prevent a Dockerfile from |
| 34 | referencing a parent containers that are a moving target, such as ``latest`` |
| 35 | or ``master``. |
| 36 | |
| 37 | * This allows a container to be rebuilt given an arbitrary git commit with |
| 38 | fair confidence that it will result in the same code in the container. |
| 39 | |
| 40 | * Official images are only pushed to registries by the CI system |
| 41 | |
| 42 | * Increases repeatability of the process, and prevents human accidents. |
| 43 | |
| 44 | Helm charts |
| 45 | """"""""""" |
| 46 | |
| 47 | * Each chart may only contain references to released, SemVer tagged container images |
| 48 | |
| 49 | * Chart CI process must check that a chart version is unique - a chart can't |
| 50 | be created with the same version twice. This should be done against the |
| 51 | chart repo. |
| 52 | |
| 53 | Release Steps |
| 54 | ------------- |
| 55 | |
| 56 | All Helm charts are checked that the containers they use have a SemVer version |
| 57 | tag |
| 58 | |
| 59 | A branch is created on the Helm charts repo, with the abbreviated name of the |
| 60 | release - for example **sdcore-1.0**. |
| 61 | |
| 62 | To allow for future patches to go into the repo in a way that does not conflict |
| 63 | with the version branch, each component repo's **VERSION** file should have it's |
| 64 | minor version increased. (ex: 1.2.n to 1.3.0-dev, so future 1.3.n+1 component |
| 65 | release can easily be created). |
| 66 | |
| 67 | The same should be done on Helm charts in the chart repos post release, but the |
| 68 | versions there shouldn't include a ``-dev`` suffix because chart publishing |
| 69 | requires that every new chart version be unique and unsuffixed SemVer is a |
| 70 | more consistent release numbering pattern. |
| 71 | |
| 72 | Finally, the ``sdcore-helm-charts`` repo overall **VERSION** should also be incremented |
| 73 | to the next minor version (1.6.0-dev) on the **master** branch, so all 1.0.x |
| 74 | releases of the overall charts repo will happen on the **sdcore-1.0** branch. |
| 75 | |
| 76 | Creating releases on the 1.0.x branch |
| 77 | """"""""""""""""""""""""""""""""""""" |
| 78 | |
| 79 | If a fix is needed only to the helm charts: |
| 80 | |
| 81 | 1. Make the fix on the master branch of sdcore-helm-charts (assuming that it is |
| 82 | required in both places). |
| 83 | |
| 84 | 2. After the master tests pass, manually cherry-pick the fix to the **sdcore-1.0** |
| 85 | branch (the Chart version would be different, requiring the manual step). |
| 86 | |
| 87 | 3. Cherry-picked patchsets on that branch will be checked by the **sdcore-1.0** |
| 88 | branch of tests. |
| 89 | |
| 90 | 4. When it passes, submitting the change will make a new 1.0.x release |
| 91 | |
| 92 | 5. Update the documentation to reflect the chart changes, a description of the |
| 93 | changes m, and increment the tag on the docs from 1.0.n to 1.0.n+1, to |
| 94 | reflect the patch change. |
| 95 | |
| 96 | 6. If all the charts are updated and working correctly, create a new charts |
| 97 | point release by increasing the 1.0.n **VERSION** file in the |
| 98 | sdcore-helm-charts repo. This should be the same as the version in the |
| 99 | documentation. Immediately make another patch that returns the |
| 100 | ``sdcore-helm-charts`` **VERSION** to 1.0.n+1-dev, so that development |
| 101 | patches can continue on that branch. |
| 102 | |
| 103 | If a fix is needed to the components/containers that are included by the helm charts: |
| 104 | |
| 105 | 1. Develop a fix to the issue on the master branch, get it approved after |
| 106 | passing master tests. |
| 107 | |
| 108 | 2. If it doesn't exist, create an **sdcore-1.0** branch on the component repo, |
| 109 | starting at the commit where the **VERSION** of the component used in 1.0 was |
| 110 | created - this is known as "lazy branching". |
| 111 | |
| 112 | |
| 113 | 3. Manually cherry-pick to the **sdcore-1.0** branch of the component, incrementing |
| 114 | the patch version, and test with the **sdcore-1.0** version of |
| 115 | sdcore-system-tests and helm charts. |
| 116 | |
| 117 | 4. Update helm charts and go through the helm chart update process above |
| 118 | |