Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit f2740a0

Browse files
authored
Merge pull request #70 from jdeathe/centos-7-redis40u-develop
Release changes for 4.1.1
2 parents 17621ab + f855cbc commit f2740a0

File tree

14 files changed

+163
-109
lines changed

14 files changed

+163
-109
lines changed

.dockerignore

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
.env
2-
.env.example
3-
.git
4-
.gitignore
5-
dist
6-
test
7-
docker-compose.yml
8-
LICENSE
9-
README-short.txt
10-
*.md
1+
/.env
2+
/.env.example
3+
/.git
4+
/.gitignore
5+
/dist
6+
/docs
7+
/test
8+
/docker-compose.yml
9+
/LICENSE
10+
/README-short.txt
11+
/*.md
1112
!README.md
1213
**/*.mk
13-
**/Makefile
14+
**/Makefile

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.env
2-
dist
1+
/.env
2+
/dist

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@
44

55
Summary of release changes.
66

7+
### 4.1.1 - 2019-09-28
8+
9+
- Deprecate Makefile target `logs-delayed`; replaced with `logsdef`.
10+
- Updates source image to [2.6.1](https://github.com/jdeathe/centos-ssh/releases/tag/2.6.1).
11+
- Updates `redis40u` packages to 4.0.14-2.
12+
- Updates `test/health_status` helper script with for consistency.
13+
- Updates Makefile target `logs` to accept `[OPTIONS]` (e.g `make -- logs -ft`).
14+
- Updates info/error output for consistency.
15+
- Updates healthcheck failure messages to remove EOL character that is rendered in status response.
16+
- Updates ordering of Tags and respective Dockerfile links in README.md for readability.
17+
- Adds improved test workflow; added `test-setup` target to Makefile.
18+
- Adds Makefile target `logsdef` to handle deferred logs output within a target chain.
19+
- Adds exec proxy function to `redis-server-wrapper` used to pass through nice.
20+
- Adds `/docs` directory for supplementary documentation.
21+
- Fixes validation failure of 0 second --timeout value in `test/health_status`.
22+
- Removes `ENABLE_REDIS_BOOTSTRAP` from docker-compose example configuration.
23+
- Removes `ENABLE_REDIS_WRAPPER` from docker-compose example configuration.
24+
725
### 4.1.0 - 2019-06-29
826

927
- Updates source image to [2.6.0](https://github.com/jdeathe/centos-ssh/releases/tag/2.6.0).

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
FROM jdeathe/centos-ssh:2.6.0
1+
FROM jdeathe/centos-ssh:2.6.1
22

3-
ARG RELEASE_VERSION="4.1.0"
3+
ARG RELEASE_VERSION="4.1.1"
44

55
# ------------------------------------------------------------------------------
66
# Base install of required packages
77
# ------------------------------------------------------------------------------
88
RUN yum -y install \
99
--setopt=tsflags=nodocs \
1010
--disableplugin=fastestmirror \
11-
redis40u-4.0.14-1.ius.el7 \
11+
redis40u-4.0.14-2.el7.ius \
1212
&& yum versionlock add \
1313
redis40u* \
1414
&& yum clean all

Makefile

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ Targets:
2525
images Show container's image details.
2626
load Loads from the distribution package. Requires
2727
DOCKER_IMAGE_TAG variable.
28-
logs Display log output from the running container.
29-
logs-delayed Display log output from the running container after
30-
backing off for STARTUP_TIME seconds. This can be
31-
necessary when chaining make targets together.
28+
logs [OPTIONS] Display log output from the container.
29+
logsdef Display log output from the container deferred for
30+
STARTUP_TIME seconds. This will work in a chain
31+
unlike the logs target.
32+
logs-delayed [DEPRECATED] Replaced with logsdef.
3233
pause Pause the running container.
3334
pull Pull the release image from the registry. Requires
3435
the DOCKER_IMAGE_TAG variable.
@@ -45,6 +46,7 @@ Targets:
4546
stop Stop the container when in a running state.
4647
terminate Unpause, stop and remove the container.
4748
test Run all test cases.
49+
test-setup Install test dependencies.
4850
top [ps OPTIONS] Display the running processes of the container.
4951
unpause Unpause the container when in a paused state.
5052

@@ -161,6 +163,7 @@ endef
161163
_require-docker-image-tag \
162164
_require-docker-release-tag \
163165
_require-package-path \
166+
_require-root \
164167
_test-prerequisites \
165168
_usage \
166169
all \
@@ -176,6 +179,7 @@ endef
176179
images \
177180
load \
178181
logs \
182+
logsdef \
179183
logs-delayed \
180184
pause \
181185
pull \
@@ -191,6 +195,7 @@ endef
191195
stop \
192196
terminate \
193197
test \
198+
test-setup \
194199
top \
195200
unpause
196201

@@ -365,9 +370,17 @@ _require-package-path:
365370
exit 1; \
366371
fi
367372

373+
_require-root:
374+
@ if [[ $${EUID} -ne 0 ]]; \
375+
then \
376+
>&2 printf -- '%sMust be run as root\n' \
377+
"$(PREFIX_STEP_NEGATIVE)"; \
378+
exit 1; \
379+
fi
380+
368381
_test-prerequisites:
369382
ifeq ($(shpec),)
370-
$(error "Please install shpec.")
383+
$(error "Please install shpec. Try: DOCKER_NAME=$(DOCKER_NAME) make test-setup")
371384
endif
372385

373386
_usage:
@@ -581,14 +594,20 @@ install: | \
581594
logs: \
582595
_prerequisites \
583596
_require-docker-container
584-
@ $(docker) logs $(DOCKER_NAME)
597+
@ $(docker) logs \
598+
$(filter-out $@, $(MAKECMDGOALS)) \
599+
$(DOCKER_NAME)
600+
%:; @:
585601

586-
logs-delayed: \
602+
logsdef: \
587603
_prerequisites \
588604
_require-docker-container
589605
@ sleep $(STARTUP_TIME)
590606
@ $(MAKE) logs
591607

608+
logs-delayed: \
609+
logsdef
610+
592611
load: \
593612
_prerequisites \
594613
_require-docker-release-tag \
@@ -980,6 +999,18 @@ test: \
980999
"Functional test"
9811000
@ SHPEC_ROOT=$(SHPEC_ROOT) $(shpec)
9821001

1002+
test-setup: \
1003+
_require-root
1004+
@ printf -- '%s%s\n' \
1005+
"$(PREFIX_STEP)" \
1006+
"Installing shpec"
1007+
@ bash -c "$$(curl -LSs \
1008+
https://raw.githubusercontent.com/rylnd/shpec/master/install.sh \
1009+
)"
1010+
@ ln -sf \
1011+
/usr/local/bin/shpec \
1012+
/usr/bin/shpec
1013+
9831014
unpause: \
9841015
_prerequisites \
9851016
_require-docker-container \

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
## Tags and respective `Dockerfile` links
22

3-
- `centos-7-redis40u`,[`4.1.0`](https://github.com/jdeathe/centos-ssh-redis/tree/4.1.0) [(centos-7-redis40u/Dockerfile)](https://github.com/jdeathe/centos-ssh-redis/blob/centos-7-redis40u/Dockerfile)
4-
- `centos-7`,[`3.1.0`](https://github.com/jdeathe/centos-ssh-redis/tree/3.1.0) [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh-redis/blob/centos-7/Dockerfile)
5-
- `centos-6`,[`1.2.0`](https://github.com/jdeathe/centos-ssh-redis/tree/1.2.0) [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-redis/blob/centos-6/Dockerfile)
3+
- [`4.1.1`](https://github.com/jdeathe/centos-ssh-redis/tree/4.1.1),`centos-7-redis40u` [(centos-7-redis40u/Dockerfile)](https://github.com/jdeathe/centos-ssh-redis/blob/centos-7-redis40u/Dockerfile)
4+
- [`3.1.1`](https://github.com/jdeathe/centos-ssh-redis/tree/3.1.1),`centos-7` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh-redis/blob/centos-7/Dockerfile)
5+
- [`1.2.1`](https://github.com/jdeathe/centos-ssh-redis/tree/1.2.1),`centos-6` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-redis/blob/centos-6/Dockerfile)
66

77
## Overview
88

@@ -25,14 +25,14 @@ $ docker run -d \
2525
--name redis.1 \
2626
-p 6379:6379/tcp \
2727
--sysctl "net.core.somaxconn=1024" \
28-
jdeathe/centos-ssh-redis:4.1.0
28+
jdeathe/centos-ssh-redis:4.1.1
2929
```
3030

3131
Verify the named container's process status and health.
3232

3333
```
3434
$ docker ps -a \
35-
-f "name=redis.1"
35+
-f "name=redis.1"
3636
```
3737

3838
Verify successful initialisation of the named container.
@@ -63,7 +63,7 @@ In the following example the redis-server service is bound to port 6379 of the d
6363

6464
```
6565
$ docker stop redis.1 && \
66-
docker rm redis.1 && \
66+
docker rm redis.1; \
6767
docker run \
6868
--detach \
6969
--name redis.1 \
@@ -76,10 +76,10 @@ $ docker stop redis.1 && \
7676
--env "REDIS_MAXMEMORY_SAMPLES=10" \
7777
--env "REDIS_OPTIONS=--loglevel verbose" \
7878
--env "REDIS_TCP_BACKLOG=2048" \
79-
jdeathe/centos-ssh-redis:4.1.0
79+
jdeathe/centos-ssh-redis:4.1.1
8080
```
8181

82-
#### Environment Variables
82+
#### Environment variables
8383

8484
Environment variables are available, as detailed below, to allow the operator to configure a container on run. Environment variable values cannot be changed after running the container; it's a one-shot type setting. If you need to change a value you have to terminate, (i.e stop and remove), and replace the running container.
8585

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ services:
2222
context: "."
2323
dockerfile: "Dockerfile"
2424
environment:
25-
ENABLE_REDIS_BOOTSTRAP: "true"
26-
ENABLE_REDIS_WRAPPER: "true"
2725
REDIS_MAXMEMORY: "${REDIS_MAXMEMORY}"
2826
REDIS_MAXMEMORY_POLICY: "${REDIS_MAXMEMORY_POLICY}"
2927
REDIS_MAXMEMORY_SAMPLES: "${REDIS_MAXMEMORY_SAMPLES}"

docs/testing.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Testing
2+
3+
## Functional
4+
5+
The functional test cases are written in [shpec](https://github.com/rylnd/shpec).
6+
7+
To run the tests use the `test` Makefile target after building.
8+
9+
> *Note:* You might need to run via sudo if your environment requires root privileges to run docker.
10+
11+
```
12+
$ make build test
13+
```

src/etc/supervisord.d/20-redis-server-bootstrap.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ autorestart = false
33
autostart = %(ENV_ENABLE_REDIS_BOOTSTRAP)s
44
command = /usr/sbin/redis-server-bootstrap --verbose
55
priority = 20
6-
startsecs = 0
76
startretries = 0
7+
startsecs = 0
88
stderr_logfile = /dev/stderr
99
stderr_logfile_maxbytes = 0
1010
stdout_logfile = /dev/stdout

src/usr/bin/healthcheck

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ function main ()
4646
if ! ps axo command | grep -qE '^/usr/bin/python /usr/bin/supervisord'
4747
then
4848
>&2 printf -- \
49-
'%s\n' \
50-
"supervisord not running."
49+
'%s' \
50+
"supervisord not running"
5151
exit 1
5252
fi
5353

5454
if [[ ${system_timezone} != "${zone}" ]]
5555
then
5656
>&2 printf -- \
57-
'%s\n' \
58-
"system-timezone zone mismatch."
57+
'%s' \
58+
"system-timezone zone mismatch"
5959
exit 1
6060
fi
6161

@@ -69,16 +69,16 @@ function main ()
6969
if ! ps axo command | grep -qE '^/usr/bin/redis-server'
7070
then
7171
>&2 printf -- \
72-
'%s\n' \
73-
"redis-server not running."
72+
'%s' \
73+
"redis-server not running"
7474
exit 1
7575
fi
7676

7777
if ! redis-cli PING | grep -qE '^PONG$'
7878
then
7979
>&2 printf -- \
80-
'%s\n' \
81-
"redis-server not responding."
80+
'%s' \
81+
"redis-server not responding"
8282
exit 1
8383
fi
8484
}

0 commit comments

Comments
 (0)