Ansible wagtail tasks
This commit is contained in:
parent
3481dc11be
commit
f668418bd2
4 changed files with 14 additions and 9 deletions
|
@ -119,6 +119,8 @@ For an update release with a specific version (tag or branch), use (the `-v` par
|
||||||
ansible-playbook ansible/site.yaml -i ansible/inventories/production --tags release -v -e gitversion=<v*.*.*>
|
ansible-playbook ansible/site.yaml -i ansible/inventories/production --tags release -v -e gitversion=<v*.*.*>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also use the `gitrepo` parameter to use a different fork of the source code.
|
||||||
|
|
||||||
Once the basic system set up, i.e. you have an `ansible` user in the sudoers and docker group, you are ready to run the playbook.
|
Once the basic system set up, i.e. you have an `ansible` user in the sudoers and docker group, you are ready to run the playbook.
|
||||||
|
|
||||||
The typical order of deployment is:
|
The typical order of deployment is:
|
||||||
|
|
|
@ -4,22 +4,23 @@
|
||||||
file: path={{ release_dir }} state=directory owner=ansible group=ansible
|
file: path={{ release_dir }} state=directory owner=ansible group=ansible
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Ensure Make is installed
|
|
||||||
become: true
|
|
||||||
apt:
|
|
||||||
pkg: make
|
|
||||||
|
|
||||||
- name: Checkout code branch from git
|
- name: Checkout code branch from git
|
||||||
git:
|
git:
|
||||||
repo: 'https://github.com/datalets/public-health-ch'
|
|
||||||
dest: "{{ release_dir }}"
|
dest: "{{ release_dir }}"
|
||||||
force: yes
|
repo: "{{ gitrepo }}"
|
||||||
|
version: "{{ gitversion }}"
|
||||||
|
force: false
|
||||||
|
|
||||||
- name: Copy Docker site configuration
|
- name: Copy Docker site configuration
|
||||||
template:
|
template:
|
||||||
src: docker-compose.j2
|
src: docker-compose.j2
|
||||||
dest: "{{ release_dir }}/docker-compose.yml"
|
dest: "{{ release_dir }}/docker-compose.yml"
|
||||||
|
|
||||||
|
- name: Ensure Make is installed
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
pkg: make
|
||||||
|
|
||||||
- name: Deploy Wagtail site on Docker
|
- name: Deploy Wagtail site on Docker
|
||||||
shell: make build
|
shell: make build
|
||||||
args:
|
args:
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
- name: Checkout code branch from git
|
- name: Checkout code branch from git
|
||||||
git:
|
git:
|
||||||
repo: 'https://github.com/datalets/public-health-ch'
|
|
||||||
dest: "{{ release_dir }}"
|
dest: "{{ release_dir }}"
|
||||||
force: yes
|
repo: "{{ gitrepo }}"
|
||||||
version: "{{ gitversion }}"
|
version: "{{ gitversion }}"
|
||||||
|
force: no
|
||||||
|
|
||||||
- name: Copy Docker site configuration
|
- name: Copy Docker site configuration
|
||||||
template:
|
template:
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
become: false
|
become: false
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
vars:
|
vars:
|
||||||
|
gitrepo: https://github.com/datalets/public-health-ch
|
||||||
|
gitversion: master
|
||||||
release_dir: /opt/publichealth
|
release_dir: /opt/publichealth
|
||||||
archive_dir: /opt/www-old
|
archive_dir: /opt/www-old
|
||||||
django_log_dir: /var/log/publichealth
|
django_log_dir: /var/log/publichealth
|
||||||
|
|
Loading…
Reference in a new issue