Răsfoiți Sursa

:bug: fix build release package

China Kassapa 2 luni în urmă
părinte
comite
30e9ebad6a

+ 1 - 2
deploy/mint.yml

@@ -7,7 +7,7 @@
       register: mint_release_file_status
 
 - name: Building release package
-  hosts: localhost      
+  hosts: localhost
   roles:
     - role: mint-build-v2.3
       when: not mint_release_file_status.stat.exists
@@ -23,7 +23,6 @@
     - openai_proxy
   roles:
     - role: mint-v2.3
-
 # - name: Setup local build folder
 #   hosts: localhost
 #   tasks:

+ 12 - 13
deploy/roles/mint-build-v2.3/tasks/main.yml

@@ -62,9 +62,8 @@
     REACT_APP_API_SERVER: "https://{{ app_domain }}"
     REACT_APP_ICP_CODE: "{{ app_icp_code }}"
     REACT_APP_MPS_CODE: "{{ app_mps_code }}"
-    REACT_APP_QUESTIONNAIRE_LINK: "{{ app_questionnaire_link }}"    
+    REACT_APP_QUESTIONNAIRE_LINK: "{{ app_questionnaire_link }}"
     REACT_APP_OPENAI_PROXY: "{{ app_openai_proxy_server }}/api/openai"
-      
 
 - name: Build dashboard-v6
   ansible.builtin.shell: |
@@ -85,9 +84,9 @@
     VITE_API_SERVER: "https://{{ app_domain }}"
     VITE_ICP_CODE: "{{ app_icp_code }}"
     VITE_MPS_CODE: "{{ app_mps_code }}"
-    VITE_QUESTIONNAIRE_LINK: "{{ app_questionnaire_link }}"    
+    VITE_QUESTIONNAIRE_LINK: "{{ app_questionnaire_link }}"
     VITE_OPENAI_PROXY: "{{ app_openai_proxy_server }}/api/openai"
-    
+
 - name: Build open-ai proxy server
   ansible.builtin.shell: |
     source ~/.nvm/nvm.sh && npm run build -- --output-path {{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }}/open-ai-server
@@ -97,23 +96,23 @@
     creates: "{{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }}/open-ai-server"
   environment:
     NODE_ENV: production
-    
+
 - name: Copy api-v8 to release folder
-  ansible.posix.synchronize:    
+  ansible.posix.synchronize:
     src: "{{ app_workspace }}/api-v8"
-    dest: "{{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }}/api-v8"
+    dest: "{{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }}"
     recursive: true
-    
+
 - name: Copy api-v12 to release folder
-  ansible.posix.synchronize:    
+  ansible.posix.synchronize:
     src: "{{ app_workspace }}/api-v12"
-    dest: "{{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }}/api-v12"
+    dest: "{{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }}"
     recursive: true
 
 - name: Copy ai-translate to release folder
-  ansible.posix.synchronize:    
+  ansible.posix.synchronize:
     src: "{{ app_workspace }}/ai-translate"
-    dest: "{{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }}/ai-translate"
+    dest: "{{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }}"
     recursive: true
 
 # - name: Archive release.tar.xz
@@ -124,7 +123,7 @@
 #     remove: true
 
 - name: Archive release.tar.xz
-  ansible.builtin.shell: tar --remove-files -cJf {{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }}.tar.xz -C {{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }} .
+  ansible.builtin.command: tar --remove-files -cJf {{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }}.tar.xz -C {{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }} .
   args:
     creates: "{{ app_workspace }}/tmp/{{ app_domain }}-{{ mint_version }}.tar.xz"
   environment:

+ 2 - 0
deploy/roles/mint-v2.3/files/run.sh

@@ -33,3 +33,5 @@ else
 fi
 
 exit 0
+
+

+ 16 - 2
deploy/roles/mint-v2.3/tasks/main.yml

@@ -1,11 +1,25 @@
-- name: Pull {{ item }} image
-  ansible.builtin.shell: docker pull {{ item }}
+- name: Pull docker image
+  ansible.builtin.command: docker pull {{ item }}
   with_items:
     - "{{ app_php81_image }}"
     - "{{ app_php84_image }}"
     - "{{ app_python_image }}"
     - "{{ app_nodejs_image }}"
 
+- name: Create /srv/python3 folder
+  become: true
+  ansible.builtin.file:
+    path: /srv/python3
+    state: directory
+    owner: "{{ ansible_user }}"
+    mode: "0755"
+
+- name: Extract python3.tar.xz
+  ansible.builtin.unarchive:
+    src: python3-{{ ansible_facts['architecture'] }}-2026011614.tar.xz
+    dest: /srv
+    creates: /srv/python3/pyvenv.cfg
+
 - name: Create workspace folder
   become: true
   ansible.builtin.file:

