chore(misc): add eslint-plugin-yml, npm cache (#8599)

This commit is contained in:
Tony
2021-11-27 16:42:37 -07:00
committed by GitHub
parent 6e810ade86
commit 74db039ae2
19 changed files with 333 additions and 234 deletions

View File

@@ -37,3 +37,6 @@ trim_trailing_whitespace = false
# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_size = 2
[{**.yml,**.yaml}]
indent_size = 2

View File

@@ -1,2 +1,4 @@
coverage
.vscode
docker-compose.yml
!/.github

View File

@@ -1,5 +1,5 @@
{
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"extends": ["eslint:recommended", "plugin:prettier/recommended", "plugin:yml/recommended"],
"plugins": ["prettier"],
"parserOptions": {
"ecmaVersion": 2020,
@@ -66,6 +66,12 @@
"no-new-func": 2,
"require-await": 2,
"prefer-arrow-callback": 2,
"object-shorthand": 2
"object-shorthand": 2,
"yml/quotes": [
"error",
{
"prefer": "single"
}
]
}
}

2
.github/FUNDING.yml vendored
View File

@@ -1,4 +1,4 @@
# These are supported funding model platforms
github: DIYgod
patreon: DIYgod
custom: ["https://afdian.net/@diygod", "https://diygod.me/images/zfb.jpg", "https://diygod.me/images/wx.jpg"]
custom: ['https://afdian.net/@diygod', 'https://diygod.me/images/zfb.jpg', 'https://diygod.me/images/wx.jpg']

108
.github/dependabot.yml vendored
View File

@@ -1,51 +1,61 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "21:00"
open-pull-requests-limit: 10
reviewers:
- DIYgod
labels:
- dependencies
ignore:
- dependency-name: cheerio
versions:
- "> 1.0.0-rc.5"
- dependency-name: remark
versions:
- "> 12.0.1"
- dependency-name: remark
versions:
- "> 13.0.0, < 13.1"
- dependency-name: remark-frontmatter
versions:
- "> 2.0.0"
- dependency-name: remark-frontmatter
versions:
- ">= 3.0.a, < 3.1"
- dependency-name: "@sentry/node"
versions:
- 6.0.4
- 6.2.3
- 6.3.1
- dependency-name: eslint
versions:
- 7.24.0
- dependency-name: ioredis
versions:
- 4.24.1
- dependency-name: string-width
versions:
- 4.2.1
- dependency-name: nock
versions:
- 13.0.8
- dependency-name: googleapis
versions:
- 67.1.0
- dependency-name: rss-parser
versions:
- 3.11.0
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
time: '21:00'
open-pull-requests-limit: 10
reviewers:
- DIYgod
labels:
- dependencies
ignore:
- dependency-name: cheerio
versions:
- '> 1.0.0-rc.5'
- dependency-name: remark
versions:
- '> 12.0.1'
- dependency-name: remark
versions:
- '> 13.0.0, < 13.1'
- dependency-name: remark-frontmatter
versions:
- '> 2.0.0'
- dependency-name: remark-frontmatter
versions:
- '>= 3.0.a, < 3.1'
- dependency-name: '@sentry/node'
versions:
- 6.0.4
- 6.2.3
- 6.3.1
- dependency-name: eslint
versions:
- 7.24.0
- dependency-name: ioredis
versions:
- 4.24.1
- dependency-name: string-width
versions:
- 4.2.1
- dependency-name: nock
versions:
- 13.0.8
- dependency-name: googleapis
versions:
- 67.1.0
- dependency-name: rss-parser
versions:
- 3.11.0
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: daily
time: '21:00'
open-pull-requests-limit: 10
reviewers:
- DIYgod
labels:
- dependencies

View File

@@ -20,13 +20,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: build file
run: npm ci && npm run build:all
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./assets
publish_dir: ./assets

View File

@@ -12,4 +12,4 @@ jobs:
uses: ben-z/actions-comment-on-issue@1.0.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: "👍 感谢提交该 Issue请确保仔细阅读 [Issue 模板](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/bug_report_zh.md)[RSS 提案模板](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/rss_request_zh.md) 或 [Feature 提案模板](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/feature_request_zh.md) 以便于测试。不符合模板将导致 Issue 被直接关闭。<br /><br />👍 Thanks for the issue, please follow the [Issue template](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/bug_report_en.md), [RSS proposal template](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/rss_request_zh.md) or [Feature proposal template](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/feature_request_en.md). Otherwise the issue will be closed."
message: '👍 感谢提交该 Issue请确保仔细阅读 [Issue 模板](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/bug_report_zh.md)[RSS 提案模板](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/rss_request_zh.md) 或 [Feature 提案模板](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/feature_request_zh.md) 以便于测试。不符合模板将导致 Issue 被直接关闭。<br /><br />👍 Thanks for the issue, please follow the [Issue template](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/bug_report_en.md), [RSS proposal template](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/rss_request_zh.md) or [Feature proposal template](https://github.com/DIYgod/RSSHub/blob/master/.github/ISSUE_TEMPLATE/feature_request_en.md). Otherwise the issue will be closed.'

View File

@@ -1,41 +1,40 @@
name: '[docker] CI for releases'
on:
push:
branches: master
paths:
- 'lib/**'
- '.github/workflows/**'
- 'Dockerfile'
- 'package.json'
push:
branches:
- master
paths:
- 'lib/**'
- '.github/workflows/**'
- 'Dockerfile'
- 'package.json'
jobs:
release:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build dockerfile (with push)
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
docker buildx build \
--platform=linux/amd64,linux/arm/v7,linux/arm64 \
--output "type=image,push=true" \
--file ./Dockerfile . \
--tag $(echo "${DOCKER_USERNAME}" | tr '[:upper:]' '[:lower:]')/rsshub:latest \
--tag $(echo "${DOCKER_USERNAME}" | tr '[:upper:]' '[:lower:]')/rsshub:$(date +%Y)-$(date +%m)-$(date +%d)
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build dockerfile (with push)
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
docker buildx build \
--platform=linux/amd64,linux/arm/v7,linux/arm64 \
--output "type=image,push=true" \
--file ./Dockerfile . \
--tag $(echo "${DOCKER_USERNAME}" | tr '[:upper:]' '[:lower:]')/rsshub:latest \
--tag $(echo "${DOCKER_USERNAME}" | tr '[:upper:]' '[:lower:]')/rsshub:$(date +%Y)-$(date +%m)-$(date +%d)

View File

@@ -1,27 +1,29 @@
name: '[docker] CI for build tests'
on:
pull_request:
branches: master
paths:
- 'lib/**'
- 'Dockerfile'
- 'package.json'
# Please, always create a pull request instead of push to master.
pull_request:
branches:
- master
paths:
- 'lib/**'
- 'Dockerfile'
- 'package.json'
# Please, always create a pull request instead of push to master.
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build dockerfile and Run (without push)
run: |
docker build \
--tag rsshub:latest \
--file ./Dockerfile .
chmod +x scripts/docker/test-docker.sh
scripts/docker/test-docker.sh
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build dockerfile and Run (without push)
run: |
docker build \
--tag rsshub:latest \
--file ./Dockerfile .
chmod +x scripts/docker/test-docker.sh
scripts/docker/test-docker.sh

View File

@@ -2,24 +2,24 @@ name: format
on:
push:
branches: master
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
- run: yarn install
- run: npm run format
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git status
git diff-index --quiet HEAD || (git commit -m "style: auto format" -a --no-verify && git push "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:master)
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
- run: yarn install
- run: npm run format
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git status
git diff-index --quiet HEAD || (git commit -m "style: auto format" -a --no-verify && git push "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:master)

View File

@@ -2,27 +2,28 @@ name: publish
on:
push:
branches: master
branches:
- master
paths:
- 'lib/**'
- 'lib/**'
jobs:
build:
if: github.repository == 'DIYgod/RSSHub'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Release
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
npx version-from-git --allow-same-version --template 'master.short'
- name: Publish to npmjs
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Release
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
npx version-from-git --allow-same-version --template 'master.short'
- name: Publish to npmjs
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -4,8 +4,7 @@ name: PR route test
# https://github.com/actions/first-interaction/issues/10#issuecomment-752360668
# Reopen Included
on:
- pull_request_target
- pull_request_target
jobs:
testRoute:
@@ -16,6 +15,7 @@ jobs:
id: fetchRoute
uses: actions/github-script@v3
with:
# by default, JSON format returned
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |

View File

@@ -6,14 +6,14 @@ jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
- run: npm ci
- name: Lint
run: |
npm run lint
env:
CI: true
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
- run: npm ci
- name: Lint
run: |
npm run lint
env:
CI: true

View File

@@ -1,21 +1,19 @@
name: Automatic Rebase
on:
issue_comment:
types: [created]
issue_comment:
types: [created]
jobs:
rebase:
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && github.event.comment.author_association == 'COLLABORATOR'
runs-on: ubuntu-latest
steps:
-
name: Checkout the latest code
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Automatic Rebase
uses: cirrus-actions/rebase@1.4
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_SUPER }}
rebase:
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && github.event.comment.author_association == 'COLLABORATOR'
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.4
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_SUPER }}

