feat(desktop): add type declaration for @brand-logo alias in brand-logo.d.ts
Deployment Config CI / Deployment Config (push) Successful in 12s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 30s
Desktop Client Build / Resolve Build Metadata (push) Successful in 26s
Desktop Client Build / Build Desktop Client (push) Successful in 22m8s
Deployment Config CI / Deployment Config (push) Successful in 12s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 30s
Desktop Client Build / Resolve Build Metadata (push) Successful in 26s
Desktop Client Build / Build Desktop Client (push) Successful in 22m8s
This commit is contained in:
@@ -70,9 +70,19 @@ config_file_path() {
|
||||
done
|
||||
}
|
||||
|
||||
read_object_storage_provider() {
|
||||
config_file_path_in_dir() {
|
||||
local dir="$1" base="$2"
|
||||
for file in "${dir}/${base}.yaml" "${dir}/${base}.yml"; do
|
||||
if [[ -f "${file}" ]]; then
|
||||
printf '%s' "${file}"
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
read_object_storage_provider_from_files() {
|
||||
local provider="minio" file
|
||||
for file in "$(config_file_path config)" "$(config_file_path config.local)"; do
|
||||
for file in "$@"; do
|
||||
if [[ -z "${file}" || ! -f "${file}" ]]; then
|
||||
continue
|
||||
fi
|
||||
@@ -110,8 +120,19 @@ read_object_storage_provider() {
|
||||
printf '%s' "$(printf '%s' "${provider}" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]')"
|
||||
}
|
||||
|
||||
use_minio_for_object_storage() {
|
||||
case "$(read_object_storage_provider)" in
|
||||
read_object_storage_provider() {
|
||||
read_object_storage_provider_from_files "$(config_file_path config)" "$(config_file_path config.local)"
|
||||
}
|
||||
|
||||
read_k3s_object_storage_provider() {
|
||||
read_object_storage_provider_from_files \
|
||||
"$(config_file_path_in_dir "${SCRIPT_DIR}/k3s/config" config)" \
|
||||
"$(config_file_path config.local)"
|
||||
}
|
||||
|
||||
use_minio_provider() {
|
||||
local provider="$1"
|
||||
case "${provider}" in
|
||||
""|minio|mino)
|
||||
return 0
|
||||
;;
|
||||
@@ -124,6 +145,10 @@ use_minio_for_object_storage() {
|
||||
esac
|
||||
}
|
||||
|
||||
use_minio_for_object_storage() {
|
||||
use_minio_provider "$(read_object_storage_provider)"
|
||||
}
|
||||
|
||||
sync_k3s_config() {
|
||||
mkdir -p "${SCRIPT_DIR}/k3s/config"
|
||||
for name in config ops-config prompts; do
|
||||
@@ -131,6 +156,9 @@ sync_k3s_config() {
|
||||
if [[ "${name}" == "prompts" ]]; then
|
||||
output="prompts.yml"
|
||||
fi
|
||||
if [[ -f "${SCRIPT_DIR}/k3s/config/${output}" ]]; then
|
||||
continue
|
||||
fi
|
||||
local source=""
|
||||
for candidate in "${SCRIPT_DIR}/${name}.yaml" "${SCRIPT_DIR}/${name}.yml"; do
|
||||
if [[ -f "${candidate}" ]]; then
|
||||
@@ -153,6 +181,18 @@ prepare_k3s_runtime_overlay() {
|
||||
cp "$(config_file_path config.local)" "${runtime_dir}/config.local.yaml"
|
||||
cp "$(config_file_path ops-config.local)" "${runtime_dir}/ops-config.local.yaml"
|
||||
|
||||
cat > "${runtime_dir}/secret.env" <<EOF
|
||||
POSTGRES_PASSWORD=$(env_value POSTGRES_PASSWORD geo_dev)
|
||||
RABBITMQ_DEFAULT_PASS=$(env_value RABBITMQ_DEFAULT_PASS geo_dev)
|
||||
MINIO_ROOT_USER=$(env_value MINIO_ROOT_USER minioadmin)
|
||||
MINIO_ROOT_PASSWORD=$(env_value MINIO_ROOT_PASSWORD minioadmin)
|
||||
JWT_SECRET=$(env_value JWT_SECRET geo-web-change-me-in-production)
|
||||
OPS_JWT_SECRET=$(env_value OPS_JWT_SECRET geo-ops-change-me-in-production)
|
||||
OPS_DEFAULT_ADMIN_PASSWORD=$(env_value OPS_DEFAULT_ADMIN_PASSWORD Aa123456)
|
||||
SCHEDULER_INTERNAL_METRICS_TOKEN=$(env_value SCHEDULER_INTERNAL_METRICS_TOKEN geo-metrics-token)
|
||||
BROWSER_FETCH_TOKEN=$(env_value BROWSER_FETCH_TOKEN geo-browser-fetch-change-me)
|
||||
EOF
|
||||
|
||||
cat > "${runtime_dir}/kustomization.yaml" <<EOF
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
@@ -163,6 +203,8 @@ resources:
|
||||
secretGenerator:
|
||||
- name: geo-rankly-app-secret
|
||||
behavior: merge
|
||||
envs:
|
||||
- secret.env
|
||||
files:
|
||||
- config.local.yaml=config.local.yaml
|
||||
- ops-config.local.yaml=ops-config.local.yaml
|
||||
@@ -234,7 +276,11 @@ deploy_k3s() {
|
||||
ensure_local_config "config.local.yaml" "config.local.yaml.example"
|
||||
ensure_local_config "ops-config.local.yaml" "ops-config.local.yaml.example"
|
||||
|
||||
if ! use_minio_for_object_storage; then
|
||||
sync_k3s_config
|
||||
local object_storage_provider
|
||||
object_storage_provider="$(read_k3s_object_storage_provider)"
|
||||
|
||||
if ! use_minio_provider "${object_storage_provider}"; then
|
||||
kustomize_dir="${SCRIPT_DIR}/k3s-aliyun-oss"
|
||||
minio_enabled="false"
|
||||
fi
|
||||
@@ -252,12 +298,11 @@ deploy_k3s() {
|
||||
fi
|
||||
|
||||
echo "==> [2/3] 应用 k3s 清单..."
|
||||
sync_k3s_config
|
||||
kustomize_dir="$(prepare_k3s_runtime_overlay "${kustomize_dir}")"
|
||||
if [[ "${minio_enabled}" == "true" ]]; then
|
||||
echo " object_storage.provider=$(read_object_storage_provider),将部署 MinIO。"
|
||||
echo " object_storage.provider=${object_storage_provider},将部署 MinIO。"
|
||||
else
|
||||
echo " object_storage.provider=$(read_object_storage_provider),将跳过 MinIO。"
|
||||
echo " object_storage.provider=${object_storage_provider},将跳过 MinIO。"
|
||||
${kubectl_cmd} -n geo-rankly delete statefulset minio --ignore-not-found
|
||||
${kubectl_cmd} -n geo-rankly delete service minio --ignore-not-found
|
||||
${kubectl_cmd} -n geo-rankly delete job minio-init --ignore-not-found
|
||||
|
||||
Reference in New Issue
Block a user