@wjwjq/release-helper 0.2.92 → 0.2.94
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# current nginx source code version 1.22.1
|
|
3
|
-
yum install openssl openssl-devel pcre-devel gcc gcc-c++ zlib zlib-devel
|
|
3
|
+
yum install openssl openssl-devel pcre pcre-devel gcc gcc-c++ zlib zlib-devel
|
|
4
4
|
|
|
5
5
|
# 安装yum-utils
|
|
6
6
|
$ yum -y install yum-utils
|
|
7
7
|
|
|
8
8
|
# 下载 ansible 依赖包
|
|
9
|
-
$ yumdownloader --resolve --destdir=/deps openssl openssl-devel pcre-devel gcc gcc-c++ zlib zlib-devel
|
|
9
|
+
$ yumdownloader --resolve --destdir=/deps openssl openssl-devel pcre pcre-devel gcc gcc-c++ zlib zlib-devel
|
|
10
10
|
|
|
11
11
|
./configure \
|
|
12
12
|
--prefix=/etc/nginx \
|
|
@@ -14,103 +14,134 @@ elif [[ "${mode}" == "cluster" ]]; then
|
|
|
14
14
|
mode=2
|
|
15
15
|
elif [[ "${mode}" == "static" ]]; then
|
|
16
16
|
mode=3
|
|
17
|
+
elif [[ "${mode}" == "selectable" ]]; then
|
|
18
|
+
mode=-4
|
|
17
19
|
else
|
|
18
20
|
mode=''
|
|
19
21
|
fi
|
|
20
22
|
|
|
23
|
+
if ((mode == -4)); then
|
|
24
|
+
# 定义选项
|
|
25
|
+
options=("Supervisor" "Systemd")
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
mode=2
|
|
31
|
-
shift
|
|
32
|
-
;;
|
|
33
|
-
-SS | -static)
|
|
34
|
-
mode=3
|
|
35
|
-
shift
|
|
36
|
-
;;
|
|
37
|
-
-h | --help)
|
|
38
|
-
echo "supported parameters: "
|
|
39
|
-
echo "-S, -standalone install for supervisord startup mode, conflict with -C"
|
|
40
|
-
echo "-C, -cluster install for systemd startup mode, conflict with -S"
|
|
41
|
-
echo "-P, -prefix specify the install path"
|
|
42
|
-
exit 0
|
|
43
|
-
;;
|
|
44
|
-
-P | -prefix)
|
|
45
|
-
case "$2" in
|
|
46
|
-
"")
|
|
47
|
-
if [ $# -eq 1 ]; then
|
|
48
|
-
break
|
|
27
|
+
# 提示用户选择
|
|
28
|
+
echo "请选择nginx启动方式:"
|
|
29
|
+
PS3="请输入数字 1 或 2 (按回车确认): "
|
|
30
|
+
select mode in "${options[@]}"; do
|
|
31
|
+
# 检查输入是否有效
|
|
32
|
+
if [[ "$mode" == "Supervisor" || "$mode" == "Systemd" ]]; then
|
|
33
|
+
echo "您选择了:$mode"
|
|
34
|
+
break
|
|
49
35
|
else
|
|
50
|
-
|
|
36
|
+
echo "错误:无效选项,请重新输入数字 1 或 2!"
|
|
51
37
|
fi
|
|
38
|
+
done
|
|
39
|
+
|
|
40
|
+
# 根据选择执行操作
|
|
41
|
+
if [[ "$mode" == "Supervisor" ]]; then
|
|
42
|
+
mode=1
|
|
43
|
+
log "-------------------------------------------------"
|
|
44
|
+
log "-------start to install Supervisor mode-------"
|
|
45
|
+
log "-------------------------------------------------"
|
|
46
|
+
elif [[ "$mode" == "Systemd" ]]; then
|
|
47
|
+
mode=2;
|
|
48
|
+
log "-------------------------------------------------"
|
|
49
|
+
log "-------start to install Systemd mode-------"
|
|
50
|
+
log "-------------------------------------------------"
|
|
51
|
+
fi
|
|
52
|
+
else
|
|
53
|
+
if [[ -z "${mode}" ]]; then
|
|
54
|
+
while [ $# -gt 0 ]; do
|
|
55
|
+
case "$1" in
|
|
56
|
+
-S | -standalone)
|
|
57
|
+
mode=1
|
|
58
|
+
shift
|
|
59
|
+
;;
|
|
60
|
+
-C | -cluster)
|
|
61
|
+
mode=2
|
|
62
|
+
shift
|
|
63
|
+
;;
|
|
64
|
+
-SS | -static)
|
|
65
|
+
mode=3
|
|
66
|
+
shift
|
|
67
|
+
;;
|
|
68
|
+
-h | --help)
|
|
69
|
+
echo "supported parameters: "
|
|
70
|
+
echo "-S, -standalone install for supervisord startup mode, conflict with -C"
|
|
71
|
+
echo "-C, -cluster install for systemd startup mode, conflict with -S"
|
|
72
|
+
echo "-P, -prefix specify the install path"
|
|
73
|
+
exit 0
|
|
74
|
+
;;
|
|
75
|
+
-P | -prefix)
|
|
76
|
+
case "$2" in
|
|
77
|
+
"")
|
|
78
|
+
if [ $# -eq 1 ]; then
|
|
79
|
+
break
|
|
80
|
+
else
|
|
81
|
+
shift 2
|
|
82
|
+
fi
|
|
83
|
+
;;
|
|
84
|
+
-*) shift ;;
|
|
85
|
+
*)
|
|
86
|
+
prefix=$2
|
|
87
|
+
if [ $# -eq 2 ]; then
|
|
88
|
+
break
|
|
89
|
+
else
|
|
90
|
+
shift 2
|
|
91
|
+
fi
|
|
92
|
+
;;
|
|
93
|
+
esac
|
|
94
|
+
;;
|
|
95
|
+
--)
|
|
96
|
+
shift
|
|
97
|
+
break
|
|
98
|
+
;;
|
|
99
|
+
"")
|
|
100
|
+
echo 'no args'
|
|
101
|
+
break
|
|
52
102
|
;;
|
|
53
|
-
-*) shift ;;
|
|
54
103
|
*)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
break
|
|
58
|
-
else
|
|
59
|
-
shift 2
|
|
60
|
-
fi
|
|
104
|
+
log_error "invalid parameter: {$1}"
|
|
105
|
+
exit 1
|
|
61
106
|
;;
|
|
62
107
|
esac
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
shift
|
|
66
|
-
break
|
|
67
|
-
;;
|
|
68
|
-
"")
|
|
69
|
-
echo 'no args'
|
|
70
|
-
break
|
|
71
|
-
;;
|
|
72
|
-
*)
|
|
73
|
-
log_error "invalid parameter: {$1}"
|
|
74
|
-
exit 1
|
|
75
|
-
;;
|
|
76
|
-
esac
|
|
77
|
-
done
|
|
78
|
-
fi
|
|
108
|
+
done
|
|
109
|
+
fi
|
|
79
110
|
|
|
80
|
-
if [[ -z "${mode}" ]]; then
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
fi
|
|
111
|
+
if [[ -z "${mode}" ]]; then
|
|
112
|
+
log_error "Fatal error: parameter -standalone or -cluster is required!"
|
|
113
|
+
exit 1
|
|
114
|
+
# echo "Please choose an redis installation mode!"
|
|
115
|
+
# PS3='Please input the number: '
|
|
116
|
+
# options=("Standalone 1" "Cluster 2" "Quit")
|
|
117
|
+
# select opt in "${options[@]}"; do
|
|
118
|
+
# case $opt in
|
|
119
|
+
# "Standalone 1")
|
|
120
|
+
# mode=1
|
|
121
|
+
# break
|
|
122
|
+
# ;;
|
|
123
|
+
# "Cluster 2")
|
|
124
|
+
# mode=2
|
|
125
|
+
# break
|
|
126
|
+
# ;;
|
|
127
|
+
# "Quit")
|
|
128
|
+
# break
|
|
129
|
+
# ;;
|
|
130
|
+
# *) echo "invalid option $REPLY" ;;
|
|
131
|
+
# esac
|
|
132
|
+
# done
|
|
133
|
+
fi
|
|
103
134
|
|
|
104
|
-
if ((mode == 1)); then
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
fi
|
|
135
|
+
if ((mode == 1)); then
|
|
136
|
+
log "-------------------------------------------------"
|
|
137
|
+
log "-------start to install Standalone mode-------"
|
|
138
|
+
log "-------------------------------------------------"
|
|
139
|
+
fi
|
|
109
140
|
|
|
110
|
-
if ((mode == 2)); then
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
141
|
+
if ((mode == 2)); then
|
|
142
|
+
log "-------------------------------------------------"
|
|
143
|
+
log "-------start to install Cluster mode-------"
|
|
144
|
+
log "-------------------------------------------------"
|
|
145
|
+
fi
|
|
114
146
|
fi
|
|
115
|
-
|
|
116
147
|
# echo "install/upgrade prefix: $prefix"
|
package/dist/prepare.js
CHANGED
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
7
7
|
import { logger } from './logger.js';
|
|
8
8
|
import 'picocolors';
|
|
9
9
|
|
|
10
|
-
const installMode = ["standalone", "cluster", "static", "all"];
|
|
10
|
+
const installMode = ["standalone", "cluster", "static", "all", "selectable"];
|
|
11
11
|
const NginxInstallMode = ["source", "binary"];
|
|
12
12
|
const __work_dir = process.env.INIT_CWD || process.cwd();
|
|
13
13
|
const __releaseDir = resolve(__work_dir, ".release");
|
|
@@ -37,7 +37,7 @@ const releaseConf = Object.assign({
|
|
|
37
37
|
assetsDir: "dist",
|
|
38
38
|
user: "root",
|
|
39
39
|
userGroup: "root",
|
|
40
|
-
installMode: "
|
|
40
|
+
installMode: "all",
|
|
41
41
|
installDir: "/opt",
|
|
42
42
|
nginxInstallMode: "binary",
|
|
43
43
|
dockerInstallDir: "",
|
package/dist/release.js
CHANGED
|
@@ -138,8 +138,8 @@ async function doGitFlowRelease(version) {
|
|
|
138
138
|
await execa("git commit", ["-m", `Release version: ${version}`, "--no-verify"]);
|
|
139
139
|
}
|
|
140
140
|
await execWithPipe(`git flow release finish`, [version, "-m", `Release version: ${version}`]);
|
|
141
|
-
await $`git push --all`;
|
|
142
|
-
await $`git push --tags`;
|
|
141
|
+
await $`git push --all --no-verify`;
|
|
142
|
+
await $`git push --tags --no-verify`;
|
|
143
143
|
return "master";
|
|
144
144
|
}
|
|
145
145
|
async function doCustomSpecifyBranchRelease() {
|