Skip to content

Commit d5a8e12

Browse files
committed
Set protected mode to no in all images. Add new released version. Added new invoke task list-releases to help quicker identify new redis releases on github. Added dev-requirements.txt file to easier handle invoke script
1 parent b188976 commit d5a8e12

7 files changed

+49
-13
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ env:
99
# - REDIS_VERSION=3.2.13
1010
# - REDIS_VERSION=4.0.14
1111
# - REDIS_VERSION=5.0.12
12-
- REDIS_VERSION=6.0.17
13-
- REDIS_VERSION=6.2.9
14-
- REDIS_VERSION=7.0.8
12+
- REDIS_VERSION=6.0.18
13+
- REDIS_VERSION=6.2.11
14+
- REDIS_VERSION=7.0.10
1515
script:
1616
docker build --build-arg redis_version=$REDIS_VERSION -t grokzen/redis-cluster .

README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -84,30 +84,31 @@ docker run -e "IP=0.0.0.0" -p 7000-7005:7000-7005 grokzen/redis-cluster:latest
8484

8585
# Usage
8686

87-
This git repo is using `pyinvoke` to pull, build, push docker images. You can use it to build your own images if you like.
87+
This git repo is using `invoke` to pull, build, push docker images. You can use it to build your own images if you like.
8888

8989
The invoke scripts in this repo is written only for python 3.7 and above
9090

91-
Install `pyinvoke` with `pip install invoke`.
91+
Install `invoke` with `pip install invoke`.
9292

9393
This script will run `N num of cpu - 1` parralell tasks based on your version input.
9494

9595
To see available commands run `invoke -l` in the root folder of this repo. Example
9696

9797
```
98-
(tmp-615229a94c330b9) ➜ docker-redis-cluster git:(pyinvoke) ✗ invoke -l
98+
(tmp-615229a94c330b9) ➜ docker-redis-cluster git:(invoke) ✗ invoke -l
9999
"Configured multiprocess pool size: 3
100100
Available tasks:
101101
102102
build
103+
list
103104
pull
104105
push
105106
```
106107

107108
Each command is only taking one required positional argument `version`. Example:
108109

109110
```
110-
(tmp-615229a94c330b9) ➜ docker-redis-cluster git:(pyinvoke) ✗ invoke build 6.0
111+
(tmp-615229a94c330b9) ➜ docker-redis-cluster git:(invoke) ✗ invoke build 7.0
111112
...
112113
```
113114

@@ -228,10 +229,12 @@ The following tags with pre-built images is available on `docker-hub`.
228229

229230
Latest release in the most recent stable branch will be used as `latest` version.
230231

231-
- latest == 7.0.8
232+
- latest == 7.0.10
232233

233234
Redis 7.0.x version:
234235

236+
- 7.0.10
237+
- 7.0.9
235238
- 7.0.8
236239
- 7.0.7
237240
- 7.0.6
@@ -244,6 +247,7 @@ Redis 7.0.x version:
244247

245248
Redis 6.2.x versions:
246249

250+
- 6.2.11
247251
- 6.2.10
248252
- 6.2.9
249253
- 6.2.8
@@ -258,6 +262,7 @@ Redis 6.2.x versions:
258262

259263
Redis 6.0.x versions:
260264

265+
- 6.0.18
261266
- 6.0.17
262267
- 6.0.16
263268
- 6.0.15

dev-requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
invoke>=2.0.0
2+
requests>=2.28.2

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
build:
99
context: .
1010
args:
11-
redis_version: '7.0.8'
11+
redis_version: '7.0.10'
1212
hostname: server
1313
ports:
1414
- '7000-7050:7000-7050'

redis-cluster.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ cluster-config-file nodes.conf
55
cluster-node-timeout 5000
66
appendonly yes
77
dir /redis-data/${PORT}
8+
protected-mode no

redis.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ bind ${BIND_ADDRESS}
22
port ${PORT}
33
appendonly yes
44
dir /redis-data/${PORT}
5+
protected-mode no

tasks.py

+31-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import multiprocessing
2+
import requests
3+
24
from multiprocessing import Pool
35
from invoke import task
46

57

6-
latest_version_string = "7.0.8"
8+
latest_version_string = "7.0.10"
79

810
# Unpublished versions
911
version_config_mapping = []
@@ -13,9 +15,9 @@
1315
version_config_mapping += [f"5.0.{i}" for i in range(0, 13)]
1416

1517
# Published versions
16-
version_config_mapping += [f"6.0.{i}" for i in range(0, 18)]
17-
version_config_mapping += [f"6.2.{i}" for i in range(0, 11)]
18-
version_config_mapping += [f"7.0.{i}" for i in range(0, 9)]
18+
version_config_mapping += [f"6.0.{i}" for i in range(0, 19)]
19+
version_config_mapping += [f"6.2.{i}" for i in range(0, 12)]
20+
version_config_mapping += [f"7.0.{i}" for i in range(0, 11)]
1921

2022

2123
def version_name_to_version(version):
@@ -130,3 +132,28 @@ def push(c, version, cpu=None):
130132
def list(c):
131133
from pprint import pprint
132134
pprint(version_config_mapping, indent=2)
135+
136+
137+
@task
138+
def list_releases(c):
139+
releases = []
140+
141+
for page in range(1, 5):
142+
data = requests.get("https://api.github.com/repos/redis/redis/releases", params={"page": int(page)})
143+
144+
if data.status_code == 200:
145+
for release in data.json():
146+
r = release["name"]
147+
148+
if "rc" in r or r.startswith("5"):
149+
pass
150+
else:
151+
releases.append(r)
152+
else:
153+
print("Error, stopping")
154+
155+
for released_version in releases:
156+
if released_version in version_config_mapping:
157+
print(f"Release found - {released_version}")
158+
else:
159+
print(f"NOT found - {released_version}")

0 commit comments

Comments
 (0)