ansible/roles/codimd/tasks/main.yml

50 lines
1.1 KiB
YAML
Raw Normal View History

2019-02-07 13:37:11 +01:00
---
# Install APT dependencies
- include_tasks: 0_apt_dependencies.yml
# Create CodiMD user and group
- include_tasks: 1_user_group.yml
# Download CodiMD
2019-02-09 09:26:05 +01:00
# TODO : temporally disabled until 1.3.0 is out (because of uws bug)
#- name: Clone CodiMD project
# git:
# repo: https://github.com/hackmdio/codimd.git
# dest: /var/local/codimd/codimd
# version: 1.2.1
# become: yes
# become_user: codimd
# notify: Build front-end for CodiMD
2019-02-07 13:37:11 +01:00
# Setup dependencies and configs
- name: Install CodiMD depedencies
command: bin/setup
args:
chdir: /var/local/codimd/codimd
become: yes
become_user: codimd
# Connection to database
2019-02-09 08:07:10 +01:00
- name: Connect CodiMD to PostgreSQL db
2019-02-07 13:37:11 +01:00
template:
src: sequelizerc
dest: /var/local/codimd/codimd/.sequelizerc
owner: codimd
group: codimd
mode: 0600
2019-02-09 08:39:16 +01:00
# Update database
2019-02-09 08:07:10 +01:00
- name: Migrate the db to the latest schema
2019-02-07 13:37:11 +01:00
command: node_modules/.bin/sequelize db:migrate
args:
2019-02-09 08:07:10 +01:00
chdir: /var/local/codimd/codimd
2019-02-07 13:37:11 +01:00
become: yes
become_user: codimd
2019-02-09 08:07:10 +01:00
2019-02-09 09:29:14 +01:00
# Config CodiMD
# config.json template
# Config SystemD service
# NODE_ENV="production" npm start