forked from infra/ansible
hackmd: update database scheme
This commit is contained in:
parent
9b19d93bf9
commit
4a93fab603
@ -51,6 +51,14 @@
|
||||
become: true
|
||||
become_user: postgres
|
||||
|
||||
- name: Configure sequelize
|
||||
template: src=_sequelizerc.j2 dest=/opt/codimd-{{ hackmd_version }}/.sequelizerc owner=hackmd
|
||||
|
||||
- name: Upgrade database schema
|
||||
command: node_modules/.bin/sequelize db:migrate chdir=/opt/codimd-{{ hackmd_version }}
|
||||
become: true
|
||||
become_user: hackmd
|
||||
|
||||
- name: Ensure certificates are available
|
||||
command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ hackmd_domain }}.key -out /etc/nginx/ssl/{{ hackmd_domain }}.crt -days 730 -subj "/CN={{ hackmd_domain }}" creates=/etc/nginx/ssl/{{ hackmd_domain }}.crt
|
||||
notify: Restart nginx
|
||||
|
8
roles/hackmd/templates/_sequelizerc.j2
Normal file
8
roles/hackmd/templates/_sequelizerc.j2
Normal file
@ -0,0 +1,8 @@
|
||||
var path = require('path');
|
||||
|
||||
module.exports = {
|
||||
'config': path.resolve('config.json'),
|
||||
'migrations-path': path.resolve('lib', 'migrations'),
|
||||
'models-path': path.resolve('lib', 'models'),
|
||||
'url': 'postgres://{{ hackmd_dbuser }}:{{ hackmd_dbpass }}@localhost:5432/{{ hackmd_dbname }}'
|
||||
}
|
Loading…
Reference in New Issue
Block a user