Sfoglia il codice sorgente

:bug: fix git checkout by hash bug

Jeremy Zheng 9 mesi fa
parent
commit
342b5f4a06

+ 3 - 4
deploy/mint.yml

@@ -56,7 +56,6 @@
         - wbw.analyses
         - export.pali.chapter
         - export.article
-        - ai.translate
 
 - name: Start mint php-fpm
   hosts:
@@ -73,11 +72,11 @@
   hosts:
     - ai_translate
   tasks:
-    - name: Start ai-translate service
+    - name: Disable php ai-translate service
       ansible.builtin.systemd_service:
         name: "{{ app_container_prefix }}-{{ app_domain }}-worker-mq-ai.translate"
-        enabled: true
-        state: restarted
+        enabled: false
+        state: stopped
         scope: user
 
 - name: Setup nginx

+ 16 - 0
deploy/roles/mint-v2.1/tasks/clove.yml

@@ -0,0 +1,16 @@
+- name: Clone source codes
+  ansible.builtin.git:
+    repo: "https://github.com/iapt-platform/clove.git"
+    dest: "{{ app_deploy_target | dirname }}/clove"
+
+- name: Setup resources for v8
+  ansible.builtin.file:
+    src: "{{ app_deploy_target | dirname }}/clove"
+    dest: "{{ app_deploy_target }}/api-v8/storage/resources"
+    state: link
+
+- name: Setup resources for v12
+  ansible.builtin.file:
+    src: "{{ app_deploy_target | dirname }}/clove"
+    dest: "{{ app_deploy_target }}/api-v12/storage/resources"
+    state: link

+ 3 - 0
deploy/roles/mint-v2.1/tasks/laravel.yml

@@ -47,6 +47,9 @@
   loop_control:
     loop_var: worker_name
 
+- name: Setup clove resources
+  ansible.builtin.import_tasks: clove.yml
+
 - name: Setup schedule run
   ansible.builtin.import_tasks: schedule-run.yml
 

+ 53 - 18
deploy/roles/mint-v2.1/tasks/main.yml

@@ -6,24 +6,41 @@
     owner: "{{ ansible_user }}"
     mode: "0755"
 
-# - name: Download source code
-#   ansible.builtin.unarchive:
-#     src: https://github.com/iapt-platform/mint/archive/{{ mint_version }}.zip
-#     dest: "{{ app_deploy_target | dirname }}"
-#     remote_src: true
-#     creates: "{{ app_deploy_target }}"
-
-- name: Download source codes
-  ansible.builtin.git:
-    repo: "https://github.com/iapt-platform/mint.git"
-    dest: "{{ app_deploy_target | dirname }}/repo"
-
-- name: Clone to spec version
-  ansible.builtin.git:
-    repo: "{{ app_deploy_target | dirname }}/repo"
-    dest: "{{ app_deploy_target }}"
-    depth: 1
-    single_branch: true
+# ---------------------------------------------------------
+
+- name: Download source code
+  ansible.builtin.unarchive:
+    src: https://github.com/iapt-platform/mint/archive/{{ mint_version }}.zip
+    dest: "{{ app_deploy_target | dirname }}"
+    remote_src: true
+    creates: "{{ app_deploy_target }}"
+
+# ---------------------------------------------------------
+
+# - name: Clone source codes directly
+#   ansible.builtin.git:
+#     repo: "https://github.com/iapt-platform/mint.git"
+#     dest: "{{ app_deploy_target }}"
+#     version: "{{ mint_version }}"
+
+# ---------------------------------------------------------
+
+# - name: Clone source codes to repo
+#   ansible.builtin.git:
+#     repo: "https://github.com/iapt-platform/mint.git"
+#     dest: "{{ app_deploy_target | dirname }}/repo"
+#     update: true
+#     version: "development"
+
+# - name: Clone to from local repo
+#   ansible.builtin.git:
+#     repo: "{{ app_deploy_target | dirname }}/repo"
+#     dest: "{{ app_deploy_target }}"
+#     version: "{{ mint_version }}"
+#     # depth: 1
+#     # single_branch: true
+
+# ---------------------------------------------------------
 
 - name: Upload dashboard-v4 dist
   ansible.posix.synchronize:
@@ -48,3 +65,21 @@
   ansible.builtin.systemd:
     daemon_reload: true
     scope: user
+
+- name: Upload version.txt(api-v8)
+  ansible.builtin.template:
+    src: version.txt.j2
+    dest: "{{ app_deploy_target }}/api-v8/public/version.txt"
+    mode: "0555"
+
+- name: Upload version.txt(api-v12)
+  ansible.builtin.template:
+    src: version.txt.j2
+    dest: "{{ app_deploy_target }}/api-v12/public/version.txt"
+    mode: "0555"
+
+- name: Upload version.txt(dashboard-v4)
+  ansible.builtin.template:
+    src: version.txt.j2
+    dest: "{{ app_deploy_target }}/dashboard-v4/dashboard/dist/version.txt"
+    mode: "0555"

+ 2 - 0
deploy/roles/mint-v2.1/templates/version.txt.j2

@@ -0,0 +1,2 @@
+git version: {{ mint_version }}
+deployed at: {{ ansible_date_time.iso8601 }}