-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
74 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Zhulik | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,26 @@ | ||
# redis-cluster | ||
Github action for running a redis cluster for your workflow | ||
# Redis Cluster GitHub Action | ||
|
||
This [GitHub Action](https://github.com/features/actions) sets up Redis cluster with 3 master and 3 slave in a single container for your testing purpose. | ||
|
||
The image used is from https://github.com/vishnudxb/docker-redis-cluster | ||
|
||
# Usage | ||
|
||
See [action.yml](action.yml) | ||
|
||
Basic: | ||
```yaml | ||
steps: | ||
- uses: vishnudxb/redis-cluster@1.0.0 | ||
with: | ||
master1-port: '5000' | ||
master2-port: '5001' | ||
master3-port: '5002' | ||
slave1-port: '5003' | ||
slave2-port: '5003' | ||
slave3-port: '5004' | ||
``` | ||
# License | ||
The scripts and documentation in this project are released under the [MIT License](LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
# action.yml | ||
name: 'Hello World' | ||
description: 'Greet someone and record the time' | ||
name: 'Redis Cluster with Master-Slave' | ||
description: 'Setup Redis cluster with 3 master and 3 slave in a single container' | ||
author: 'Vishnu Nair' | ||
branding: | ||
icon: 'database' | ||
color: 'red' | ||
inputs: | ||
who-to-greet: # id of input | ||
description: 'Who to greet' | ||
master1-port: | ||
description: 'Port number for master1' | ||
required: true | ||
master2-port: | ||
description: 'Port number for master2' | ||
required: true | ||
master3-port: | ||
description: 'Port number for master3' | ||
required: true | ||
slave1-port: | ||
description: 'Port number for slave1' | ||
required: true | ||
slave2-port: | ||
description: 'Port number for slave2' | ||
required: true | ||
slave3-port: | ||
description: 'Port number for slave3' | ||
required: true | ||
default: 'World' | ||
outputs: | ||
time: # id of output | ||
description: 'The time we greeted you' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.who-to-greet }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh -l | ||
#!/bin/sh | ||
|
||
echo "Hello $1" | ||
time=$(date) | ||
echo "::set-output name=time::$time" | ||
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" | ||
|
||
sh -c "$docker_run" |