+ 12 - 13
deploy/roles/mint-v2.3/tasks/systemd.yml

@@ -5,7 +5,7 @@
     state: directory
     owner: "{{ ansible_user }}"
     mode: "0755"
-    
+
 - name: Create scripts folder
   ansible.builtin.file:
     path: "{{ app_deploy_target }}/scripts"
@@ -16,13 +16,13 @@
   ansible.builtin.copy:
     src: run.sh
     dest: "{{ app_deploy_target }}/scripts/"
-    mode: '0555'
+    mode: "0555"
 
 - name: Upload clean.py
   ansible.builtin.copy:
     src: clean.py
     dest: "{{ app_deploy_target | dirname }}/"
-    mode: '0444'
+    mode: "0444"
 
 - name: Upload clean.service
   become: true
@@ -42,7 +42,7 @@
   ansible.builtin.copy:
     src: php-fpm.sh
     dest: "/srv/bin/"
-    mode: '0555'
+    mode: "0555"
 
 - name: Upload php-fpm-v8.1.service
   become: true
@@ -97,21 +97,20 @@
     dest: "/etc/systemd/system/{{ app_domain }}-laravel-job-{{ item.name }}.service"
     mode: "0444"
   with_items:
-    - { name: "mq-discussion", image: "{{ app_php81_image }}"}
-    - { name: "mq-pr", image: "{{ app_php81_image }}"}
-    - { name: "mq-progress", image: "{{ app_php81_image }}"}
-    - { name: "mq-wbw.analyses", image: "{{ app_php81_image }}"}
-
+    - { name: "mq-discussion", image: "{{ app_php81_image }}" }
+    - { name: "mq-pr", image: "{{ app_php81_image }}" }
+    - { name: "mq-progress", image: "{{ app_php81_image }}" }
+    - { name: "mq-wbw.analyses", image: "{{ app_php81_image }}" }
 
 - name: Upload laravel sceduler
-  ansible.builtin.import_tasks: laravel-scheduler.yml
+  ansible.builtin.include_tasks: laravel-scheduler.yml
   with_items:
-    - {image: "{{ app_php81_image }}", version: "v8"}
-    - {image: "{{ app_php84_image }}", version: "v12"}
+    - { image: "{{ app_php81_image }}", version: "v8" }
+    - { image: "{{ app_php84_image }}", version: "v12" }
 
 - name: Reload systemd profiles
   become: true
-  ansible.builtin.shell: systemctl daemon-reload
+  ansible.builtin.command: systemctl daemon-reload
 
 - name: Enable clean timer
   become: true

+ 1 - 1
deploy/roles/mint-v2.3/templates/v1/config.js.j2

@@ -2,7 +2,7 @@ var ICP_CODE = "{{ app_icp_code }}"
 var GRPC_WEB_SERVER = "{{ app_grpc_web_server }}";
 var DOCUMENTS_SERVER = "{{ app_documents_server }}";
 var REACT_APP_QUESTIONNAIRE_LINK = "{{ app_questionnaire_link }}";
-var DASHBOARD_BASE_PATH = "{{ app_dashboard_base_path }}";
+var DASHBOARD_BASE_PATH = "{{ app_dashboard_v4_base_path }}";
 
 /*
   |---------------

+ 1 - 1
deploy/roles/mint-v2.3/templates/v1/config.php.j2

@@ -7,7 +7,7 @@ define("DOCUMENTS_SERVER","{{ app_documents_server }}");
 define('APP_KEY','{{ app_secret_key }}');
 define('APP_ENV','{{ app_env }}');
 define('CORS_ALLOWED_ORIGINS', '{{ app_cors_allowed_origins }}');
-define('DASHBOARD_BASE_PATH', "{{ app_dashboard_base_path }}");
+define('DASHBOARD_BASE_PATH', "{{ app_dashboard_v4_base_path }}");
 
 /*
 电子邮件设置

+ 1 - 1
deploy/roles/mint-v2.3/templates/v2/env.j2

@@ -63,7 +63,7 @@ PUSHER_APP_CLUSTER=mt1
 MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
 MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
 
-DASHBOARD_BASE_PATH="{{ app_dashboard_base_path }}"
+DASHBOARD_BASE_PATH="{{ app_dashboard_v4_base_path }}"
 ASSETS_SERVER="{{ app_assets_server }}"
 GRPC_WEB_SERVER="{{ app_grpc_web_server }}"
 DOCUMENTS_SERVER="{{ app_documents_server }}"