summaryrefslogtreecommitdiff
path: root/depoly.yml
diff options
context:
space:
mode:
Diffstat (limited to 'depoly.yml')
-rw-r--r--depoly.yml37
1 files changed, 37 insertions, 0 deletions
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