diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..b70feb9 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1,102 @@ +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets +.history/ +*.vsix +*~ +.fuse_hidden* +.directory +.Trash-* +.nfs* +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +pids +*.pid +*.seed +*.pid.lock +lib-cov +coverage +*.lcov +.nyc_output +.grunt +bower_components +.lock-wscript +build/Release +node_modules/ +jspm_packages/ +web_modules/ +*.tsbuildinfo +.npm +.eslintcache +.stylelintcache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ +.node_repl_history +*.tgz +.yarn-integrity +.env +.env.development.local +.env.test.local +.env.production.local +.env.local +.cache +.parcel-cache +.next +out +.nuxt +dist +.cache/ +.vuepress/dist +.temp +.docusaurus +.serverless/ +.fusebox/ +.dynamodb/ +.tern-port +.vscode-test +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db +*.stackdump +[Dd]esktop.ini +$RECYCLE.BIN/ +*.cab +*.msi +*.msix +*.msm +*.msp +*.lnk +.DS_Store +.AppleDouble +.LSOverride +Icon +._* +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/bin/build-all.js b/bin/build-all.js new file mode 100644 index 0000000..bcd935f --- /dev/null +++ b/bin/build-all.js @@ -0,0 +1,54 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_package_batch, run_upload} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch([ + 'service-common', + 'service-dependencies', + 'service-configuration', + 'service-forest', + 'service-cli', + 'service-cli/service-cli-core', + 'service-executor', + 'service-executor/service-executor-core', + 'utils/executor', + ]) + await run_package_batch([ + 'service-api', + 'service-check', + 'service-cli/service-cli-runner', + 'service-cloud-query', + 'service-executor/service-executor-manager', + 'service-executor/service-executor-task', + 'service-command', + 'service-command-pro', + 'service-exporter', + 'service-flink-query', + 'service-gateway', + 'service-hudi-query', + 'service-info-query', + 'service-monitor', + 'service-loki-query', + 'service-pulsar-query', + 'service-queue', + 'service-scheduler', + 'service-uploader', + 'service-web', + 'service-yarn-query', + 'service-zookeeper-query', + 'utils/patch', + 'utils/sync', + ]) + for (const profile of ['b2a4', 'b2b1', 'b2b12']) { + await run_package('service-launcher', profile) + await run_upload(`**/service-launcher-${profile}-1.0.0-SNAPSHOT.jar`) + } + await run_upload('**/target/*-1.0.0-SNAPSHOT.jar') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-all.sh b/bin/build-all.sh deleted file mode 100755 index 4b9a873..0000000 --- a/bin/build-all.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -mvn install -N -D skipTests -deploy service-common service-dependencies service-configuration service-forest service-cli service-cli/service-cli-core service-executor service-executor/service-executor-core utils/executor -package service-api service-check service-cli/service-cli-runner service-cloud-query service-executor/service-executor-manager service-executor/service-executor-task service-command service-command-pro service-exporter service-flink-query service-gateway service-hudi-query service-info-query service-monitor service-loki-query service-pulsar-query service-queue service-scheduler service-uploader service-web service-yarn-query service-zookeeper-query utils/patch utils/sync - -configs=(b2a4 b2b1 b2b12) -for config in ${configs[*]}; -do - mvn -pl service-launcher clean package -D skipTests -P $config - upload $root_path/service-launcher/target/service-launcher-$config-1.0.0-SNAPSHOT.jar -done - -upload $root_path/service-api/target/service-api-1.0.0-SNAPSHOT.jar -upload $root_path/service-check/target/service-check-1.0.0-SNAPSHOT.jar -upload $root_path/service-cloud-query/target/service-cloud-query-1.0.0-SNAPSHOT.jar -upload $root_path/service-command/target/service-command-1.0.0-SNAPSHOT.jar -upload $root_path/service-command-pro/target/service-command-pro-1.0.0-SNAPSHOT.jar -upload $root_path/service-executor/service-executor-manager/target/service-executor-manager-1.0.0-SNAPSHOT.jar -upload $root_path/service-executor/service-executor-task/target/service-executor-task-1.0.0-SNAPSHOT.jar -upload $root_path/service-exporter/target/service-exporter-1.0.0-SNAPSHOT.jar -upload $root_path/service-flink-query/target/service-flink-query-1.0.0-SNAPSHOT.jar -upload $root_path/service-gateway/target/service-gateway-1.0.0-SNAPSHOT.jar -upload $root_path/service-hudi-query/target/service-hudi-query-1.0.0-SNAPSHOT.jar -upload $root_path/service-info-query/target/service-info-query-1.0.0-SNAPSHOT.jar -upload $root_path/service-loki-query/target/service-loki-query-1.0.0-SNAPSHOT.jar -upload $root_path/service-monitor/target/service-monitor-1.0.0-SNAPSHOT.jar -upload $root_path/service-pulsar-query/target/service-pulsar-query-1.0.0-SNAPSHOT.jar -upload $root_path/service-queue/target/service-queue-1.0.0-SNAPSHOT.jar -upload $root_path/service-scheduler/target/service-scheduler-1.0.0-SNAPSHOT.jar -upload $root_path/service-web/target/service-web-1.0.0-SNAPSHOT.jar -upload $root_path/service-yarn-query/target/service-yarn-query-1.0.0-SNAPSHOT.jar -upload $root_path/service-zookeeper-query/target/service-zookeeper-query-1.0.0-SNAPSHOT.jar -upload $root_path/utils/sync/target/sync-1.0.0-SNAPSHOT.jar - -upload $root_path/service-cli/service-cli-runner/target/service-cli-runner-1.0.0-SNAPSHOT.jar -upload $root_path/service-uploader/target/service-uploader-1.0.0-SNAPSHOT.jar diff --git a/bin/build-api.js b/bin/build-api.js new file mode 100644 index 0000000..0d74a22 --- /dev/null +++ b/bin/build-api.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-api') + await run_upload_normal('service-api') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-api.sh b/bin/build-api.sh deleted file mode 100755 index 2cc5f71..0000000 --- a/bin/build-api.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-api -upload $root_path/service-api/target/service-api-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-check.js b/bin/build-check.js new file mode 100644 index 0000000..d58fcc0 --- /dev/null +++ b/bin/build-check.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-check') + await run_upload_normal('service-check') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-check.sh b/bin/build-check.sh deleted file mode 100755 index 2f00a1c..0000000 --- a/bin/build-check.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-check -upload $root_path/service-check/target/service-check-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-cli.js b/bin/build-cli.js new file mode 100644 index 0000000..3005e06 --- /dev/null +++ b/bin/build-cli.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-cli', 'service-cli/service-cli-core']) + await run_package('service-cli/service-cli-runner') + await run_upload_normal('service-cli-runner', 'service-cli') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-cli.sh b/bin/build-cli.sh deleted file mode 100755 index 672e40a..0000000 --- a/bin/build-cli.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-cli service-cli/service-cli-core -package service-cli/service-cli-runner -upload $root_path/service-cli/service-cli-runner/target/service-cli-runner-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-cloud-query.js b/bin/build-cloud-query.js new file mode 100644 index 0000000..dc76f1b --- /dev/null +++ b/bin/build-cloud-query.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-cloud-query') + await run_upload_normal('service-cloud-query') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-cloud-query.sh b/bin/build-cloud-query.sh deleted file mode 100755 index f8013b0..0000000 --- a/bin/build-cloud-query.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-cloud-query -upload $root_path/service-cloud-query/target/service-cloud-query-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-command-pro.js b/bin/build-command-pro.js new file mode 100644 index 0000000..346b1a2 --- /dev/null +++ b/bin/build-command-pro.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-command-pro') + await run_upload_normal('service-command-pro') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-command-pro.sh b/bin/build-command-pro.sh deleted file mode 100755 index 0b5b1bb..0000000 --- a/bin/build-command-pro.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-command-pro -upload $root_path/service-command-pro/target/service-command-pro-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-command.js b/bin/build-command.js new file mode 100644 index 0000000..9db7dfd --- /dev/null +++ b/bin/build-command.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-command') + await run_upload_normal('service-command') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-command.sh b/bin/build-command.sh deleted file mode 100755 index 7818fa7..0000000 --- a/bin/build-command.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-command -upload $root_path/service-command/target/service-command-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-executor-manager.js b/bin/build-executor-manager.js new file mode 100644 index 0000000..9a606d7 --- /dev/null +++ b/bin/build-executor-manager.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest', 'service-executor', 'service-executor/service-executor-core']) + await run_package('service-executor/service-executor-manager') + await run_upload_normal('service-executor-manager', 'service-executor') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-executor-manager.sh b/bin/build-executor-manager.sh deleted file mode 100755 index eb10c35..0000000 --- a/bin/build-executor-manager.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest service-executor service-executor/service-executor-core -package service-executor/service-executor-manager -upload $root_path/service-executor/service-executor-manager/target/service-executor-manager-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-executor-task.js b/bin/build-executor-task.js new file mode 100644 index 0000000..944dc8a --- /dev/null +++ b/bin/build-executor-task.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest', 'service-executor', 'service-executor/service-executor-core']) + await run_package('service-executor/service-executor-task') + await run_upload_normal('service-executor-task', 'service-executor') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-executor-task.sh b/bin/build-executor-task.sh deleted file mode 100755 index 4b2f4be..0000000 --- a/bin/build-executor-task.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest service-executor service-executor/service-executor-core -package service-executor/service-executor-task -upload $root_path/service-executor/service-executor-task/target/service-executor-task-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-exporter.js b/bin/build-exporter.js new file mode 100644 index 0000000..3cb8e71 --- /dev/null +++ b/bin/build-exporter.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-exporter') + await run_upload_normal('service-exporter') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-exporter.sh b/bin/build-exporter.sh deleted file mode 100755 index cf9b84a..0000000 --- a/bin/build-exporter.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-exporter -upload $root_path/service-exporter/target/service-exporter-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-flink-query.js b/bin/build-flink-query.js new file mode 100644 index 0000000..32015b4 --- /dev/null +++ b/bin/build-flink-query.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-flink-query') + await run_upload_normal('service-flink-query') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-flink-query.sh b/bin/build-flink-query.sh deleted file mode 100755 index ccf1ebf..0000000 --- a/bin/build-flink-query.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-flink-query -upload $root_path/service-flink-query/target/service-flink-query-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-gateway.js b/bin/build-gateway.js new file mode 100644 index 0000000..00948f1 --- /dev/null +++ b/bin/build-gateway.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-gateway') + await run_upload_normal('service-gateway') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-gateway.sh b/bin/build-gateway.sh deleted file mode 100755 index ea13709..0000000 --- a/bin/build-gateway.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-gateway -upload $root_path/service-gateway/target/service-gateway-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-hudi-query.js b/bin/build-hudi-query.js new file mode 100644 index 0000000..4f247db --- /dev/null +++ b/bin/build-hudi-query.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-hudi-query') + await run_upload_normal('service-hudi-query') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-hudi-query.sh b/bin/build-hudi-query.sh deleted file mode 100755 index ff2249f..0000000 --- a/bin/build-hudi-query.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-hudi-query -upload $root_path/service-hudi-query/target/service-hudi-query-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-info-query.js b/bin/build-info-query.js new file mode 100644 index 0000000..94130fa --- /dev/null +++ b/bin/build-info-query.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-info-query') + await run_upload_normal('service-info-query') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-info-query.sh b/bin/build-info-query.sh deleted file mode 100755 index f53fcb4..0000000 --- a/bin/build-info-query.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-info-query -upload $root_path/service-info-query/target/service-info-query-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-launcher.js b/bin/build-launcher.js new file mode 100644 index 0000000..faaed53 --- /dev/null +++ b/bin/build-launcher.js @@ -0,0 +1,17 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + for (const profile of ['b2a4', 'b2b1', 'b2b12']) { + await run_package('service-launcher', profile) + await run_upload(`**/service-launcher-${profile}-1.0.0-SNAPSHOT.jar`) + } +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-launcher.sh b/bin/build-launcher.sh deleted file mode 100755 index ee6a040..0000000 --- a/bin/build-launcher.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest - -configs=(b2a4 b2b1 b2b12) -for config in ${configs[*]}; -do - mvn -pl service-launcher clean package -D skipTests -P $config -s $maven_setting - upload $root_path/service-launcher/target/service-launcher-$config-1.0.0-SNAPSHOT.jar -done diff --git a/bin/build-loki-query.js b/bin/build-loki-query.js new file mode 100644 index 0000000..1455202 --- /dev/null +++ b/bin/build-loki-query.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-loki-query') + await run_upload_normal('service-loki-query') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-loki-query.sh b/bin/build-loki-query.sh deleted file mode 100755 index 58056b0..0000000 --- a/bin/build-loki-query.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-loki-query -upload $root_path/service-loki-query/target/service-loki-query-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-monitor.js b/bin/build-monitor.js new file mode 100644 index 0000000..f54984a --- /dev/null +++ b/bin/build-monitor.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-monitor') + await run_upload_normal('service-monitor') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-monitor.sh b/bin/build-monitor.sh deleted file mode 100755 index c8f80f3..0000000 --- a/bin/build-monitor.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-monitor -upload $root_path/service-monitor/target/service-monitor-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-patch.js b/bin/build-patch.js new file mode 100644 index 0000000..2e2596b --- /dev/null +++ b/bin/build-patch.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common']) + await run_package('utils/patch') + await run_upload_normal('**/patch-1.0.0-SNAPSHOT.jar') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-patch.sh b/bin/build-patch.sh deleted file mode 100755 index c446f56..0000000 --- a/bin/build-patch.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package utils/patch -upload $root_path/utils/patch/target/patch-1.0.0-SNAPSHOT.jar diff --git a/bin/build-pulsar-query.js b/bin/build-pulsar-query.js new file mode 100644 index 0000000..4738c07 --- /dev/null +++ b/bin/build-pulsar-query.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-pulsar-query') + await run_upload_normal('service-pulsar-query') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-pulsar-query.sh b/bin/build-pulsar-query.sh deleted file mode 100755 index 8a53177..0000000 --- a/bin/build-pulsar-query.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-pulsar-query -upload $root_path/service-pulsar-query/target/service-pulsar-query-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-queue.js b/bin/build-queue.js new file mode 100644 index 0000000..bffc7aa --- /dev/null +++ b/bin/build-queue.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-queue') + await run_upload_normal('service-queue') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-queue.sh b/bin/build-queue.sh deleted file mode 100755 index 589c04e..0000000 --- a/bin/build-queue.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-queue -upload $root_path/service-queue/target/service-queue-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-scheduler.js b/bin/build-scheduler.js new file mode 100644 index 0000000..f6f8f0b --- /dev/null +++ b/bin/build-scheduler.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-scheduler') + await run_upload_normal('service-scheduler') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-scheduler.sh b/bin/build-scheduler.sh deleted file mode 100755 index 5554466..0000000 --- a/bin/build-scheduler.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-scheduler -upload $root_path/service-scheduler/target/service-scheduler-1.0.0-SNAPSHOT.jar diff --git a/bin/build-sync.js b/bin/build-sync.js new file mode 100644 index 0000000..899bfe4 --- /dev/null +++ b/bin/build-sync.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'utils/patch']) + await run_package('utils/sync') + await run_upload('**/sync-1.0.0-SNAPSHOT.jar') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-sync.sh b/bin/build-sync.sh deleted file mode 100755 index 6c7d9d7..0000000 --- a/bin/build-sync.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest utils/patch -package utils/sync -upload $root_path/utils/sync/target/sync-1.0.0-SNAPSHOT.jar diff --git a/bin/build-uploader.js b/bin/build-uploader.js new file mode 100644 index 0000000..81744cb --- /dev/null +++ b/bin/build-uploader.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-uploader') + await run_upload_normal('service-uploader') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-uploader.sh b/bin/build-uploader.sh deleted file mode 100755 index d18516e..0000000 --- a/bin/build-uploader.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-uploader -ytp-transfer2 $root_path/service-uploader/target/service-uploader-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-web.js b/bin/build-web.js new file mode 100644 index 0000000..bb76108 --- /dev/null +++ b/bin/build-web.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-web') + await run_upload_normal('service-web') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-web.sh b/bin/build-web.sh deleted file mode 100755 index 88e59e8..0000000 --- a/bin/build-web.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-web -upload $root_path/service-web/target/service-web-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-yarn-query.js b/bin/build-yarn-query.js new file mode 100644 index 0000000..08c78bf --- /dev/null +++ b/bin/build-yarn-query.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-yarn-query') + await run_upload_normal('service-yarn-query') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-yarn-query.sh b/bin/build-yarn-query.sh deleted file mode 100755 index d8249c9..0000000 --- a/bin/build-yarn-query.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-yarn-query -upload $root_path/service-yarn-query/target/service-yarn-query-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/build-zookeeper-query.js b/bin/build-zookeeper-query.js new file mode 100644 index 0000000..4a413cf --- /dev/null +++ b/bin/build-zookeeper-query.js @@ -0,0 +1,15 @@ +import {cd, path} from 'zx' +import {trim} from "licia"; +import {run_deploy_batch, run_deploy_root, run_package, run_upload, run_upload_normal} from "./library.js"; + +// 切换目录 +cd(trim(path.dirname(import.meta.dirname))) +// 执行流程 +try { + await run_deploy_root() + await run_deploy_batch(['service-common', 'service-dependencies', 'service-configuration', 'service-forest']) + await run_package('service-zookeeper-query') + await run_upload_normal('service-zookeeper-query') +} catch (e) { + console.error(e) +} \ No newline at end of file diff --git a/bin/build-zookeeper-query.sh b/bin/build-zookeeper-query.sh deleted file mode 100755 index d8d4cbf..0000000 --- a/bin/build-zookeeper-query.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -root_path=$(dirname $(cd $(dirname $0);pwd)) -source $root_path/bin/library.sh -deploy service-common service-dependencies service-configuration service-forest -package service-zookeeper-query -upload $root_path/service-zookeeper-query/target/service-zookeeper-query-1.0.0-SNAPSHOT.jar \ No newline at end of file diff --git a/bin/library.js b/bin/library.js new file mode 100644 index 0000000..0c02385 --- /dev/null +++ b/bin/library.js @@ -0,0 +1,80 @@ +import {$, fetch, fs, glob, os, path, spinner, syncProcessCwd, usePowerShell} from 'zx' +import {isEqual, trim} from "licia"; + +syncProcessCwd(true) +if (isEqual(os.platform(), 'win32')) { + usePowerShell() +} + +const maven_setting = '/Users/lanyuanxiaoyao/.m2/settings-nas.xml' + +const upload_url = 'http://132.126.207.124:36800' +const upload_username = 'AxhEbscwsJDbYMH2' +const upload_password = 'cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4' + +export const run_deploy = async (project) => { + await spinner( + `Deploying project ${project}`, + () => $`mvn -pl ${project} clean deploy -D skipTests -s ${maven_setting}` + ) + console.log(`✅ Finish deploy ${project}`) +} + +export const run_deploy_root = async () => { + await spinner( + `Deploying root`, + () => $`mvn clean deploy -N -D skipTests -s ${maven_setting}` + ) + console.log(`✅ Finish deploy root`) +} + +export const run_deploy_batch = async (projects) => { + for (const project of projects) { + await run_deploy(project) + } +} + +export const run_package = async (project, profile = 'b2b12') => { + await spinner( + `Packaging project ${project} ${isEqual(profile, 'b2b12') ? '' : profile}`, + () => $`mvn -pl ${project} clean package -D skipTests -P ${profile} -s ${maven_setting}` + ) + console.log(`✅ Finish package ${project} ${isEqual(profile, 'b2b12') ? '' : profile}`) +} + +export const run_package_batch = async (projects) => { + for (const project of projects) { + await run_package(project) + } +} + +const upload = async (file_path) => { + let response = await spinner( + `Uploading project ${file_path}`, + () => fetch(`${upload_url}/file/upload/${path.basename(file_path)}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/octet-stream', + 'Authorization': `Basic ${Buffer.from(`${upload_username}:${upload_password}`).toString('base64')}`, + }, + body: fs.createReadStream(file_path), + duplex: 'half', + }) + ) + + if (!isEqual(response.status, 200)) { + throw response + } + console.log(`✅ Finish upload ${file_path}`) + fs.rmSync(file_path) +} + +export const run_upload = async (pattern) => { + for (let p of glob.sync(pattern)) { + await upload(path.join(trim($.sync`pwd`.text()), p)) + } +} + +export const run_upload_normal = async (project) => { + await run_upload(`${project}/target/${project}-1.0.0-SNAPSHOT.jar`) +} diff --git a/bin/package.json b/bin/package.json new file mode 100644 index 0000000..5051488 --- /dev/null +++ b/bin/package.json @@ -0,0 +1,18 @@ +{ + "name": "bin", + "version": "1.0.0", + "type": "module", + "dependencies": { + "@webpod/ps": "^0.1.1", + "chalk": "^5.4.1", + "envapi": "^0.2.3", + "fs-extra": "^11.3.0", + "globby": "^14.1.0", + "licia": "^1.48.0", + "minimist": "^1.2.8", + "node-fetch-native": "^1.6.6", + "which": "^5.0.0", + "yaml": "^2.8.0", + "zx": "^8.5.4" + } +}