View File

@@ -15,19 +15,20 @@ jobs:
strategy:
matrix:
node-version: [14.x]
node-version: ['14.x']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run jest
env:
REDIS_URL: redis://localhost:${{ job.services.redis.ports[6379] }}/
- run: npm run docs:build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run jest
env:
REDIS_URL: redis://localhost:${{ job.services.redis.ports[6379] }}/
- run: npm run docs:build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -1,7 +1,8 @@
package.json
docs/.vuepress/dist
package-lock.json
.github/
.github/*.md
.github/ISSUE_TEMPLATE/*.md
renovate.json
coverage
.vscode/

105
package-lock.json generated
View File

@@ -81,6 +81,7 @@
"eslint": "7.29.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-prettier": "3.4.0",
"eslint-plugin-yml": "^0.12.0",
"fs-extra": "^8.1.0",
"jest": "26.6.3",
"mockdate": "3.0.5",
@@ -8151,14 +8152,19 @@
"dev": true
},
"node_modules/debug": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/decamelize": {
@@ -9241,6 +9247,24 @@
"node": ">=6.0.0"
}
},
"node_modules/eslint-plugin-yml": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-yml/-/eslint-plugin-yml-0.12.0.tgz",
"integrity": "sha512-aS82M+diohZTusadiByzh/bKDrfi+Y6VBQkD3ym/7JH+KF9WUB9qKCizLfTaCACwtRrHpqaLz3G8GKmslshyiw==",
"dev": true,
"dependencies": {
"debug": "^4.3.2",
"lodash": "^4.17.21",
"natural-compare": "^1.4.0",
"yaml-eslint-parser": "^0.5.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"peerDependencies": {
"eslint": ">=6.0.0"
}
},
"node_modules/eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
@@ -25584,6 +25608,38 @@
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"dev": true,
"engines": {
"node": ">= 6"
}
},
"node_modules/yaml-eslint-parser": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-0.5.0.tgz",
"integrity": "sha512-nJeyLA3YHAzhBTZbRAbu3W6xrSCucyxExmA+ZDtEdUFpGllxAZpto2Zxo2IG0r0eiuEiBM4e+wiAdxTziTq94g==",
"dev": true,
"dependencies": {
"eslint-visitor-keys": "^3.0.0",
"lodash": "^4.17.21",
"yaml": "^1.10.2"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
"node_modules/yaml-eslint-parser/node_modules/eslint-visitor-keys": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz",
"integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
"node_modules/yargs": {
"version": "14.2.3",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz",
@@ -32654,9 +32710,9 @@
"dev": true
},
"debug": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"requires": {
"ms": "2.1.2"
}
@@ -33720,6 +33776,18 @@
"prettier-linter-helpers": "^1.0.0"
}
},
"eslint-plugin-yml": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-yml/-/eslint-plugin-yml-0.12.0.tgz",
"integrity": "sha512-aS82M+diohZTusadiByzh/bKDrfi+Y6VBQkD3ym/7JH+KF9WUB9qKCizLfTaCACwtRrHpqaLz3G8GKmslshyiw==",
"dev": true,
"requires": {
"debug": "^4.3.2",
"lodash": "^4.17.21",
"natural-compare": "^1.4.0",
"yaml-eslint-parser": "^0.5.0"
}
},
"eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
@@ -47412,6 +47480,31 @@
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"dev": true
},
"yaml-eslint-parser": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-0.5.0.tgz",
"integrity": "sha512-nJeyLA3YHAzhBTZbRAbu3W6xrSCucyxExmA+ZDtEdUFpGllxAZpto2Zxo2IG0r0eiuEiBM4e+wiAdxTziTq94g==",
"dev": true,
"requires": {
"eslint-visitor-keys": "^3.0.0",
"lodash": "^4.17.21",
"yaml": "^1.10.2"
},
"dependencies": {
"eslint-visitor-keys": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz",
"integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==",
"dev": true
}
}
},
"yargs": {
"version": "14.2.3",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz",

View File

@@ -53,6 +53,7 @@
"eslint": "7.29.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-prettier": "3.4.0",
"eslint-plugin-yml": "^0.12.0",
"fs-extra": "^8.1.0",
"jest": "26.6.3",
"mockdate": "3.0.5",

View File

@@ -1,20 +1,16 @@
-
name: Install RSSHub
- name: Install RSSHub
hosts: localhost
become: true
vars_prompt:
-
name: domain_name
- name: domain_name
prompt: What is the domain name (without www, e.g. rsshub.example.com)? Use "http://localhost" for development in Vagrant VM.
private: no
tasks:
-
name: Check OS
- name: Check OS
fail:
msg: This playbook can only be run on Ubuntu 20.04 at this moment
when: ansible_distribution != 'Ubuntu' or ansible_distribution_version !='20.04'
-
name: Install GPG keys for repos
- name: Install GPG keys for repos
apt_key:
url: '{{ item }}'
state: present
@@ -22,8 +18,7 @@
- https://deb.nodesource.com/gpgkey/nodesource.gpg.key
- https://download.docker.com/linux/ubuntu/gpg
- https://dl.cloudsmith.io/public/caddy/stable/cfg/gpg/gpg.155B6D79CA56EA34.key
-
name: Install repos
- name: Install repos
apt_repository:
repo: '{{ item }}'
state: present
@@ -32,8 +27,7 @@
- deb https://deb.nodesource.com/node_12.x focal main
- deb https://download.docker.com/linux/ubuntu focal stable
- deb https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main
-
name: Install prerequisites
- name: Install prerequisites
apt:
name:
- nodejs
@@ -47,81 +41,68 @@
- caddy
state: present
update_cache: yes
-
name: Install python module for docker
- name: Install python module for docker
pip:
name: docker
-
name: Pull docker image for browserless
- name: Pull docker image for browserless
docker_image:
name: browserless/chrome
source: pull
-
name: Start redis
- name: Start redis
systemd:
state: restarted
enabled: yes
name: redis
daemon_reload: yes
-
name: Copy caddy configuration
- name: Copy caddy configuration
template:
src: rsshub.Caddyfile
dest: /etc/caddy/Caddyfile
-
name: Start caddy
- name: Start caddy
systemd:
state: restarted
enabled: yes
name: caddy
daemon_reload: yes
-
name: Create and start browserless container
- name: Create and start browserless container
docker_container:
name: browserless
image: browserless/chrome:1.43-chrome-stable
state: started
restart_policy: always
published_ports:
- "3000:3000"
-
name: Create the user
- '3000:3000'
- name: Create the user
user:
name: rsshub
create_home: true
shell: /bin/bash
-
name: Clone the repo
- name: Clone the repo
git:
repo: https://github.com/DIYgod/RSSHub.git
dest: /home/rsshub/app
update: yes
-
name: Install repo dependencies
- name: Install repo dependencies
command: npm ci --production
args:
chdir: /home/rsshub/app
environment:
PUPPETEER_SKIP_DOWNLOAD: true
-
name: Copy configuration
- name: Copy configuration
copy:
src: rsshub.env
dest: /home/rsshub/app/.env
-
name: Own repo to the user
- name: Own repo to the user
file:
path: /home/rsshub/app
owner: rsshub
group: rsshub
recurse: yes
-
name: Install the systemd unit
- name: Install the systemd unit
copy:
src: rsshub.service
dest: /etc/systemd/system/rsshub.service
-
name: Start the systemd service
- name: Start the systemd service
systemd:
state: restarted
enabled: yes