Skip to content

Commit 3adf431

Browse files
committed
add container name option
1 parent 648214f commit 3adf431

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ inputs:
1414
description: 'Redis port to use and expose'
1515
required: false
1616
default: 6379
17+
redis-container-name:
18+
description: "Name of the created container. Useful if you run multiple Redis containers"
19+
required: false
20+
default: 'redis'
1721

1822
runs:
1923
using: 'docker'
2024
image: 'Dockerfile'
2125
args:
2226
- ${{ inputs.redis-version }}
2327
- ${{ inputs.redis-port }}
28+
- ${{ inputs.redis-container-name }}

start-redis.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
REDIS_VERSION=$1
44
REDIS_PORT=$2
5+
REDIS_CONTAINER_NAME=$3
56

67
if [ -z "$REDIS_VERSION" ]; then
78
echo "Missing Redis version in the [redis-version] input. Received value: $REDIS_VERSION"
@@ -10,4 +11,4 @@ if [ -z "$REDIS_VERSION" ]; then
1011
fi
1112

1213
echo "Starting single-node Redis instance"
13-
docker run --name redis --publish $REDIS_PORT:6379 --detach redis:$REDIS_VERSION
14+
docker run --name $REDIS_CONTAINER_NAME --publish $REDIS_PORT:6379 --detach redis:$REDIS_VERSION

0 commit comments

Comments
 (0)