mirror of
https://github.com/davegallant/rfd-notify.git
synced 2025-08-13 03:30:20 +00:00
Compare commits
2 Commits
7b17831900
...
12e2b39dcd
Author | SHA1 | Date | |
---|---|---|---|
|
12e2b39dcd | ||
|
e60fcf2a53 |
81
README.md
81
README.md
@@ -28,8 +28,8 @@ poetry run python rfd_notify/cli.py -c examples/config.yml
|
|||||||
|
|
||||||
The following environment variables are required:
|
The following environment variables are required:
|
||||||
|
|
||||||
| VARIABLE | DESCRIPTION |
|
| VARIABLE | DESCRIPTION |
|
||||||
| ----------- | ---------------------------------------------------------------- |
|
| ----------- | ---------------------------------------------------------------------------------------- |
|
||||||
| APPRISE_URL | See [notifications](https://github.com/caronc/apprise#productivity-based-notifications). |
|
| APPRISE_URL | See [notifications](https://github.com/caronc/apprise#productivity-based-notifications). |
|
||||||
|
|
||||||
## Example Configuration
|
## Example Configuration
|
||||||
@@ -44,7 +44,7 @@ expressions:
|
|||||||
- price error
|
- price error
|
||||||
```
|
```
|
||||||
|
|
||||||
## Github Actions
|
## Github Actions (and Gitea Actions)
|
||||||
|
|
||||||
> Commiting the pickled data (previous_matches) back into the repository is a bit of a hack, but allows for a simpler setup.
|
> Commiting the pickled data (previous_matches) back into the repository is a bit of a hack, but allows for a simpler setup.
|
||||||
|
|
||||||
@@ -57,34 +57,24 @@ It also requires the corresponding [encrypted secrets](https://docs.github.com/e
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "*5 * * * *"
|
- cron: "*/5 * * * *"
|
||||||
jobs:
|
jobs:
|
||||||
rfd_notify:
|
rfd_notify:
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: rfd-notify
|
name: rfd-notify
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
sparse-checkout: |
|
||||||
|
config.yml
|
||||||
- name: Run rfd-notify
|
previous_matches
|
||||||
uses: davegallant/rfd-notify@main
|
- name: Commit and push changes
|
||||||
env:
|
|
||||||
APPRISE_URL: ${{ secrets.APPRISE_URL }}
|
|
||||||
|
|
||||||
- name: Commit files
|
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "action@github.com"
|
git config --local user.email "bot@gitea.snake-cloud.ts.net"
|
||||||
git config --local user.name "RFD Notify"
|
git config --local user.name "RFD Notify"
|
||||||
git add previous_matches
|
git add previous_matches
|
||||||
git commit -m "Update previous_matches" -a || true
|
git commit -m "Update previous_matches" -a || true
|
||||||
|
git push
|
||||||
- name: Push changes
|
|
||||||
uses: ad-m/github-push-action@master
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
branch: ${{ github.ref }}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Gitlab Pipelines
|
## Gitlab Pipelines
|
||||||
@@ -107,53 +97,4 @@ run:
|
|||||||
- previous_matches
|
- previous_matches
|
||||||
script:
|
script:
|
||||||
- python /app/rfd_notify/cli.py -c config.yml
|
- python /app/rfd_notify/cli.py -c config.yml
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
## Jenkins
|
|
||||||
|
|
||||||
> The necessary Jenkins plugins (such as docker) and credentials must be configured.
|
|
||||||
|
|
||||||
Using a declarative pipeline, run the build every minute, and store the previous matches in the workspace:
|
|
||||||
|
|
||||||
```groovy
|
|
||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
|
|
||||||
triggers {
|
|
||||||
cron('* * * * *')
|
|
||||||
}
|
|
||||||
|
|
||||||
options {
|
|
||||||
buildDiscarder(
|
|
||||||
logRotator(
|
|
||||||
numToKeepStr: '25',
|
|
||||||
artifactNumToKeepStr: '25'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
disableConcurrentBuilds()
|
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
|
||||||
stage('Run rfd-notify') {
|
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'ghcr.io/davegallant/rfd-notify:1'
|
|
||||||
args '--entrypoint='
|
|
||||||
reuseNode true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
withCredentials([string(credentialsId: 'apprise-url', variable: 'APPRISE_URL')]) {
|
|
||||||
sh 'python /app/rfd_notify/cli.py -c config.yml'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Archive previous_matches') {
|
|
||||||
steps {
|
|
||||||
archiveArtifacts artifacts: 'previous_matches'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user