Add deploy playbook: pulls git and installs deps
This commit is contained in:
parent
537aeb4118
commit
dde8cee1e3
3 changed files with 34 additions and 2 deletions
15
deploy/playbooks/deploy.yml
Normal file
15
deploy/playbooks/deploy.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
- name: Deploy impress-2020 from `main` on GitHub
|
||||
hosts: webserver
|
||||
tasks:
|
||||
- name: Pull impress-2020 from `main` on GitHub
|
||||
git:
|
||||
repo: https://github.com/matchu/impress-2020.git
|
||||
dest: /srv/impress-2020/latest-version
|
||||
version: main
|
||||
- name: Install dependencies with yarn
|
||||
command:
|
||||
chdir: /srv/impress-2020/latest-version
|
||||
cmd: yarn install
|
||||
register: result
|
||||
changed_when: '"Already up-to-date." not in result.stdout'
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- name: Install the impress-2020 app
|
||||
- name: Set up the environment for the impress-2020 app
|
||||
hosts: webserver
|
||||
tasks:
|
||||
- name: Create web user group
|
||||
|
@ -36,3 +36,19 @@
|
|||
update_cache: yes
|
||||
name: nodejs
|
||||
state: present
|
||||
- name: Install Yarn
|
||||
become: yes
|
||||
npm:
|
||||
name: yarn
|
||||
global: yes
|
||||
- name: Install node-canvas dependencies
|
||||
become: yes
|
||||
apt:
|
||||
update_cache: yes
|
||||
name:
|
||||
- build-essential
|
||||
- libcairo2-dev
|
||||
- libpango1.0-dev
|
||||
- libjpeg-dev
|
||||
- libgif-dev
|
||||
- librsvg2-dev
|
|
@ -66,7 +66,8 @@
|
|||
"vercel-build": "yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/",
|
||||
"test": "jest test --env=jsdom",
|
||||
"lint": "next lint --dir src --dir pages",
|
||||
"deploy-setup": "echo $'Setup requires you to become the root user. You\\'ll need to enter the password for your account on the remote web server below, and you must be part of the `sudoers` user group.' && ansible-playbook -K -i deploy/inventory.cfg deploy/setup.yml",
|
||||
"deploy-setup": "echo $'Setup requires you to become the root user. You\\'ll need to enter the password for your account on the remote web server below, and you must be part of the `sudoers` user group.' && ansible-playbook -K -i deploy/inventory.cfg deploy/playbooks/setup.yml",
|
||||
"deploy": "ansible-playbook -i deploy/inventory.cfg deploy/playbooks/deploy.yml",
|
||||
"cypress": "cypress open",
|
||||
"mysql": "mysql --host=impress.openneo.net --user=$(dotenv -p IMPRESS_MYSQL_USER) --password=$(dotenv -p IMPRESS_MYSQL_PASSWORD) --database=openneo_impress",
|
||||
"mysql-dev": "mysql --host=localhost --user=impress_2020_dev --password=impress_2020_dev --database=impress_2020_dev",
|
||||
|
|
Loading…
Reference in a new issue