@wjwjq/release-helper 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/.release/release.conf.yaml +2 -0
  2. package/dist/cli.js +1 -1
  3. package/dist/deploy/script/common.sh +36 -29
  4. package/dist/deploy/script/prompt.sh +6 -0
  5. package/dist/pack.js +22 -21
  6. package/dist/prepare.js +20 -10
  7. package/dist/publish.js +7 -9
  8. package/dist/release.js +4 -5
  9. package/dist/start_prepare.js +3 -3
  10. package/package.json +1 -1
  11. package/pnpm-lock.yaml +0 -2443
  12. package/src/.release/README.md +0 -73
  13. package/src/.release/doc//351/203/250/347/275/262/346/211/213/345/206/214.md +0 -418
  14. package/src/.release/nginx/ca/ca.crt +0 -32
  15. package/src/.release/nginx/ca/ca.key +0 -54
  16. package/src/.release/nginx/ca/client.crt +0 -100
  17. package/src/.release/nginx/ca/client.csr +0 -16
  18. package/src/.release/nginx/ca/client.p12 +0 -0
  19. package/src/.release/nginx/ca/client.pem +0 -30
  20. package/src/.release/nginx/ca/server.crt +0 -101
  21. package/src/.release/nginx/ca/server.csr +0 -17
  22. package/src/.release/nginx/ca/server.key +0 -27
  23. package/src/.release/nginx/ca/server.pem +0 -30
  24. package/src/.release/nginx/nginx.conf +0 -179
  25. package/src/.release/release.conf.yaml +0 -15
  26. package/src/cli.ts +0 -99
  27. package/src/deploy/pkg/nginx/nginx.logrotate.tpl +0 -14
  28. package/src/deploy/pkg/nginx/nginx.service.tpl +0 -32
  29. package/src/deploy/pkg/nginx_binary/compile.sh +0 -39
  30. package/src/deploy/pkg/nginx_binary/nginx-arm-ssl1.1.1.tar.gz +0 -0
  31. package/src/deploy/pkg/nginx_binary/nginx-x86_64-ssl1.0.2.tar.gz +0 -0
  32. package/src/deploy/pkg/nginx_binary/nginx-x86_64-ssl1.1.1.tar.gz +0 -0
  33. package/src/deploy/pkg/nginx_binary/nginx-x86_64-ssl3.0.7.tar.gz +0 -0
  34. package/src/deploy/script/common.sh +0 -196
  35. package/src/deploy/script/install.sh +0 -7
  36. package/src/deploy/script/nginx.sh +0 -265
  37. package/src/deploy/script/prompt.sh +0 -110
  38. package/src/deploy/script/readme.md +0 -10
  39. package/src/deploy/script/upgrade.sh +0 -7
  40. package/src/logger.ts +0 -18
  41. package/src/pack.ts +0 -152
  42. package/src/prepare.ts +0 -120
  43. package/src/publish.ts +0 -308
  44. package/src/release.ts +0 -292
  45. package/src/start_prepare.ts +0 -13
