pindo 5.11.4 → 5.12.2
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.
- checksums.yaml +4 -4
- data/lib/pindo/base/githelper.rb +16 -0
- data/lib/pindo/base/pindocontext.rb +13 -4
- data/lib/pindo/command/android/autobuild.rb +108 -185
- data/lib/pindo/command/android/build.rb +10 -2
- data/lib/pindo/command/ios/autobuild.rb +116 -213
- data/lib/pindo/command/ios/build.rb +12 -3
- data/lib/pindo/command/jps/upload.rb +253 -118
- data/lib/pindo/command/unity/autobuild.rb +297 -227
- data/lib/pindo/command/unity.rb +0 -3
- data/lib/pindo/command/utils/boss.rb +18 -15
- data/lib/pindo/command/utils/clearcert.rb +26 -18
- data/lib/pindo/command/utils/device.rb +28 -19
- data/lib/pindo/command/utils/feishu.rb +11 -4
- data/lib/pindo/command/utils/icon.rb +26 -20
- data/lib/pindo/command/utils/renewcert.rb +35 -29
- data/lib/pindo/command/utils/renewproj.rb +32 -25
- data/lib/pindo/command/utils/repoinit.rb +1 -1
- data/lib/pindo/command/utils/tag.rb +6 -180
- data/lib/pindo/command/utils/tgate.rb +34 -28
- data/lib/pindo/command/utils/xcassets.rb +30 -20
- data/lib/pindo/command/web/autobuild.rb +148 -128
- data/lib/pindo/module/android/android_build_helper.rb +0 -6
- data/lib/pindo/module/android/android_config_helper.rb +4 -26
- data/lib/pindo/module/build/build_helper.rb +18 -294
- data/lib/pindo/module/build/git_repo_helper.rb +530 -0
- data/lib/pindo/module/build/icon_downloader.rb +85 -0
- data/lib/pindo/module/pgyer/pgyerhelper.rb +16 -11
- data/lib/pindo/module/task/model/build/android_dev_build_task.rb +209 -0
- data/lib/pindo/module/task/model/build/android_release_build_task.rb +29 -0
- data/lib/pindo/module/task/model/build/ios_adhoc_build_task.rb +53 -0
- data/lib/pindo/module/task/model/build/ios_dev_build_task.rb +251 -0
- data/lib/pindo/module/task/model/build/ios_release_build_task.rb +53 -0
- data/lib/pindo/module/task/model/build/web_dev_build_task.rb +43 -0
- data/lib/pindo/module/task/model/build_task.rb +125 -301
- data/lib/pindo/module/task/model/git_tag_task.rb +80 -0
- data/lib/pindo/module/task/model/unity_export_task.rb +53 -41
- data/lib/pindo/module/task/model/upload_task.rb +149 -208
- data/lib/pindo/module/task/pindo_task.rb +135 -95
- data/lib/pindo/module/task/task_manager.rb +202 -352
- data/lib/pindo/module/unity/unity_helper.rb +7 -3
- data/lib/pindo/module/xcode/xcode_build_config.rb +4 -10
- data/lib/pindo/module/xcode/xcode_build_helper.rb +19 -0
- data/lib/pindo/version.rb +1 -1
- metadata +10 -4
- data/lib/pindo/command/unity/apk.rb +0 -185
- data/lib/pindo/command/unity/ipa.rb +0 -198
- data/lib/pindo/command/unity/web.rb +0 -163
|
@@ -14,25 +14,28 @@ module Pindo
|
|
|
14
14
|
self.summary = '模拟iOS客户端快速查看boss的状态'
|
|
15
15
|
|
|
16
16
|
self.description = <<-DESC
|
|
17
|
-
模拟iOS客户端快速查看boss的状态工具。
|
|
17
|
+
模拟iOS客户端快速查看boss的状态工具。
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
- 模拟iOS客户端设备信息
|
|
21
|
-
- 查看boss配置状态
|
|
22
|
-
- 检查审核状态
|
|
23
|
-
- 支持自定义平台、bundle id、版本号等参数
|
|
24
|
-
- 从config.json文件自动读取配置
|
|
19
|
+
支持功能:
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
# 查看默认配置状态
|
|
28
|
-
pindo utils boss
|
|
21
|
+
* 模拟iOS客户端设备信息
|
|
29
22
|
|
|
30
|
-
|
|
31
|
-
pindo utils boss --platform="iOS_Test" --bundleid="com.example.app"
|
|
23
|
+
* 查看boss配置状态
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
* 检查审核状态
|
|
26
|
+
|
|
27
|
+
* 支持自定义平台、bundle id、版本号等参数
|
|
28
|
+
|
|
29
|
+
* 从config.json文件自动读取配置
|
|
30
|
+
|
|
31
|
+
使用示例:
|
|
32
|
+
|
|
33
|
+
$ pindo utils boss # 查看默认配置状态
|
|
34
|
+
|
|
35
|
+
$ pindo utils boss --platform="iOS_Test" --bundleid="com.example.app" # 指定平台和bundle id
|
|
36
|
+
|
|
37
|
+
$ pindo utils boss --appversion="1.0.0" --apptype="FancyApp" # 指定版本号和应用类型
|
|
38
|
+
DESC
|
|
36
39
|
|
|
37
40
|
self.arguments = [
|
|
38
41
|
|
|
@@ -12,24 +12,32 @@ module Pindo
|
|
|
12
12
|
self.summary = '清理并且删除本机中所安装的所有iOS证书'
|
|
13
13
|
|
|
14
14
|
self.description = <<-DESC
|
|
15
|
-
清理并且删除本机中所安装的所有iOS证书。
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
清理并且删除本机中所安装的所有iOS证书。
|
|
16
|
+
|
|
17
|
+
支持功能:
|
|
18
|
+
|
|
19
|
+
* 扫描系统中的所有代码签名证书
|
|
20
|
+
|
|
21
|
+
* 删除Apple Development证书
|
|
22
|
+
|
|
23
|
+
* 删除Apple Distribution证书
|
|
24
|
+
|
|
25
|
+
* 清理Provisioning Profiles文件夹
|
|
26
|
+
|
|
27
|
+
* 自动清理所有相关证书文件
|
|
28
|
+
|
|
29
|
+
使用示例:
|
|
30
|
+
|
|
31
|
+
$ pindo utils clearcert # 清理所有iOS证书
|
|
32
|
+
|
|
33
|
+
注意事项:
|
|
34
|
+
|
|
35
|
+
* 该操作不可逆,请谨慎操作
|
|
36
|
+
|
|
37
|
+
* 建议在清理前备份重要证书
|
|
38
|
+
|
|
39
|
+
* 清理后需要重新下载或安装证书
|
|
40
|
+
DESC
|
|
33
41
|
|
|
34
42
|
|
|
35
43
|
self.arguments = [
|
|
@@ -12,25 +12,34 @@ module Pindo
|
|
|
12
12
|
self.summary = '同步开发者账号中测试设备udid'
|
|
13
13
|
|
|
14
14
|
self.description = <<-DESC
|
|
15
|
-
同步开发者账号中测试设备udid管理工具。
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
同步开发者账号中测试设备udid管理工具。
|
|
16
|
+
|
|
17
|
+
支持功能:
|
|
18
|
+
|
|
19
|
+
* 从开发者账号获取所有设备信息
|
|
20
|
+
|
|
21
|
+
* 支持iOS和Mac设备管理
|
|
22
|
+
|
|
23
|
+
* 读取本地CSV文件的设备数据
|
|
24
|
+
|
|
25
|
+
* 生成多种格式的设备列表
|
|
26
|
+
|
|
27
|
+
* 兼容JPS平台的设备格式
|
|
28
|
+
|
|
29
|
+
* 设备信息统一管理和对比
|
|
30
|
+
|
|
31
|
+
使用示例:
|
|
32
|
+
|
|
33
|
+
$ pindo utils device # 同步并生成设备列表
|
|
34
|
+
|
|
35
|
+
生成文件:
|
|
36
|
+
|
|
37
|
+
* new_devices_list.txt - App Store格式的设备列表
|
|
38
|
+
|
|
39
|
+
* new_user_devices_list.csv - 用户设备列表
|
|
40
|
+
|
|
41
|
+
* new_jps_devices_list.csv - JPS格式设备列表
|
|
42
|
+
DESC
|
|
34
43
|
|
|
35
44
|
class DeviceItem
|
|
36
45
|
|
|
@@ -2,6 +2,7 @@ require 'highline/import'
|
|
|
2
2
|
require 'fileutils'
|
|
3
3
|
require 'pindo/client/feishuclient'
|
|
4
4
|
require 'pindo/module/build/build_helper'
|
|
5
|
+
require 'pindo/module/build/git_repo_helper'
|
|
5
6
|
require 'pindo/module/pgyer/pgyerhelper'
|
|
6
7
|
|
|
7
8
|
module Pindo
|
|
@@ -96,11 +97,17 @@ module Pindo
|
|
|
96
97
|
puts "正在发送飞书消息..."
|
|
97
98
|
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
is_need_add_tag,tag_action_parms =
|
|
100
|
+
git_repo_helper = Pindo::GitRepoHelper.share_instance
|
|
101
|
+
git_repo_helper.check_check_and_install_cliff(pindo_project_dir)
|
|
102
|
+
is_need_add_tag, tag_action_parms = git_repo_helper.check_is_need_add_tag?(pindo_project_dir)
|
|
102
103
|
if is_need_add_tag
|
|
103
|
-
|
|
104
|
+
git_repo_helper.create_and_push_tag(
|
|
105
|
+
project_dir: pindo_project_dir,
|
|
106
|
+
mode: 'minor',
|
|
107
|
+
force_retag: tag_action_parms&.include?('--retag') || false,
|
|
108
|
+
custom_tag: nil,
|
|
109
|
+
release_branch: 'master'
|
|
110
|
+
)
|
|
104
111
|
end
|
|
105
112
|
|
|
106
113
|
unless @webhook_url.nil? || @webhook_url.empty?
|
|
@@ -17,26 +17,32 @@ module Pindo
|
|
|
17
17
|
self.summary = '根据1024*1024icon生成Xcode标准icon文件'
|
|
18
18
|
|
|
19
19
|
self.description = <<-DESC
|
|
20
|
-
根据1024*1024像素的原图icon生成Xcode标准icon文件集。
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
根据1024*1024像素的原图icon生成Xcode标准icon文件集。
|
|
21
|
+
|
|
22
|
+
支持功能:
|
|
23
|
+
|
|
24
|
+
* 从单个1024x1024像素图片生成全套iOS icon
|
|
25
|
+
|
|
26
|
+
* 自动生成各种尺寸的icon文件
|
|
27
|
+
|
|
28
|
+
* 支持直接安装到Xcode工程中
|
|
29
|
+
|
|
30
|
+
* 使用sips工具进行高质量缩放
|
|
31
|
+
|
|
32
|
+
* 自动创建时间戳命名的输出文件夹
|
|
33
|
+
|
|
34
|
+
使用示例:
|
|
35
|
+
|
|
36
|
+
$ pindo utils icon path/to/demo.png # 生成icon文件夹
|
|
37
|
+
|
|
38
|
+
$ pindo utils icon path/to/demo.png --install # 生成并直接安装到Xcode工程
|
|
39
|
+
|
|
40
|
+
注意事项:
|
|
41
|
+
|
|
42
|
+
* 输入图片必须为1024x1024像素
|
|
43
|
+
|
|
44
|
+
* 支持PNG、JPG等常见图片格式
|
|
45
|
+
DESC
|
|
40
46
|
|
|
41
47
|
|
|
42
48
|
self.arguments = [
|
|
@@ -10,37 +10,43 @@ module Pindo
|
|
|
10
10
|
include Appselect
|
|
11
11
|
include XcodeCertHelper
|
|
12
12
|
|
|
13
|
-
self.summary = '
|
|
13
|
+
self.summary = '重新创建当前账号下所有的Provisioning Profile文件'
|
|
14
14
|
|
|
15
15
|
self.description = <<-DESC
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
16
|
+
重新创建当前账号下所有的Provisioning Profile文件。
|
|
17
|
+
|
|
18
|
+
支持功能:
|
|
19
|
+
|
|
20
|
+
* 自动检测和生成缺失的证书
|
|
21
|
+
|
|
22
|
+
* 重新生成所有Provisioning Profile文件
|
|
23
|
+
|
|
24
|
+
* 支持开发、测试、发布等多种证书类型
|
|
25
|
+
|
|
26
|
+
* 支持快速模式,只更新必要的证书
|
|
27
|
+
|
|
28
|
+
* 自动处理bundle id功能性更新
|
|
29
|
+
|
|
30
|
+
* 支持生成上传测试平台的证书
|
|
31
|
+
|
|
32
|
+
使用示例:
|
|
33
|
+
|
|
34
|
+
$ pindo utils renewcert # 全量更新所有证书
|
|
35
|
+
|
|
36
|
+
$ pindo utils renewcert --fast # 快速模式,只更新必要的证书
|
|
37
|
+
|
|
38
|
+
$ pindo utils renewcert --renew --fixedid # 重新生成证书并修复bundle id功能
|
|
39
|
+
|
|
40
|
+
$ pindo utils renewcert --upload # 生成上传测试平台的证书
|
|
41
|
+
|
|
42
|
+
注意事项:
|
|
43
|
+
|
|
44
|
+
* 该操作会影响所有相关证书,请谨慎使用
|
|
45
|
+
|
|
46
|
+
* 确保已登录Apple Developer账号
|
|
47
|
+
|
|
48
|
+
* 建议在添加新设备或证书过期时使用
|
|
49
|
+
DESC
|
|
44
50
|
|
|
45
51
|
self.arguments = [
|
|
46
52
|
|
|
@@ -15,31 +15,38 @@ module Pindo
|
|
|
15
15
|
self.summary = '重新创建Xcode工程'
|
|
16
16
|
|
|
17
17
|
self.description = <<-DESC
|
|
18
|
-
重新创建Xcode工程的高级工具。
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
18
|
+
重新创建Xcode工程的高级工具。
|
|
19
|
+
|
|
20
|
+
支持功能:
|
|
21
|
+
|
|
22
|
+
* 从现有Xcode工程创建全新的工程
|
|
23
|
+
|
|
24
|
+
* 保持原有的文件结构和配置
|
|
25
|
+
|
|
26
|
+
* 自动复制源代码和资源文件
|
|
27
|
+
|
|
28
|
+
* 重新配置目标和构建设置
|
|
29
|
+
|
|
30
|
+
* 支持自定义工程名称
|
|
31
|
+
|
|
32
|
+
* 自动处理CocoaPods集成
|
|
33
|
+
|
|
34
|
+
使用示例:
|
|
35
|
+
|
|
36
|
+
$ pindo utils renewproj config.json # 使用配置文件中的项目名
|
|
37
|
+
|
|
38
|
+
$ pindo utils renewproj config.json --n="NewProjectName" # 指定新的项目名
|
|
39
|
+
|
|
40
|
+
$ pindo utils renewproj config.json --nocreate # 仅更新现有工程,不创建新工程
|
|
41
|
+
|
|
42
|
+
注意事项:
|
|
43
|
+
|
|
44
|
+
* 操作前请备份原有工程
|
|
45
|
+
|
|
46
|
+
* 新工程将会创建在上级目录中
|
|
47
|
+
|
|
48
|
+
* 操作完成后需要重新执行pod install
|
|
49
|
+
DESC
|
|
43
50
|
|
|
44
51
|
self.arguments = [
|
|
45
52
|
CLAide::Argument.new('path/to/config.json', true),
|
|
@@ -50,7 +50,7 @@ module Pindo
|
|
|
50
50
|
|
|
51
51
|
pindo_project_dir = Dir.pwd
|
|
52
52
|
build_helper = Pindo::BuildHelper.share_instance
|
|
53
|
-
|
|
53
|
+
Pindo::GitRepoHelper.share_instance.check_check_and_install_cliff(pindo_project_dir)
|
|
54
54
|
|
|
55
55
|
end
|
|
56
56
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'highline/import'
|
|
2
2
|
require 'fileutils'
|
|
3
|
+
require 'pindo/module/build/git_repo_helper'
|
|
3
4
|
|
|
4
5
|
module Pindo
|
|
5
6
|
class Command
|
|
@@ -61,190 +62,15 @@ module Pindo
|
|
|
61
62
|
|
|
62
63
|
def run
|
|
63
64
|
current_project_dir = Dir.pwd
|
|
64
|
-
puts current_project_dir
|
|
65
|
-
# 检查当前目录是否是git仓库
|
|
66
|
-
unless is_git_directory?(local_repo_dir: current_project_dir)
|
|
67
65
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
# 获取git仓库根目录
|
|
73
|
-
root_dir = git_root_directory(local_repo_dir: current_project_dir)
|
|
74
|
-
if root_dir.nil?
|
|
75
|
-
Funlog.instance.fancyinfo_error("无法获取git仓库根目录")
|
|
76
|
-
raise Informative, "获取git仓库根目录失败"
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
release_branch = "master"
|
|
82
|
-
process_need_add_files(project_dir: root_dir)
|
|
83
|
-
|
|
84
|
-
current_branch = git!(%W(-C #{root_dir} rev-parse --abbrev-ref HEAD)).strip
|
|
85
|
-
coding_branch = current_branch
|
|
86
|
-
|
|
87
|
-
Funlog.instance.fancyinfo_start("开始合并到#{release_branch}分支")
|
|
88
|
-
merge_to_release_branch(
|
|
89
|
-
project_dir: root_dir,
|
|
90
|
-
release_branch: release_branch,
|
|
91
|
-
coding_branch: coding_branch
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
add_release_tag(
|
|
95
|
-
project_dir: root_dir,
|
|
96
|
-
increment_mode: @mode,
|
|
66
|
+
GitRepoHelper.share_instance.create_and_push_tag(
|
|
67
|
+
project_dir: current_project_dir,
|
|
68
|
+
mode: @mode,
|
|
97
69
|
force_retag: @force_retag,
|
|
98
|
-
custom_tag: @custom_tag
|
|
70
|
+
custom_tag: @custom_tag,
|
|
71
|
+
release_branch: 'master'
|
|
99
72
|
)
|
|
100
73
|
end
|
|
101
|
-
|
|
102
|
-
def add_release_tag(project_dir: nil, increment_mode: "minor", force_retag: false, custom_tag: nil)
|
|
103
|
-
raise ArgumentError, "项目目录不能为空" if project_dir.nil?
|
|
104
|
-
|
|
105
|
-
# 如果指定了自定义tag,直接使用
|
|
106
|
-
if custom_tag && !custom_tag.empty?
|
|
107
|
-
Funlog.instance.fancyinfo_start("使用指定的tag版本: #{custom_tag}")
|
|
108
|
-
|
|
109
|
-
# 确保tag有v前缀
|
|
110
|
-
new_tag = custom_tag.start_with?('v') ? custom_tag : "v#{custom_tag}"
|
|
111
|
-
|
|
112
|
-
# 检查tag是否已存在
|
|
113
|
-
existing_tags = git!(%W(-C #{project_dir} tag -l)).split("\n")
|
|
114
|
-
if existing_tags.include?(new_tag)
|
|
115
|
-
if force_retag
|
|
116
|
-
Funlog.instance.fancyinfo_update("tag #{new_tag} 已存在,强制重新打tag")
|
|
117
|
-
git!(%W(-C #{project_dir} tag -d #{new_tag}))
|
|
118
|
-
git!(%W(-C #{project_dir} push origin :refs/tags/#{new_tag}))
|
|
119
|
-
else
|
|
120
|
-
Funlog.instance.fancyinfo_success("tag #{new_tag} 已存在")
|
|
121
|
-
Funlog.instance.fancyinfo_success("仓库路径: #{project_dir}")
|
|
122
|
-
return
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
# 创建tag并推送
|
|
127
|
-
git!(%W(-C #{project_dir} tag #{new_tag}))
|
|
128
|
-
git!(%W(-C #{project_dir} push origin #{new_tag}))
|
|
129
|
-
|
|
130
|
-
Funlog.instance.fancyinfo_success("创建tag: #{new_tag}")
|
|
131
|
-
Funlog.instance.fancyinfo_success("仓库路径: #{project_dir}")
|
|
132
|
-
return
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
# 原有的自动递增逻辑
|
|
136
|
-
Funlog.instance.fancyinfo_start("开始创建初tag")
|
|
137
|
-
latest_tag = get_latest_version_tag(project_dir: project_dir)
|
|
138
|
-
if latest_tag.nil?
|
|
139
|
-
new_tag = create_next_version_tag(
|
|
140
|
-
project_dir: project_dir,
|
|
141
|
-
tag_prefix: "v",
|
|
142
|
-
increment_mode: increment_mode,
|
|
143
|
-
force_retag: false
|
|
144
|
-
)
|
|
145
|
-
Funlog.instance.fancyinfo_success("创建初始tag: #{new_tag}")
|
|
146
|
-
Funlog.instance.fancyinfo_success("仓库路径: #{project_dir}")
|
|
147
|
-
return
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
if is_tag_at_head?(git_root_dir: project_dir, tag_name: latest_tag)
|
|
151
|
-
Funlog.instance.fancyinfo_success("当前commit已有tag: #{latest_tag},无需重新打tag")
|
|
152
|
-
Funlog.instance.fancyinfo_success("仓库路径: #{project_dir}")
|
|
153
|
-
return
|
|
154
|
-
end
|
|
155
|
-
|
|
156
|
-
Funlog.instance.fancyinfo_success("最近的上次tag是: #{latest_tag} ")
|
|
157
|
-
new_tag = create_next_version_tag(
|
|
158
|
-
project_dir: project_dir,
|
|
159
|
-
tag_prefix: "v",
|
|
160
|
-
increment_mode: increment_mode,
|
|
161
|
-
force_retag: force_retag
|
|
162
|
-
)
|
|
163
|
-
|
|
164
|
-
Funlog.instance.fancyinfo_success("当前仓库的tag: #{new_tag}")
|
|
165
|
-
Funlog.instance.fancyinfo_success("仓库路径: #{project_dir}")
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
def merge_to_release_branch(project_dir: nil, release_branch: nil, coding_branch: nil)
|
|
169
|
-
current_project_dir = project_dir
|
|
170
|
-
Funlog.instance.fancyinfo_start("开始合并到#{release_branch}分支")
|
|
171
|
-
if !coding_branch.eql?(release_branch)
|
|
172
|
-
coding_branch_commit_id = git!(%W(-C #{current_project_dir} rev-parse #{coding_branch})).strip
|
|
173
|
-
release_branch_commit_id = nil
|
|
174
|
-
|
|
175
|
-
if remote_branch_exists?(local_repo_dir: current_project_dir, branch: release_branch)
|
|
176
|
-
Funlog.instance.fancyinfo_update("存在#{release_branch}远程分支")
|
|
177
|
-
if local_branch_exists?(local_repo_dir: current_project_dir, branch: release_branch)
|
|
178
|
-
Funlog.instance.fancyinfo_update("存在#{release_branch}本地分支")
|
|
179
|
-
git!(%W(-C #{current_project_dir} checkout #{release_branch}))
|
|
180
|
-
else
|
|
181
|
-
Funlog.instance.fancyinfo_update("不存在#{release_branch}本地分支")
|
|
182
|
-
git!(%W(-C #{current_project_dir} checkout -b #{release_branch} origin/#{release_branch}))
|
|
183
|
-
end
|
|
184
|
-
|
|
185
|
-
git!(%W(-C #{current_project_dir} branch --set-upstream-to=origin/#{release_branch} #{release_branch}))
|
|
186
|
-
git!(%W(-C #{current_project_dir} fetch origin #{release_branch}))
|
|
187
|
-
git!(%W(-C #{current_project_dir} merge origin/#{release_branch}))
|
|
188
|
-
|
|
189
|
-
# 执行合并操作,捕获输出以便后续检查冲突
|
|
190
|
-
stdout, exit_status = Executable.capture_command('git', %W(-C #{current_project_dir} merge #{coding_branch}), :capture => :out)
|
|
191
|
-
|
|
192
|
-
# 检查是否有冲突(git merge 在有冲突时返回非0状态)
|
|
193
|
-
conflict_filelist = git!(%W(-C #{current_project_dir} diff --name-only --diff-filter=U --relative))
|
|
194
|
-
if !conflict_filelist.nil? && conflict_filelist.size > 0
|
|
195
|
-
puts "合并代码冲突, 冲突文件如下:"
|
|
196
|
-
raise Informative, "请手动处理冲突的文件!!!"
|
|
197
|
-
else
|
|
198
|
-
git!(%W(-C #{current_project_dir} push))
|
|
199
|
-
Funlog.instance.fancyinfo_success("代码已经合并到#{release_branch}分支")
|
|
200
|
-
# 获取 release_branch 的 commit ID(处理空分支情况)
|
|
201
|
-
begin
|
|
202
|
-
release_branch_commit_id = git!(%W(-C #{current_project_dir} rev-parse #{release_branch})).strip
|
|
203
|
-
rescue => e
|
|
204
|
-
# 分支可能存在但没有提交(空分支),此时使用 coding_branch 的 commit
|
|
205
|
-
Funlog.instance.fancyinfo_update("#{release_branch}分支为空或获取commit失败,将使用当前分支commit")
|
|
206
|
-
release_branch_commit_id = coding_branch_commit_id
|
|
207
|
-
end
|
|
208
|
-
end
|
|
209
|
-
|
|
210
|
-
else
|
|
211
|
-
if local_branch_exists?(local_repo_dir: current_project_dir, branch: release_branch)
|
|
212
|
-
Funlog.instance.fancyinfo_update("不存在#{release_branch}远程分支")
|
|
213
|
-
Funlog.instance.fancyinfo_update("存在#{release_branch}本地分支")
|
|
214
|
-
git!(%W(-C #{current_project_dir} checkout #{release_branch}))
|
|
215
|
-
git!(%W(-C #{current_project_dir} checkout -b #{release_branch}_temp))
|
|
216
|
-
git!(%W(-C #{current_project_dir} checkout #{coding_branch}))
|
|
217
|
-
git!(%W(-C #{current_project_dir} branch -D #{release_branch}))
|
|
218
|
-
else
|
|
219
|
-
Funlog.instance.fancyinfo_update("不存在#{release_branch}远程分支")
|
|
220
|
-
Funlog.instance.fancyinfo_update("不存在#{release_branch}本地分支")
|
|
221
|
-
end
|
|
222
|
-
|
|
223
|
-
git!(%W(-C #{current_project_dir} checkout -b #{release_branch}))
|
|
224
|
-
git!(%W(-C #{current_project_dir} push origin #{release_branch}))
|
|
225
|
-
git!(%W(-C #{current_project_dir} branch --set-upstream-to=origin/#{release_branch} #{release_branch}))
|
|
226
|
-
|
|
227
|
-
Funlog.instance.fancyinfo_success("代码已经合并到#{release_branch}分支")
|
|
228
|
-
# 获取 release_branch 的 commit ID(处理空分支情况)
|
|
229
|
-
begin
|
|
230
|
-
release_branch_commit_id = git!(%W(-C #{current_project_dir} rev-parse #{release_branch})).strip
|
|
231
|
-
rescue => e
|
|
232
|
-
# 新创建的分支,commit ID 应该与 coding_branch 相同
|
|
233
|
-
release_branch_commit_id = coding_branch_commit_id
|
|
234
|
-
end
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
git!(%W(-C #{current_project_dir} checkout #{coding_branch}))
|
|
238
|
-
if release_branch_commit_id && !release_branch_commit_id.eql?(coding_branch_commit_id)
|
|
239
|
-
git!(%W(-C #{current_project_dir} merge #{release_branch}))
|
|
240
|
-
Funlog.instance.fancyinfo_success("已将#{release_branch}合并到#{coding_branch}")
|
|
241
|
-
end
|
|
242
|
-
git!(%W(-C #{current_project_dir} push origin #{coding_branch}))
|
|
243
|
-
Funlog.instance.fancyinfo_success("已推送#{coding_branch}分支到远程")
|
|
244
|
-
else
|
|
245
|
-
Funlog.instance.fancyinfo_success("代码处于#{coding_branch}分支,无需合并")
|
|
246
|
-
end
|
|
247
|
-
end
|
|
248
74
|
end
|
|
249
75
|
end
|
|
250
76
|
end
|
|
@@ -16,34 +16,40 @@ module Pindo
|
|
|
16
16
|
self.summary = 'tGate的命令行终端工具'
|
|
17
17
|
|
|
18
18
|
self.description = <<-DESC
|
|
19
|
-
tGate门控系统的命令行管理工具。
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
19
|
+
tGate门控系统的命令行管理工具。
|
|
20
|
+
|
|
21
|
+
支持功能:
|
|
22
|
+
|
|
23
|
+
* 查看当前设备在tGate系统中的状态
|
|
24
|
+
|
|
25
|
+
* 修改IP地址的白名单/黑名单状态
|
|
26
|
+
|
|
27
|
+
* 修改设备的白名单/黑名单状态
|
|
28
|
+
|
|
29
|
+
* 支持dev和prod环境切换
|
|
30
|
+
|
|
31
|
+
* 支持多种设备标识符(deviceid, idfa, sbsid等)
|
|
32
|
+
|
|
33
|
+
* 实时查看门控状态变化
|
|
34
|
+
|
|
35
|
+
使用示例:
|
|
36
|
+
|
|
37
|
+
$ pindo utils tgate --env=dev --type=device --deviceid=XXX-XX # 查看当前设备状态
|
|
38
|
+
|
|
39
|
+
$ pindo utils tgate --env=dev --type=ip --status=super_white # 设置IP为超级白名单
|
|
40
|
+
|
|
41
|
+
$ pindo utils tgate --env=prod --type=device --status=black --deviceid=ABC-123 # 设置设备为黑名单
|
|
42
|
+
|
|
43
|
+
$ pindo utils tgate --env=dev --type=ip --status=normal # 恢复正常状态
|
|
44
|
+
|
|
45
|
+
参数说明:
|
|
46
|
+
|
|
47
|
+
* env: dev/prod (环境)
|
|
48
|
+
|
|
49
|
+
* type: ip/device (类型)
|
|
50
|
+
|
|
51
|
+
* status: normal/black/super_white (状态)
|
|
52
|
+
DESC
|
|
47
53
|
|
|
48
54
|
self.arguments = [
|
|
49
55
|
|