diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | depoly.yml | 37 |
2 files changed, 39 insertions, 0 deletions
@@ -12,3 +12,5 @@ dist/ jwebmail.prod.toml jwebmail_pb2.py jwebmail_pb2.pyi +inventory.ini +script/extract diff --git a/depoly.yml b/depoly.yml new file mode 100644 index 0000000..e55d2bb --- /dev/null +++ b/depoly.yml @@ -0,0 +1,37 @@ +- name: Depoly jwebmail + hosts: myhosts + + vars: + wheels: "{{ lookup('ansible.builtin.fileglob', 'dist/*.whl', wantlist=True)|map('basename') }}" + latest_version: "{{ wheels|map('split', '-')|map(attribute='1')|community.general.version_sort|last }}" + + tasks: + - name: Info + ansible.builtin.debug: + var: latest_version + - name: Copy + ansible.builtin.copy: + src: "dist/jwebmail-{{ latest_version }}-py3-none-any.whl" + dest: "jwebmail-{{ latest_version }}-py3-none-any.whl" + - name: Update + ansible.builtin.pip: + extra_args: "--target /usr/local/jwebmail --upgrade" + name: "file:///home/jannis/jwebmail-{{ latest_version }}-py3-none-any.whl" + become: true + - name: Scripts + ansible.builtin.copy: + src: "script/moveto3.py" + dest: "/usr/local/jwebmail/bin/moveto3.py" + mode: "0755" + become: true + - name: Extract + ansible.builtin.copy: + src: "script/extract" + dest: "/usr/local/bin/jwebmail-extract" + mode: "0755" + become: true + - name: Restart + ansible.builtin.systemd_service: + name: jwebmail + state: restarted + become: true |