Skip to content

Commit 3b08b3b

Browse files
committed
Synced test and release-automation with release/8.4
1 parent 948927c commit 3b08b3b

25 files changed

+4976
-19
lines changed

.github/actions/build-and-tag-locally/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ runs:
308308
id: format-registry-tag
309309
shell: bash
310310
run: |
311-
# Determine tag prefix based on custom_build and release_tag
312311
if [[ "${{ inputs.run_type }}" == "release" ]]; then
313312
tag_prefix="${{ inputs.release_tag }}"
314313
elif [[ "${{ inputs.run_type }}" == "unstable" || "${{ inputs.run_type }}" == "nightly" ]]; then

release-automation/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__pycache__/
2+
venv

release-automation/README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Docker release process and release automation description
2+
3+
This readme covers relase process for versions 8 and above.
4+
5+
In version 8 the docker-library structure has changed. Static Dockerfiles are used instead of templating. Versions live in a different mainline branches and are marked with tags.
6+
7+
The docker release process goal is to create a PR in official-docker library for library/redis file.
8+
9+
library/redis stackbrew file should reflect the tags in redis/docker-library-redis repository.
10+
11+
## Branches and tags
12+
13+
Mainline branches are named `release/Major.Minor` (e.g. `release/8.2`)
14+
15+
Each version release is tagged with `vMajor.Minor.Patch` (e.g. `v8.2.1`)
16+
17+
Milestone releases are tagged with `vMajor.Minor.Patch-Milestone` (e.g. `v8.2.1-m01`). Any suffix after patch version is considered a milestone.
18+
19+
Suffixes starting with `rc` are considered release candidates and are preferred over suffixes starting with `m` which in turn are preferred over any other suffix.
20+
21+
Tags without suffix are considered GA (General Availability) releases (e.g. `v8.2.1`).
22+
23+
Internal releases are milestone releases containing `-int` in their name (e.g. `v8.2.1-m01-int1` or `8.4.0-int3`). They are not released to the public.
24+
25+
Milestone releases never get latest or any other default tags, like `8`, `8.2`, `8.2.1`, `latest`, `bookworm`, etc.
26+
27+
For each mainline only one GA release and optionally any number of milestone releases with higher versions than this GA may be published in official-library.
28+
29+
Each patch version may have only one GA or milestone release, GA release is preferred over milestone release.
30+
31+
For example for this list of tags the following rules will be applied
32+
33+
* `v8.2.3-m01` - included because there is neither GA nor any higher milestone versions for 8.2.3
34+
* `v8.2.2-rc2` - included because it higher version among 8.2.2
35+
* `v8.2.2-rc1` - excluded because 8.2.2-rc2 is higher version
36+
* `v8.2.2-m01` - excluded because 8.2.2-rc2 is higher version
37+
* `v8.2.1-rc2` - excluded because there is 8.2.1 GA version
38+
* `v8.2.1` - included because it is highest GA for 8.2
39+
* `v8.2.0` - exluded because 8.2.1 is higher version
40+
41+
End of life versions are marked with `-eol` suffix (e.g. `v8.0.3-eol`). When there is a at least one minor version tagged with eol all versions in this minor series are considered EOL and are not included in the release file.
42+
43+
## Creating a release manually
44+
45+
This process is automated using github workflows. However, it's useful to understand the manual process.
46+
47+
Determine a mainline branch, e.g `release/8.2` for version `8.2.2`.
48+
49+
Optionally create a release branch from the mainline branch, e.g. `8.2.2`.
50+
51+
Modify dockerfiles.
52+
53+
Test dockerfiles.
54+
55+
If release branch was created, merge it back to mainline branch.
56+
57+
Tag commit with `vMajor.Minor.Patch` (e.g. `v8.2.1`) in the mainline branch.
58+
59+
Push your changes to redis/docker-library-redis repository.
60+
61+
Create a PR to official-library refering the tag and commit you created.
62+
63+
64+
# Release automation tool
65+
66+
Release automation tool is used to generate library/redis file for official-library. It uses origin repository as a source of truth and follows the process described above.
67+
68+
## Installation
69+
70+
### From Source
71+
72+
```bash
73+
cd release-automation
74+
pip install -e .
75+
```
76+
77+
### Development Installation
78+
79+
```bash
80+
cd release-automation
81+
pip install -e ".[dev]"
82+
```
83+
84+
## Usage
85+
86+
```bash
87+
release-automation --help
88+
```

release-automation/docker/Dockerfile

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release-automation/pyproject.toml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "stackbrew-library-generator"
7+
version = "0.1.0"
8+
description = "Stackbrew Library Generator for Redis Docker Images"
9+
authors = [
10+
{name = "Redis Team", email = "team@redis.io"},
11+
]
12+
readme = "README.md"
13+
requires-python = ">=3.8"
14+
classifiers = [
15+
"Development Status :: 3 - Alpha",
16+
"Intended Audience :: Developers",
17+
"License :: OSI Approved :: MIT License",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.8",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
]
24+
dependencies = [
25+
"typer[all]>=0.9.0",
26+
"rich>=13.0.0",
27+
"pydantic>=2.0.0",
28+
"packaging>=21.0",
29+
]
30+
31+
[project.optional-dependencies]
32+
dev = [
33+
"pytest>=7.0.0",
34+
"pytest-cov>=4.0.0",
35+
"black>=23.0.0",
36+
"isort>=5.12.0",
37+
"mypy>=1.0.0",
38+
"pre-commit>=3.0.0",
39+
]
40+
41+
[project.scripts]
42+
release-automation = "stackbrew_generator.cli:app"
43+
44+
[project.urls]
45+
Homepage = "https://github.com/redis/docker-library-redis"
46+
Repository = "https://github.com/redis/docker-library-redis"
47+
Issues = "https://github.com/redis/docker-library-redis/issues"
48+
49+
[tool.hatch.build.targets.wheel]
50+
packages = ["src/stackbrew_generator"]
51+
52+
[tool.hatch.build.targets.sdist]
53+
include = [
54+
"/src",
55+
"/README.md",
56+
"/pyproject.toml",
57+
]
58+
59+
[tool.black]
60+
line-length = 88
61+
target-version = ['py38']
62+
include = '\.pyi?$'
63+
64+
[tool.isort]
65+
profile = "black"
66+
multi_line_output = 3
67+
68+
[tool.mypy]
69+
python_version = "3.8"
70+
warn_return_any = true
71+
warn_unused_configs = true
72+
disallow_untyped_defs = true
73+
74+
[tool.pytest.ini_options]
75+
testpaths = ["tests"]
76+
python_files = ["test_*.py", "*_test.py"]
77+
python_classes = ["Test*"]
78+
python_functions = ["test_*"]
79+
addopts = [
80+
"--strict-markers",
81+
"--strict-config",
82+
"--cov=stackbrew_generator",
83+
"--cov-report=term-missing",
84+
"--cov-report=html",
85+
"--cov-report=xml",
86+
]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Stackbrew Library Generator for Redis Docker Images."""
2+
3+
__version__ = "0.1.0"

0 commit comments

Comments
 (0)