diff --git a/README.md b/README.md index 0470345..38fd7f0 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ See [action.yml](action.yml) Basic: ```yaml steps: -- uses: vishnudxb/redis-cluster@1.0.4 +- uses: vishnudxb/redis-cluster@1.0.5 with: master1-port: 5000 master2-port: 5001 diff --git a/action.yml b/action.yml index f406c8d..2c39a7c 100644 --- a/action.yml +++ b/action.yml @@ -32,3 +32,10 @@ inputs: runs: using: 'docker' image: 'Dockerfile' + args: + - ${{ inputs.master1-port }} + - ${{ inputs.master2-port }} + - ${{ inputs.master3-port }} + - ${{ inputs.slave1-port }} + - ${{ inputs.slave2-port }} + - ${{ inputs.slave3-port }} diff --git a/entrypoint.sh b/entrypoint.sh index 4bcd253..757e406 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,15 @@ #!/bin/sh -docker_run="docker run -d -p $INPUT_MASTER1_PORT:6379 -p $INPUT_MASTER2_PORT:6380 -p $INPUT_MASTER3_PORT:6381 -p $INPUT_SLAVE1_PORT:6382 -p $INPUT_SLAVE2_PORT:6383 -p $INPUT_SLAVE3_PORT:6384 --name redis-cluster vishnunair/docker-redis-cluster:latest" +set -e + +MASTER1_PORT=$1 +MASTER2_PORT=$2 +MASTER3_PORT=$3 +SLAVE1_PORT=$4 +SLAVE2_PORT=$5 +SLAVE3_PORT=$6 + + +docker_run="docker run -d -p ${MASTER1_PORT}:6379 -p ${MASTER2_PORT}:6380 -p ${MASTER3_PORT}:6381 -p ${SLAVE1_PORT}:6382 -p ${SLAVE2_PORT}:6383 -p ${SLAVE3_PORT}:6384 --name redis-cluster vishnunair/docker-redis-cluster:latest" sh -c "$docker_run"