Skip to content

Commit

Permalink
feat: Redis Watcher implemented based on Lettuce (#1)
Browse files Browse the repository at this point in the history
* [NEW] Added maven-ci.yml
[NEW] Added WatcherConstant.java
[NEW] Added LettuceRedisWatcher.java
[NEW] Added LettuceSubscriber.java
[NEW] Added LettuceSubThread.java
[NEW] Added LettuceRedisWatcherTest.java
[UPDATE] Updated .gitignore
[NEW] Added .releaserc.json
[NEW] Added maven-settings.xml
[NEW] Added pom.xml
[UPDATE] Updated README.md

* Refactor LettuceRedisWatcherTest.java to use local IP address instead of remote IP address for testing.
  • Loading branch information
ShingmoYeung authored Aug 7, 2023
1 parent c94cb71 commit 178bebf
Show file tree
Hide file tree
Showing 11 changed files with 809 additions and 1 deletion.
59 changes: 59 additions & 0 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6378:6378

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: '0'

- name: Set up Redis with password
uses: getong/redis-action@v1
with:
redis version: 'latest'
host port: 6379
container port: 6379
redis password: 'foobared'

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Build with Maven
run: mvn clean test cobertura:cobertura

- name: Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16

- name: Sematic Release
run: |
npm install -g @conveyal/maven-semantic-release semantic-release
semantic-release --prepare @conveyal/maven-semantic-release --publish @semantic-release/github,@conveyal/maven-semantic-release --verify-conditions @semantic-release/github,@conveyal/maven-semantic-release --verify-release @conveyal/maven-semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
*.zip
*.tar.gz
*.rar
*.iml

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

.idea
target/
out/
17 changes: 17 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"debug": true,
"dryRun": false,
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"master",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
}
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
# lettuce-redis-watcher
# lettuce-redis-watcher
---

[![GitHub Actions](https://github.com/jcasbin/lettuce-redis-watcher/actions/workflows/maven-ci.yml/badge.svg)](https://github.com/jcasbin/lettuce-redis-watcher/actions/workflows/maven-ci.yml)
![License](https://img.shields.io/github/license/jcasbin/lettuce-redis-watcher)
[![Javadoc](https://javadoc.io/badge2/org.casbin/jcasbin-lettuce-redis-watcher/javadoc.svg)](https://javadoc.io/doc/org.casbin/jcasbin-lettuce-redis-watcher)
[![codecov](https://codecov.io/gh/jcasbin/lettuce-redis-watcher/branch/master/graph/badge.svg?token=ENt9xr4nFg)](https://codecov.io/gh/jcasbin/lettuce-redis-watcher)
[![codebeat badge](https://codebeat.co/badges/8b3da1c4-3a61-4123-a3d4-002b2598a297)](https://codebeat.co/projects/github-com-jcasbin-lettuce-redis-watcher-master)
[![Maven Central](https://img.shields.io/maven-central/v/org.casbin/jcasbin-lettuce-redis-watcher.svg)](https://mvnrepository.com/artifact/org.casbin/jcasbin-lettuce-redis-watcher/latest)
[![Release](https://img.shields.io/github/release/jcasbin/lettuce-redis-watcher.svg)](https://github.com/jcasbin/lettuce-redis-watcher/releases/latest)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/casbin/lobby)

---
[![Security Status](https://www.murphysec.com/platform3/v31/badge/1688427475171692544.svg)](https://www.murphysec.com/console/report/1688411419949424640/1688427475171692544)


Lettuce Redis Watcher is a [Redis](http://redis.io) watcher for [jCasbin](https://github.com/casbin/jcasbin).

## Getting Help

- [jCasbin](https://github.com/casbin/jCasbin)
- [Lettuce](https://lettuce.io)

## License

This project is under Apache 2.0 License. See the [LICENSE](https://github.com/jcasbin/lettuce-redis-watcher/blob/master/LICENSE) file for the full license text.
22 changes: 22 additions & 0 deletions maven-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<settings>
<servers>
<server>
<id>ossrh</id>
<username>${OSSRH_USERNAME}</username>
<password>${OSSRH_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${GPG_KEY_NAME}</gpg.keyname>
<gpg.passphrase>${GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
Loading

0 comments on commit 178bebf

Please sign in to comment.