|
| 1 | +# samba-container Release Process |
| 2 | + |
| 3 | +## Preparation |
| 4 | + |
| 5 | +The samba-container project has a dedicated branch, called `release`, for |
| 6 | +release versions. This is done to update certain files which control |
| 7 | +dependencies and versioning. Tags are applied directly to this branch |
| 8 | +and only this branch. |
| 9 | + |
| 10 | + |
| 11 | +### Tagging |
| 12 | + |
| 13 | +Prior to tagging, check out the `release` branch and merge `master` into it. |
| 14 | +Example: |
| 15 | + |
| 16 | +``` |
| 17 | +git checkout master |
| 18 | +git pull --ff-only |
| 19 | +git checkout release |
| 20 | +git pull --ff-only |
| 21 | +git merge master |
| 22 | +# resolve any conflicts |
| 23 | +``` |
| 24 | + |
| 25 | +Now we need to "pin" the appropriate versions of samba and sambacc so that only |
| 26 | +explicitly specified versions of those packages will be included on release |
| 27 | +branch builds. Set `SAMBA_VERSION_SUFFIX` and `SAMBACC_VERSION_SUFFIX` in the |
| 28 | +container files in `images/`. Currently, only the fedora based images are |
| 29 | +included in the release. Thus you must set those variables in the fedora |
| 30 | +container files for server and ad-server. Commit these changes to the `release` |
| 31 | +branch. Currently, there is no PR process for release branches so make the |
| 32 | +commits directly to the `release` branch and push them. This implies that |
| 33 | +releases must be managed by users with the rights to push directly to the |
| 34 | +project's release branch. |
| 35 | + |
| 36 | +At this point, an optional but recommended step is to do a test build before |
| 37 | +tagging. Run `make build-ad-server build-server build-client build-toolbox`. |
| 38 | +You do not need to build the nightly package variants or other OS bases as |
| 39 | +these are not part of the released images. You can push the images to quay.io |
| 40 | +under your own repos to perform a early security scan as well. |
| 41 | + |
| 42 | +If you are happy with the content of the `release` branch, tag it. Example: |
| 43 | + |
| 44 | +``` |
| 45 | +git checkout release |
| 46 | +git tag -a -m 'Release v0.3' v0.3 |
| 47 | +``` |
| 48 | + |
| 49 | +This creates an annotated tag. Release tags must be annotated tags. |
| 50 | + |
| 51 | +### Build |
| 52 | + |
| 53 | +Using the tagged `release` branch, the container images for release will be |
| 54 | +built. It is very important to ensure that base images are up-to-date. |
| 55 | +It is very important to ensure that you perform the next set of steps with |
| 56 | +clean new builds and do not use cached images. To accomplish both tasks it |
| 57 | +is recommended to purge your local container engine of cached images |
| 58 | +(Example: `podman image rm --all`). You should have no images named like |
| 59 | +`quay.io/samba.org` in your local cache. |
| 60 | + |
| 61 | +Build the images from scratch. Example: |
| 62 | +``` |
| 63 | +make build-ad-server build-server build-client build-toolbox |
| 64 | +``` |
| 65 | + |
| 66 | +For each image that was just built, apply a temporary pre-release tag |
| 67 | +to it. Example: |
| 68 | +``` |
| 69 | +for img_name in ad-server server client toolbox ; do |
| 70 | + podman tag quay.io/samba.org/samba-${img_name}:{latest,v0.3pre1} |
| 71 | +done |
| 72 | +``` |
| 73 | + |
| 74 | +Log into quay.io. Push the images to quay.io using the temporary tag. Example: |
| 75 | +``` |
| 76 | +for img_name in ad-server server client toolbox ; do |
| 77 | + podman push quay.io/samba.org/samba-${img_name}:v0.3pre1 |
| 78 | +done |
| 79 | +``` |
| 80 | + |
| 81 | +Wait for the security scan to complete. There shouldn't be any issues if you |
| 82 | +properly updated the base images before building. If there are issues and you |
| 83 | +are sure you used the newest base images, check the base images on quay.io and |
| 84 | +make sure that the number of issues are identical. The security scan can take |
| 85 | +some time, while it runs you may want to do other things. |
| 86 | + |
| 87 | + |
| 88 | +## GitHub Release |
| 89 | + |
| 90 | +When you are satisfied that the tagged version is suitable for release, you |
| 91 | +can push the tag to the public repo: |
| 92 | +``` |
| 93 | +git push --follow-tags |
| 94 | +``` |
| 95 | + |
| 96 | +Draft a new set of release notes. Select the recently pushed tag. Start with |
| 97 | +the auto-generated release notes from GitHub (activate the `Generate release |
| 98 | +notes` button/link). Add an introductory section (see previous notes for an |
| 99 | +example). Add a "Highlights" section if there are any notable features or fixes |
| 100 | +in the release. The Highlights section can be skipped if the content of the |
| 101 | +release is unremarkable (e.g. few changes occurred since the previous release). |
| 102 | + |
| 103 | +Because this is a container based release we do not provide any build artifacts |
| 104 | +on GitHub (beyond the sources automatically provided there). Instead we add |
| 105 | +a Downloads section that notes the exact tags and digests that the images can |
| 106 | +be found at on quay.io. |
| 107 | + |
| 108 | +Use the following partial snippet as an example: |
| 109 | +``` |
| 110 | +Images built for this release can be obtained from the quay.io image registry. |
| 111 | +
|
| 112 | +### samba-server |
| 113 | +* By tag: quay.io/samba.org/samba-server:v0.3 |
| 114 | +* By digest: quay.io/samba.org/samba-server@sha256:09c867343af39b237230f94a734eacc8313f2330c7d934994522ced46b740715 |
| 115 | +### samba-ad-server |
| 116 | +* By tag: quay.io/samba.org/samba-ad-server:v0.3 |
| 117 | +* By digest: quay.io/samba.org/samba-ad-server@sha256:a1d901f44be2af5a516b21e45dbd6ebd2f64500dfbce112886cdce09a5c3cbd5 |
| 118 | +``` |
| 119 | +... and so on for each image that was pushed earlier |
| 120 | + |
| 121 | +The tag is pretty obvious - it should match the image tag (minus any pre-release |
| 122 | +marker). You can get the digest from the tag using the quay.io UI (do not use |
| 123 | +any local digest hashes). Click on the SHA256 link and then copy the full |
| 124 | +manifest hash using the UI widget that appears. |
| 125 | + |
| 126 | +Perform a final round of reviews, as needed, for the release notes and then |
| 127 | +publish the release. |
| 128 | + |
| 129 | +Once the release notes are drafted and then either immediately before or after |
| 130 | +publishing them, use the quay.io UI to copy each pre-release tag to the "latest" |
| 131 | +tag and a final "vX.Y" tag. Delete the temporary pre-release tags using the |
| 132 | +quay.io UI as they are no longer needed. |
0 commit comments