diff --git a/README.md b/README.md index 7befb79..1e555e9 100644 --- a/README.md +++ b/README.md @@ -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= ``` +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. The typical order of deployment is: diff --git a/ansible/roles/wagtail/tasks/install.yaml b/ansible/roles/wagtail/tasks/install.yaml index 25d42b1..30c81ec 100644 --- a/ansible/roles/wagtail/tasks/install.yaml +++ b/ansible/roles/wagtail/tasks/install.yaml @@ -4,22 +4,23 @@ file: path={{ release_dir }} state=directory owner=ansible group=ansible become: true -- name: Ensure Make is installed - become: true - apt: - pkg: make - - name: Checkout code branch from git git: - repo: 'https://github.com/datalets/public-health-ch' dest: "{{ release_dir }}" - force: yes + repo: "{{ gitrepo }}" + version: "{{ gitversion }}" + force: false - name: Copy Docker site configuration template: src: docker-compose.j2 dest: "{{ release_dir }}/docker-compose.yml" +- name: Ensure Make is installed + become: true + apt: + pkg: make + - name: Deploy Wagtail site on Docker shell: make build args: diff --git a/ansible/roles/wagtail/tasks/release.yaml b/ansible/roles/wagtail/tasks/release.yaml index 4e9ba20..8aac1d3 100644 --- a/ansible/roles/wagtail/tasks/release.yaml +++ b/ansible/roles/wagtail/tasks/release.yaml @@ -2,10 +2,10 @@ - name: Checkout code branch from git git: - repo: 'https://github.com/datalets/public-health-ch' dest: "{{ release_dir }}" - force: yes + repo: "{{ gitrepo }}" version: "{{ gitversion }}" + force: no - name: Copy Docker site configuration template: diff --git a/ansible/wagtail.yaml b/ansible/wagtail.yaml index 8861284..ddf8e3e 100644 --- a/ansible/wagtail.yaml +++ b/ansible/wagtail.yaml @@ -2,6 +2,8 @@ become: false gather_facts: true vars: + gitrepo: https://github.com/datalets/public-health-ch + gitversion: master release_dir: /opt/publichealth archive_dir: /opt/www-old django_log_dir: /var/log/publichealth