easyci 0.3.0 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c686b87933dc1724fa1b664bde3a3a69788538a90e517fe24c61dc0b78707403
4
- data.tar.gz: 3c3d61196ddcf011c0bf7ff8ae4b1fac6f48ee466f1a878059bfa26d41a1c296
3
+ metadata.gz: 927c11e2ae3813933d519a94a1aa87829c8533531ea18e1b5f19918940d270d0
4
+ data.tar.gz: 7812db007b9d28d84b2cfdadadb5dcfa89e7187afda561ac2670f001e69c839e
5
5
  SHA512:
6
- metadata.gz: ef0ca99b8cd089f7c3c82f0f92cf139e415b271efcffdd7544b5ecba373442202c8849ce9ec94e5c4808612bb4e106c992d2f6ca83ca60ffc94deddbd81dbce5
7
- data.tar.gz: c2c66fb63fca23ab8d4439c19ef75bf51796d9c6dc95aad5ff53d0298edcfdae6a9102a9fac1bea6c4db44796ba699f4a6bb6374ac973d2528d36d3dcadfab7c
6
+ metadata.gz: c07ea450495999224cdf041ec0b7b043744fcf97255939f130a8ff81b093a07f6b821cbd500a81dc3b31646c4ffc19d14d3efdc8631fa07a163d1862d385f468
7
+ data.tar.gz: b4bebdd9becd4cef79a218ae782a92613ec60fa39b179b355ec0c4ce04a392b98cab01795a597d98046bb07bf32cd128a74b7b417c608b11db1f699402e7e69c
@@ -9,12 +9,14 @@ module EasyCI
9
9
  def self.options
10
10
  [
11
11
  ['--runner-repo=REPO', 'Runner仓库路径,例如:mygroup/FGUIWorkRunner'],
12
+ ['--https', '使用HTTPS方式克隆仓库,默认使用SSH方式'],
12
13
  ].concat(super)
13
14
  end
14
15
 
15
16
  def initialize(argv)
16
17
  super
17
18
  @runner_repo = argv.option('runner-repo')
19
+ @use_https = argv.flag?('https', false)
18
20
  end
19
21
 
20
22
  def validate!
@@ -28,10 +30,8 @@ module EasyCI
28
30
  gitee_repo = ENV['GITEE_REPO'] || 'fundesignexport/MagicSortDemoDesignExport'
29
31
  gitee_branch = ENV['GITEE_BRANCH'] || 'master'
30
32
 
31
- if @runner_repo.empty?
32
- puts "runner-repo 不能为空"
33
- exit 1
34
- end
33
+ # 如果未提供runner-repo参数,使用默认值
34
+ @runner_repo ||= ENV['GITEE_REPO'] || 'bestwebprimary/FGUIWorkRunner'
35
35
 
36
36
  if gitee_repo.empty? || gitee_branch.empty?
37
37
  puts "GITEE_REPO 和 GITEE_BRANCH 不能为空"
@@ -47,7 +47,9 @@ module EasyCI
47
47
  FileUtils.mkdir_p(work_dir)
48
48
  runner_dir = File.join(work_dir, 'FGUIWorkRunner')
49
49
  FileUtils.rm_rf(runner_dir) if File.exist?(runner_dir)
50
- clone_runner_result = system("cd #{work_dir} && git clone --depth 1 -b dev https://gitee.com/#{@runner_repo}.git FGUIWorkRunner")
50
+ git_url = @use_https ? "https://gitee.com/#{@runner_repo}.git" : "git@gitee.com:#{@runner_repo}.git"
51
+ puts "git_url: #{git_url}"
52
+ clone_runner_result = system("cd #{work_dir} && git clone --depth 1 -b #{gitee_branch} #{git_url} FGUIWorkRunner")
51
53
  unless clone_runner_result
52
54
  puts "克隆Runner仓库失败,请检查网络和权限设置"
53
55
  exit 1
@@ -63,18 +65,20 @@ module EasyCI
63
65
  FileUtils.rm_rf(resources_dir)
64
66
  end
65
67
  puts "下载截图仓库..."
66
- clone_result = system("cd #{runner_dir} && git clone --depth 1 -b #{gitee_branch} https://gitee.com/#{gitee_repo}.git Assets/Resources")
67
-
68
+ git_url = @use_https ? "https://gitee.com/#{gitee_repo}.git" : "git@gitee.com:#{gitee_repo}.git"
69
+ puts "git_url: #{git_url}"
70
+ clone_result = system("cd #{runner_dir} && git clone --depth 1 -b #{gitee_branch} #{git_url} Assets/Resources")
71
+
68
72
  unless clone_result
69
73
  puts "克隆Assets仓库失败,请检查网络和权限设置"
70
74
  exit 1
71
75
  end
72
76
 
73
77
  # 运行Unity截图任务
74
- puts "运行Unity截图任务..."
75
78
  unity_path = find_unity_path(runner_dir)
79
+ puts "运行Unity截图任务..."
76
80
  FileUtils.chdir(runner_dir)
77
- system("#{unity_path} -projectPath . -executeMethod #{@execute_method} -logFile screenshot-log.txt")
81
+ system("#{unity_path} -projectPath . -executeMethod SpineAutoImporter.CIRunner -logFile screenshot-log.txt")
78
82
 
79
83
  # 压缩截图
80
84
  puts "开始压缩截图..."
@@ -1,3 +1,3 @@
1
1
  module EasyCI
2
- VERSION = '0.3.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wade