@@ -1,196 +0,0 @@
1
- #!/bin/bash
2
- # 获取脚本的父目录
3
- project_path=$(echo "$basepath" | sed -e "s/\/script//")
4
-
5
- # 请勿修改此处, 此处将在打包时自动替换
6
- app_name=__APP_NAME__
7
-
8
- # 静态资源存放目录 eg: /opt/posidon-frontend/
9
- install_path=__INSTALL_PATH__
10
- user=__USER__
11
- usergroup=__USER_GROUP__
12
-
13
- execute_log_path="/var/log/${app_name}_script_execute_logs"
14
-
15
- log() {
16
- now=$(date "+%Y-%m-%d %H:%M:%S")
17
- echo "$now: $1"
18
- echo "$now: [info] $1" >>"$execute_log_path"
19
- }
20
-
21
- log_success() {
22
- now=$(date "+%Y-%m-%d %H:%M:%S")
23
- echo "$(tput setaf 2)""$now": "$1""$(tput sgr0)"
24
- echo "$now: [success] $1" >>"$execute_log_path"
25
- }
26
-
27
- log_error() {
28
- now=$(date "+%Y-%m-%d %H:%M:%S")
29
- echo "$(tput setaf 1)""$now": "$1" "$(tput sgr0)"
30
- echo "$now: [error] $1" >>"$execute_log_path"
31
- }
32
-
33
- log "-----------execute ${app_name} script-------------"
34
-
35
- source "$basepath"/prompt.sh
36
-
37
- if [[ $(whoami) != "root" ]]; then
38
- echo "user:root is required!"
39
- exit 1
40
- fi
41
-
42
- if [[ -z "${install_path}" ]]; then
43
- echo "install path not found"
44
- exit 1
45
- fi
46
-
47
- echo "install_path: ${install_path}"
48
-
49
- source "$basepath"/nginx.sh
50
-
51
- # 创建用户
52
- create_user_csri() {
53
- user=$user
54
- group=$usergroup
55
-
56
- #create group if not exists
57
- grep "^$group" /etc/group >&/dev/null
58
- if [ $? -ne 0 ]; then
59
- groupadd $group
60
- fi
61
-
62
- #create user if not exists
63
- grep "^$user" /etc/passwd >&/dev/null
64
- if [ $? -ne 0 ]; then
65
- useradd -g $group $user
66
- fi
67
- }
68
-
69
- has_nginx_installed=1
70
-
71
- # 检查 nginx 是否已安装
72
- if command -v nginx >/dev/null 2>&1; then
73
- # echo "Nginx is installed."
74
- has_nginx_installed=1
75
- # # 检查 nginx 服务是否正在运行
76
- # if pgrep nginx >/dev/null 2>&1; then
77
- # echo "Nginx is running."
78
- # else
79
- # echo "Nginx is installed but not running."
80
- # fi
81
- else
82
- # echo "Nginx is not installed."
83
- has_nginx_installed=0
84
- fi
85
-
86
- get_old_version() {
87
- if [ -f "$install_path""version" ]; then
88
- old_version=$(sed -n '1p' "$install_path""version")
89
-
90
- echo "$old_version"
91
- fi
92
- }
93
-
94
- install_assets() {
95
-
96
- # 拷贝静态资源
97
- cp -rf "${project_path}"/pkg/version "$install_path"
98
-
99
- mkdir -p "$install_path"assets
100
-
101
- cp -rf "${project_path}"/pkg/assets/* "$install_path"assets
102
-
103
- # # 对比行数并合并
104
- # if [ -f "${backup_path}/settings" ]; then
105
- # cat $backup_path/settings | sed '/^$/d' >>./settings
106
- # cat $install_path/settings | sed '/^$/d' >>./settings_new
107
-
108
- # diffLines=$(diff ./settings ./settings_new | awk 'END{print NR}')
109
-
110
- # if ((diffLines > 0)); then
111
- # echo '-------合并前:old--------'
112
- # cat ./settings
113
- # old_total_line=$(awk 'END{print NR}' ./settings)
114
- # start=$(($old_total_line + 1))
115
-
116
- # echo '-------合并前: new--------'
117
- # cat ./settings_new
118
- # total_line=$(awk 'END{print NR}' ./settings_new)
119
-
120
- # sed -n "${start},${total_line}p" ./settings_new >>./settings
121
- # echo '---------- 合并后 ----------'
122
- # cat ./settings
123
-
124
- # mv -f ./settings $install_path
125
- # rm -rf ./settings_new
126
-
127
- # echo "$(tput setaf 2)"settings 已合并,注意检查"$(tput sgr0)"
128
- # fi
129
- # fi
130
-
131
- log_success "$install_path"assets/settings 已覆盖,请注意对比差异
132
-
133
- }
134
-
135
- start() {
136
- # 未安装
137
- if ((has_nginx_installed == 0)); then
138
- install_nginx_binary
139
-
140
- if [[ $? != 0 ]]; then
141
- echo "$(tput setaf 1)"failed to install!"$(tput sgr0)"
142
- exit 1
143
- fi
144
- fi
145
-
146
- # 已安装 询问是否更新nginx
147
- if ((has_nginx_installed == 1)); then
148
- while true; do
149
- read -r -p "Nginx has been installed, re-install it?[Y/N]" yn
150
- case $yn in
151
- [Yy]*)
152
- install_nginx_binary
153
-
154
- if [[ $? != 0 ]]; then
155
- echo "$(tput setaf 1)"failed to install!"$(tput sgr0)"
156
- exit 1
157
- fi
158
- break
159
- ;;
160
- [Nn]*) break ;;
161
- *) echo "Please answer yes or no." ;;
162
- esac
163
- done
164
- fi
165
-
166
- # 创建用户
167
- create_user_csri
168
-
169
- now=$(date "+%Y-%m-%d_%H:%M:%S")
170
- old_version=$(get_old_version)
171
-
172
- #备份整个服务 eg: /opt/posidon-frontend
173
- if [[ -n "${old_version}" ]]; then
174
- parent_store_path=$(echo "$install_path" | sed -e "s/\/${app_name}//")
175
- backup_path=$parent_store_path""$app_name"_"$old_version"_"$now
176
- echo "${app_name} assets backup at: $backup_path"
177
- mv "$install_path" "$backup_path"
178
- fi
179
-
180
- mkdir -p "$install_path"
181
-
182
- copy_nginx_conf_and_write_verison
183
- add_nginx_service
184
- add_log_rotate
185
- install_assets
186
-
187
- # 修改所属用户
188
- chown -R $user:$usergroup "$install_path"
189
- chmod 744 -R "$install_path"
190
-
191
- if [[ $? == 0 ]]; then
192
- log_success "posidon-frontend deployed successfully"
193
- else
194
- log_error "posidon-frontend deployment failed"
195
- fi
196
- }
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- # 获取脚本所在的目录
3
- basepath=$(dirname "$(realpath "${BASH_SOURCE[-1]}")")
4
-
5
- source "$basepath"/common.sh
6
-
7
- start
@@ -1,265 +0,0 @@
1
- #!/bin/bash
2
-
3
- # 安装包所在路径
4
- pkg_path="${project_path}/pkg"
5
-
6
- #------------------------------------ nginx服务配置文件服务 start----------------------------------
7
- # 配置文件所在路径
8
- new_nginx_conf_path="${pkg_path}/nginx"
9
-
10
- # 指定安装目录
11
- nginx_conf_install_path="$prefix/opt/${app_name}/nginx/"
12
-
13
- # nginx服务配置文件路径
14
- nginx_conf_path="${nginx_conf_install_path}nginx.conf"
15
-
16
- # asset_path="$prefix/opt/posidon-frontend/"
17
- nginx_info_path="/var/log/${app_name}"
18
- nginx_log_file="nginx.log"
19
- #不放在var/run 是因为重启后 var/run/下面的文件及目录会被清除
20
- nginx_pid_file_path="$nginx_info_path/nginx.pid"
21
-
22
- conf_version=$(awk '{print $1}' "${pkg_path}"/version)
23
- echo "$conf_version"
24
-
25
- copy_nginx_conf_and_write_verison() {
26
- mkdir -p "$nginx_conf_install_path"
27
- # 创建pid目录. 创建日志目录
28
- mkdir -p $nginx_info_path
29
- touch $nginx_info_path/$nginx_log_file
30
- chown -R $user:$usergroup $nginx_info_path
31
- chmod 744 -R $nginx_info_path
32
-
33
- access_log_super="access_log /dev/stdout main"
34
- error_log_super="error_log /dev/stderr warn"
35
- access_log="access_log $nginx_info_path/$nginx_log_file main"
36
- error_log="error_log $nginx_info_path/$nginx_log_file"
37
- pid_file="pid $nginx_pid_file_path"
38
-
39
- exec=$(get_exec_path)
40
-
41
- # if [ -f "$nginx_conf_path" ]; then
42
- # old_version=$(sed -n '1p' "$nginx_conf_path" | sed 's/# version: //' | sed "s/\s\+//g")
43
-
44
- # if [[ -n "${old_version}" ]]; then
45
- # now=$(date "+%Y-%m-%d_%H:%M:%S")
46
-
47
- # # echo "nginx_"$old_version"_"$now".conf"
48
- # mv "$nginx_conf_path" "${nginx_conf_install_path}"/"$app_name".nginx_"$old_version"_"$now".conf
49
- # fi
50
- # fi
51
-
52
- #nginx -v nginx代码内部使用的stderr输出, 此处需要转换为stdout
53
- nginx_version=$($exec -v 2>&1)
54
-
55
- tmp_file='./nginx/nginx.conf'
56
- cp -rf "$new_nginx_conf_path" ./
57
-
58
- sed -i "1i\# ${nginx_version}" $tmp_file
59
- sed -i "1i\# version: ${conf_version}" $tmp_file
60
-
61
- if [[ -n "${prefix}" ]]; then
62
- n=$(grep -wn "mime.types" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
63
- sed -i "${n}c include conf/mime.types;" $tmp_file
64
- fi
65
-
66
- # n=$(grep -wn "__root__" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
67
- # if [[ -n "${n}" ]]; then
68
- # sed -i "${n}c root ${asset_path};" $tmp_file
69
- # fi
70
-
71
- # 替换日志输出路径方式
72
- n=$(grep -wn "#ERROR_LOG_PLACEHOLDER" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
73
- if [[ -n "${n}" ]]; then
74
- sed -i "${n}c ${error_log};" $tmp_file
75
- # if ((mode == 2)); then
76
- # sed -i "${n}c ${error_log};" $tmp_file
77
- # else
78
- # sed -i "${n}c ${error_log_super};" $tmp_file
79
- # fi
80
- fi
81
-
82
- n=$(grep -wn "#ACCESS_LOG_PLACEHOLDER" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
83
- if [[ -n "${n}" ]]; then
84
- sed -i "${n}c ${access_log};" $tmp_file
85
- # if ((mode == 2)); then
86
- # sed -i "${n}c ${access_log};" $tmp_file
87
- # else
88
- # sed -i "${n}c ${access_log_super};" $tmp_file
89
- # fi
90
- fi
91
-
92
- n=$(grep -wn "#PID_FILE_PALCEHOLDER" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
93
- if [[ -n "${n}" ]]; then
94
- sed -i "${n}c ${pid_file};" $tmp_file
95
- # 非supervisorctl
96
- # if ((mode == 2)); then
97
- # sed -i "${n}c ${pid_file};" $tmp_file
98
- # fi
99
- fi
100
-
101
- n=$(grep -wn "daemon off;" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
102
- if [[ -n "${n}" ]]; then
103
- # 非supervisorctl
104
- if ((mode == 2)); then
105
- sed -i "${n}c daemon on;" $tmp_file
106
- fi
107
- fi
108
-
109
- # 拷贝整个nginx目录
110
- mv -fb ./nginx/* "$nginx_conf_install_path"
111
-
112
- mkdir -p /data/command/
113
- log "nginx start command: $(get_exec_cmd)"
114
- echo "$exec -c $nginx_conf_path" >/data/command/nginx
115
-
116
- if [[ $? == 0 ]]; then
117
- log_success "$conf_version $nginx_conf_path replaced successfully!"
118
- else
119
- log_error "$conf_version $nginx_conf_path replaced failed!"
120
- fi
121
- }
122
-
123
- get_exec_path() {
124
- cmd=''
125
- if [[ -n "${prefix}" ]]; then
126
- cmd="${nginx_conf_install_path}/sbin/nginx"
127
- else
128
- cmd="/usr/sbin/nginx"
129
- fi
130
-
131
- echo "$cmd"
132
- }
133
-
134
- get_exec_cmd() {
135
- exec=$(get_exec_path)
136
-
137
- echo "$exec -c $nginx_conf_path"
138
- }
139
-
140
- add_nginx_service() {
141
- #添加到服务
142
- exec_cmd="$(get_exec_cmd) -e $nginx_info_path/$nginx_log_file"
143
- cp "$pkg_path"/nginx/nginx.service.tpl ./nginx.service
144
-
145
- check_cmd="$exec -t -c $nginx_conf_path -e $nginx_info_path/$nginx_log_file"
146
- version=$(echo "$conf_version" | grep -oP '\d+\.\d+\.\d+')
147
-
148
- sed -i "s#_user_group_#$usergroup#g" ./nginx.service
149
- sed -i "s#_user_#$user#g" ./nginx.service
150
- sed -i "s#_exec_cmd_#$exec_cmd #g" ./nginx.service
151
- sed -i "s#_log_path_#$nginx_info_path#g" ./nginx.service
152
- sed -i "s#_log_file_#$nginx_log_file#g" ./nginx.service
153
- sed -i "s#_conf_path_#$nginx_conf_path#g" ./nginx.service
154
- sed -i "s#_version_#$version#g" ./nginx.service
155
- sed -i "s#_pid_file_#$nginx_pid_file_path#g" ./nginx.service
156
- #sed -i "s#_start_check_#$check_cmd#g" ./nginx.service
157
-
158
- if ((mode == 2)); then
159
- # systemctl enable nginx
160
- cp ./nginx.service /usr/lib/systemd/system/"$app_name".nginx.service
161
- systemctl daemon-reload
162
-
163
- log_success "add ${app_name}.nginx.service to /usr/lib/systemd/system/"
164
- else
165
- rm -rf /usr/lib/systemd/system/"$app_name".nginx.service
166
- fi
167
- }
168
-
169
- add_log_rotate(){
170
- mkdir -p /etc/logrotate.d
171
-
172
- rm -rf /etc/logrotate.d/${app_name}.nginx
173
- #添加日志翻转
174
- cp "$pkg_path"/nginx/nginx.logrotate.tpl ./nginx.logrotate
175
-
176
- sed -i "s#__usergroup__#$usergroup#g" ./nginx.logrotate
177
- sed -i "s#__user__#$user#g" ./nginx.logrotate
178
- sed -i "s#__app_name__#$app_name#g" ./nginx.logrotate
179
- sed -i "s#__pid_file__#$nginx_pid_file_path#g" ./nginx.logrotate
180
-
181
- cp -f ./nginx.logrotate /etc/logrotate.d/${app_name}.nginx
182
- }
183
- #------------------------------------ nginx服务配置文件服务 end----------------------------------
184
-
185
-
186
- #------------------------------------ nginx 可执行程序相关 start----------------------------------
187
- # 指定安装目录
188
- nginx_binary_install_path="/etc/nginx/"
189
-
190
- mkdir -p "$nginx_binary_install_path"
191
-
192
- # 安装包所在路径
193
- nginx_binary_pkg_path="${pkg_path}/nginx_binary"
194
-
195
- open_port_80() {
196
- # 查看防火墙是否开启
197
- systemctl status firewalld
198
- # 若未开启则开启
199
- systemctl start firewalld
200
-
201
- # 查看所有开启的端口
202
- #firewall-cmd --list-ports
203
-
204
- # 开启nginx默认80端口(关键步骤一)
205
- firewall-cmd --zone=public --add-port=80/tcp --permanent
206
-
207
- # 重启防火墙(关键步骤二)
208
- firewall-cmd --reload
209
- }
210
-
211
- # 安装nginx可执行程序
212
- install_nginx_binary() {
213
- log "install nginx to path: ${nginx_binary_install_path}"
214
-
215
- arch=$(uname -m)
216
- ssl_version=$(openssl version | grep -oP '\d+\.\d+' | sed -n '1p' 2>&1)
217
-
218
- if [[ -z "${arch}" ]]; then
219
- arch="x86_64"
220
- fi
221
-
222
- if [[ $arch == arm* ]] || [[ $arch = aarch64 ]]; then
223
- arch="arm"
224
- fi
225
-
226
- if [[ "${ssl_version}" == "1.0" ]]; then
227
- ssl_version="1.0.2"
228
- fi
229
-
230
- if [[ "${ssl_version}" == "1.1" ]]; then
231
- ssl_version="1.1.1"
232
- fi
233
-
234
- if [[ "${ssl_version}" == "3.0" ]]; then
235
- ssl_version="3.0.7"
236
- fi
237
-
238
- if [[ -z "${ssl_version}" ]]; then
239
- ssl_version="1.0.2"
240
- fi
241
-
242
- pkg="$nginx_binary_pkg_path"/nginx-"$arch"-ssl"$ssl_version".tar.gz
243
-
244
- if [ ! -f "$pkg" ]; then
245
- log_error "Fatal error: nginx-$arch-ssl$ssl_version.tar.gz not matched! contact developer!"
246
- exit 1
247
- fi
248
-
249
- log "current arch: $arch, current ssl_version: $ssl_version"
250
-
251
- tar -zxvhf "$pkg" -C "$nginx_binary_install_path" --strip-components 1
252
- # 检测是否安装成功
253
- if [[ $? == 0 ]]; then
254
- log_success "nginx installation successfully!"
255
- else
256
- log_error "nginx installation failed!"
257
- fi
258
-
259
- ln -sf "$nginx_binary_install_path"sbin/nginx /usr/sbin/nginx
260
-
261
- # 修改/etc/nginx 用户(组)
262
- chown -R $user:$usergroup "$nginx_binary_install_path"
263
- chmod 744 -R "$nginx_binary_install_path"
264
- }
265
- #------------------------------------ nginx 可执行程序相关 end ----------------------------------
@@ -1,110 +0,0 @@
1
- #!/bin/bash
2
- log "-----------receive parameter: $@------------"
3
-
4
- # if [ $# == 0 ]; then
5
- # log_error "Fatal error: parameter -standalone or -cluster is required!"
6
- # exit 1
7
- # fi
8
-
9
- mode="__INSTALL_MODE__"
10
-
11
- if [[ "${mode}" == "standalone" ]]; then
12
- mode=1
13
- elif [[ "${mode}" == "cluster" ]]; then
14
- mode=2
15
- else
16
- mode=''
17
- fi
18
-
19
-
20
- if [[ -z "${mode}" ]]; then
21
- while [ $# -gt 0 ]; do
22
- case "$1" in
23
- -S | -standalone)
24
- mode=1
25
- shift
26
- ;;
27
- -C | -cluster)
28
- mode=2
29
- shift
30
- ;;
31
- -h | --help)
32
- echo "supported parameters: "
33
- echo "-S, -standalone install for supervisord startup mode, conflict with -C"
34
- echo "-C, -cluster install for systemd startup mode, conflict with -S"
35
- echo "-P, -prefix specify the install path"
36
- exit 0
37
- ;;
38
- -P | -prefix)
39
- case "$2" in
40
- "")
41
- if [ $# -eq 1 ]; then
42
- break
43
- else
44
- shift 2
45
- fi
46
- ;;
47
- -*) shift ;;
48
- *)
49
- prefix=$2
50
- if [ $# -eq 2 ]; then
51
- break
52
- else
53
- shift 2
54
- fi
55
- ;;
56
- esac
57
- ;;
58
- --)
59
- shift
60
- break
61
- ;;
62
- "")
63
- echo 'no args'
64
- break
65
- ;;
66
- *)
67
- log_error "invalid parameter: {$1}"
68
- exit 1
69
- ;;
70
- esac
71
- done
72
- fi
73
-
74
- if [[ -z "${mode}" ]]; then
75
- log_error "Fatal error: parameter -standalone or -cluster is required!"
76
- exit 1
77
- # echo "Please choose an redis installation mode!"
78
- # PS3='Please input the number: '
79
- # options=("Standalone 1" "Cluster 2" "Quit")
80
- # select opt in "${options[@]}"; do
81
- # case $opt in
82
- # "Standalone 1")
83
- # mode=1
84
- # break
85
- # ;;
86
- # "Cluster 2")
87
- # mode=2
88
- # break
89
- # ;;
90
- # "Quit")
91
- # break
92
- # ;;
93
- # *) echo "invalid option $REPLY" ;;
94
- # esac
95
- # done
96
- fi
97
-
98
- if ((mode == 1)); then
99
- log "-------------------------------------------------"
100
- log "-------start to install Standalone mode-------"
101
- log "-------------------------------------------------"
102
- fi
103
-
104
- if ((mode == 2)); then
105
- log "-------------------------------------------------"
106
- log "-------start to install Cluster mode-------"
107
- log "-------------------------------------------------"
108
- fi
109
-
110
- # echo "install/upgrade prefix: $prefix"
@@ -1,10 +0,0 @@
1
-
2
- nginx
3
- Install
4
- --> 选择mode
5
- -> 检测nginx是否有可执行文件,
6
- a. 若无 --> 安装
7
- b. 若有 --> 询问是否替换安装
8
- --> 资源部署
9
- 1. 生成对应 xxx.nginx.conf (替换对应日志xxx.nginx.log、进程和生成 xxx.nginx.service)
10
- 2. 复制静态资源文件
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- # 获取脚本所在的目录
3
- basepath=$(dirname "$(realpath "${BASH_SOURCE[-1]}")")
4
-
5
- source "$basepath"/common.sh
6
-
7
- start
package/src/logger.ts DELETED
@@ -1,18 +0,0 @@
1
- import pc from 'picocolors';
2
-
3
- export const logger = {
4
- info: (msg: string) => {
5
- console.info(`---------------------- ${msg} ----------------------`)
6
- },
7
- error: (msg: string) => {
8
- console.log(`---------------------- ${pc.red(msg)} ----------------------`)
9
- },
10
- success: (msg: string) => {
11
- console.info("--------------------------------------------------------------");
12
- console.info(`---------🚀 ${pc.green(msg)} ----------------`);
13
- console.info("--------------------------------------------------------------");
14
- },
15
- tip: (msg: string) => {
16
- console.log(`---------------------- ${pc.yellow(msg)} ----------------------`)
17
- }
18
- }