瀏覽代碼

:bug: fix build vendors package

Jeremy Zheng 1 年之前
父節點
當前提交
ec1b23453b

+ 5 - 5
deploy/mint.yml

@@ -1,12 +1,12 @@
-- name: Build frontend v4
-  hosts: 127.0.0.1
-  roles:
-    - mint-dashboard-v4-build
-
 - name: Build backend v8
   hosts: fort
   roles:
     - mint-backend-v8-build
+
+- name: Build frontend v4
+  hosts: 127.0.0.1
+  roles:
+    - mint-dashboard-v4-build
 # - name: Setup pali.syn
 #   hosts:
 #     - db

+ 21 - 15
deploy/roles/mint-backend-v8-build/tasks/main.yml

@@ -5,21 +5,27 @@
     remote_src: true
     creates: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}"
 
-- name: Upload dashboard dist
-  ansible.builtin.copy:
-    src: "{{ playbook_dir }}/tmp/mint-{{ mint_version }}/dashboard-v4/dashboard/dist"
-    dest: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}/dashboard-v4/dashboard"
-    mode: "0755"
-
-- name: Compress repo.xz
-  community.general.archive:
-    path: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}"
-    dest: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}.tar.xz"
-    format: xz
-    mode: "0444"
+- name: Install third packages
+  ansible.builtin.command: docker/mint/run.sh {{ app_mint_image_name }} setup
+  args:
+    chdir: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}"
+    creates: api-v8/public/node_modules
 
-- name: Download repo.xz
+- name: Download repo
   ansible.builtin.fetch:
-    src: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}.tar.xz"
+    src: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}"
     dest: "{{ playbook_dir }}/tmp/"
-    mode: "0444"
+    mode: "0755"
+# - name: Upload dashboard dist
+#   ansible.builtin.copy:
+#     src: "{{ playbook_dir }}/tmp/mint-{{ mint_version }}/dashboard-v4/dashboard/dist"
+#     dest: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}/dashboard-v4/dashboard"
+#     mode: "0755"
+
+# - name: Compress repo.xz
+#   community.general.archive:
+#     path: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}"
+#     dest: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}.tar.xz"
+#     format: xz
+#     mode: "0444"
+

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

@@ -1,10 +1,3 @@
-- name: Download source code
-  ansible.builtin.unarchive:
-    src: https://github.com/iapt-platform/mint/archive/{{ mint_version }}.zip
-    dest: "{{ playbook_dir }}/tmp"
-    creates: "{{ playbook_dir }}/tmp/mint-{{ mint_version }}"
-    remote_src: true
-
 - name: Extract dashboard node_modules
   ansible.builtin.unarchive:
     src: dashboard-20241201115354.tar.xz

+ 1 - 1
docker/mint/start.sh → docker/mint/run.sh

@@ -14,7 +14,7 @@ export LAUNCH_MINT_CONTAINER="podman run --rm -it --events-backend=file --hostna
 if [ "$2" == "shell" ]; then
     $LAUNCH_MINT_CONTAINER /bin/bash
 else
-    $LAUNCH_MINT_CONTAINER /srv/scripts/launch.sh $1
+    $LAUNCH_MINT_CONTAINER /bin/bash -lc "/srv/scripts/launch.sh $2"
 fi
 
 exit 0

+ 3 - 0
scripts/launch.sh

@@ -11,6 +11,9 @@ fi
 
 export WORK_DIR="/srv"
 
+export NVM_DIR="$HOME/.nvm"
+source "$NVM_DIR/nvm.sh"
+
 if [ "$1" == "fpm" ]; then
     echo "start fpm worker"
     # TODO