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

This commit is contained in:
Tony
2021-11-27 23:42:37 +00:00
committed by GitHub
parent 6e810ade86
commit 74db039ae2
19 changed files with 333 additions and 234 deletions
+20 -39
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