瀏覽代碼

:wrench: add build in docker supprot

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

+ 1 - 1
deploy/README.md

@@ -5,7 +5,7 @@
 ```bash
 # create cluster
 mkdir -p clients/CLUSTER/.ssh
-cd clients/CLUSTER
+cd clients/CLUSTER/
 # append your cluster hosts
 touch hosts
 # generate ssh key

+ 3 - 4
deploy/ec2.yml

@@ -1,11 +1,10 @@
 - name: Testing ssh connections
   hosts:
-    - postgresql
-    - rabbitmq
-    - redis
-    - logging
     - web
+    - db
+    - fpm
     - task
+    - logging
   roles:
     - os
     - ubuntu

+ 0 - 9
deploy/roles/container/tasks/main.yml

@@ -1,12 +1,3 @@
-- name: Create container data folder
-  become: true
-  ansible.builtin.file:
-    path: "/mnt/{{ ansible_user }}"
-    state: directory
-    owner: "{{ ansible_user }}"
-    group: "{{ ansible_user }}"
-    mode: "0700"
-
 - name: Create containers config folder
   ansible.builtin.file:
     path: "{{ ansible_env.HOME }}/.config/containers"

+ 1 - 1
deploy/roles/container/templates/storage.conf

@@ -1,6 +1,6 @@
 [storage]
 driver = "overlay"
-rootless_storage_path = "/mnt/{{ ansible_user }}/.c"
+rootless_storage_path = "$HOME/.c"
 
 [storage.options.overlay]
 mount_program = "/usr/bin/fuse-overlayfs"

+ 13 - 0
scripts/.env.dashboard-v4

@@ -0,0 +1,13 @@
+export NODE_OPTIONS: "--max_old_space_size=4096"
+export PUBLIC_URL: "{{ app_dashboard_base_path }}"
+export REACT_APP_DEFAULT_LOCALE: "zh-Hans"
+export REACT_APP_LANGUAGES: "en-US,zh-Hans,zh-Hant"
+export REACT_APP_ENABLE_LOCAL_TOKEN: "true"
+export REACT_APP_TOKEN_KEY: "token.yyyyMMdd"
+export REACT_APP_DOCUMENTS_SERVER: "{{ app_documents_server }}"
+export REACT_APP_RPC_SERVER: "{{ app_grpc_web_server }}"
+export REACT_APP_ASSETS_SERVER: "{{ app_assets_server }}"
+export REACT_APP_API_SERVER: "https://{{ app_domain }}"
+export REACT_APP_ICP_CODE: "{{ app_icp_code }}"
+export REACT_APP_MPS_CODE: "{{ app_mps_code }}"
+export REACT_APP_QUESTIONNAIRE_LINK: "{{ app_questionnaire_link }}"

+ 54 - 0
scripts/build.sh

@@ -0,0 +1,54 @@
+#!/bin/bash
+
+set -e
+
+export WORKSPACE=$PWD
+export PACKAGE_NAME="palm-$VERSION_CODENAME-$GIT_VERSION"
+export TARGET_DIR=$WORKSPACE/tmp
+
+function build_dashboard_v4() {
+    local react_node_modules="node_modules-$2.tar.xz"
+    if [ ! -f $TARGET_DIR/$react_node_modules ]; then
+        echo "couldn't find $react_node_modules_tar"
+        exit 1
+    fi
+
+    cd $TARGET_DIR/mint-$1/dashboard-v4/dashboard/
+    echo "uncompress node_modules dashboard-v4"
+    tar xf $TARGET_DIR/$react_node_modules
+    npm run build
+}
+
+# -----------------------------------------------------------------------------
+if [ "$#" -ne 2 ]; then
+    echo "USAGE: $0 FULL_GIT_COMMIT_ID ENV_ID"
+    exit 1
+fi
+
+if [ ! -f $TARGET_DIR/$1.zip ]; then
+    echo "download $1.zip from github"
+    wget -q -P $TARGET_DIR https://github.com/iapt-platform/mint/archive/$1.zip
+fi
+
+if [ ! -f $TARGET_DIR/$2.env ]; then
+    echo "couldn't find config file $TARGET_DIR/$2"
+    exit 1
+fi
+
+# export $(grep -v '^#' $TARGET_DIR/$2.env | xargs -0)
+source $TARGET_DIR/$2.env
+
+# -----------------------------------------------------------------------------
+
+cd $TARGET_DIR/
+if [ -d mint-$1 ]; then
+    echo "remove mint-$1 folder"
+    rm -r mint-$1
+fi
+echo "uncompress $1.zip"
+unzip -q $1.zip
+
+build_dashboard_v4 $1 "20241028144559"
+
+echo "done."
+exit 0