Răsfoiți Sursa

:bug: fix openai-proxy build

Jeremy Zheng 8 luni în urmă
părinte
comite
2adda457a6

+ 1 - 0
deploy/mint.yml

@@ -2,6 +2,7 @@
   hosts: 127.0.0.1
   roles:
     - mint-dashboard-v4-build
+    - openai-proxy-build
 
 - name: Setup mint repo
   hosts:

+ 2 - 2
deploy/roles/mint-dashboard-v4-build/tasks/main.yml

@@ -4,13 +4,13 @@
     dest: "{{ playbook_dir }}/tmp/mint"
     version: "{{ mint_version }}"
 
-- name: Extract dashboard node_modules
+- name: Extract dashboard-v4 node_modules
   ansible.builtin.unarchive:
     src: dashboard-20241201115354.tar.xz
     dest: "{{ playbook_dir }}/tmp/mint/dashboard-v4/dashboard"
     creates: "{{ playbook_dir }}/tmp/mint/dashboard-v4/dashboard/node_modules"
 
-- name: Build dashboard dist
+- name: Build dashboard-v4 dist
   ansible.builtin.shell: yarn build
   args:
     chdir: "{{ playbook_dir }}/tmp/mint/dashboard-v4/dashboard"

+ 5 - 0
deploy/roles/mint-v2.1/tasks/openai-proxy.yml

@@ -10,6 +10,11 @@
     dest: "{{ app_deploy_target }}/open-ai-server/config.json"
     mode: "0555"
 
+- name: Upload openai-proxy dist
+  ansible.posix.synchronize:
+    src: "{{ playbook_dir }}/tmp/mint/open-ai-server/dist/"
+    dest: "{{ app_deploy_target }}/open-ai-server/dist/"
+
 - name: Stop openai-proxy server
   containers.podman.podman_container:
     name: "{{ app_domain }}-openai.proxy"

+ 10 - 0
deploy/roles/openai-proxy-build/tasks/main.yml

@@ -0,0 +1,10 @@
+- name: Install nodejs dependencies
+  ansible.builtin.shell: npm install
+  args:
+    chdir: "{{ playbook_dir }}/tmp/mint/open-ai-server"
+    creates: "{{ playbook_dir }}/tmp/mint/open-ai-server/node_modules"
+
+- name: Build target dist
+  ansible.builtin.shell: npm run build
+  args:
+    chdir: "{{ playbook_dir }}/tmp/mint/open-ai-server"