lhj-tools 0.1.38 → 0.1.41
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/lhj/command/code/template/dispatch_source.erb +1 -1
- data/lib/lhj/command/jenkins_build.rb +37 -0
- data/lib/lhj/command/oss/del.rb +0 -1
- data/lib/lhj/command/oss/download.rb +0 -1
- data/lib/lhj/command/oss/list.rb +0 -1
- data/lib/lhj/command/oss/upload.rb +0 -1
- data/lib/lhj/command/oss.rb +0 -1
- data/lib/lhj/command.rb +1 -0
- data/lib/lhj/helper/pgyer_helper.rb +11 -1
- data/lib/lhj/tools/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c8fa90967ee885cff64ed4b4d175cf1178919449b42aa8e644ad5fedf17386de
|
|
4
|
+
data.tar.gz: 750834e640eb75b5653e4f9639dc9b09bf5c320ac34bf721ab637f881729fc08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b08ab0ab7d6bb7ac5fe0e38bd823032779370b4e6265444db96f691078502d10c199656297b7190f1eaa1be92a76c701f6ec1c467aede28c49464853ccb1add1
|
|
7
|
+
data.tar.gz: 1a546488cdfca768c14599022da2d80cb5eca23a272d71fbc75b879b74a2f9d99d9574afae62316fad2cd7ebd54010a001396219a5b42eec7f065ba87f09d6cc
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
dispatch_source_set_timer(self.timer, DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC, 0);
|
|
22
22
|
__weak __typeof(self)weakSelf = self;
|
|
23
23
|
dispatch_source_set_event_handler(self.timer, ^{
|
|
24
|
-
if(weakSelf.leftTime <= 0){
|
|
24
|
+
if(weakSelf.leftTime <= 0){
|
|
25
25
|
[[NSNotificationCenter defaultCenter] postNotificationName:kOrderTimerFinishedNotification object:nil];
|
|
26
26
|
dispatch_source_cancel(weakSelf.timer);
|
|
27
27
|
}else{
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
module Lhj
|
|
3
|
+
class Command
|
|
4
|
+
class JenkinsBuild < Command
|
|
5
|
+
self.summary = '执行jenkins的build任务'
|
|
6
|
+
|
|
7
|
+
self.arguments = [
|
|
8
|
+
CLAide::Argument.new('--server_url=http://www.jenkins.com', true),
|
|
9
|
+
CLAide::Argument.new('--job=job1', true)
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
def self.options
|
|
13
|
+
[
|
|
14
|
+
%w[--server_url jenkins的地址],
|
|
15
|
+
%w[--job 运行的任务名]
|
|
16
|
+
]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def validate!
|
|
20
|
+
super
|
|
21
|
+
help! '输入jenkins的地址' unless @server_url
|
|
22
|
+
help! '输入任务名' unless @job
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def initialize(argv)
|
|
26
|
+
@server_url = argv.option('server_url')
|
|
27
|
+
@job = argv.option('job')
|
|
28
|
+
super
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def handle
|
|
32
|
+
client = Lhj::JenkinsApi::Client.new(:server_url => @server_url)
|
|
33
|
+
client.job.build(@job)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
data/lib/lhj/command/oss/del.rb
CHANGED
data/lib/lhj/command/oss/list.rb
CHANGED
data/lib/lhj/command/oss.rb
CHANGED
data/lib/lhj/command.rb
CHANGED
|
@@ -18,6 +18,7 @@ module Lhj
|
|
|
18
18
|
@api_key = Lhj::PgyerConfig.api_key(env)
|
|
19
19
|
@user_key = Lhj::PgyerConfig.user_key(env)
|
|
20
20
|
@password = Lhj::PgyerConfig.password(env)
|
|
21
|
+
@env = env
|
|
21
22
|
@result = { 'data' => {} }
|
|
22
23
|
end
|
|
23
24
|
|
|
@@ -38,7 +39,6 @@ module Lhj
|
|
|
38
39
|
end
|
|
39
40
|
|
|
40
41
|
def upload_file(file, des)
|
|
41
|
-
|
|
42
42
|
update_description = @result[:update_description]
|
|
43
43
|
update_description = '' if update_description.nil?
|
|
44
44
|
params = {
|
|
@@ -49,6 +49,7 @@ module Lhj
|
|
|
49
49
|
'installType' => 2,
|
|
50
50
|
'file' => Faraday::UploadIO.new(file, 'application/octet-stream')
|
|
51
51
|
}
|
|
52
|
+
upload_code
|
|
52
53
|
begin
|
|
53
54
|
puts 'begin upload...'
|
|
54
55
|
response = http_client.post API_HOST, params
|
|
@@ -65,6 +66,15 @@ module Lhj
|
|
|
65
66
|
end
|
|
66
67
|
end
|
|
67
68
|
|
|
69
|
+
def upload_code
|
|
70
|
+
if @env == :release
|
|
71
|
+
# packing
|
|
72
|
+
current_dir = File.dirname(__FILE__)
|
|
73
|
+
puts current_dir
|
|
74
|
+
# upload to oss
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
68
78
|
def render_template
|
|
69
79
|
temp_str = File.read(File.join(Lhj::Config.instance.home_dir, 'pgyer.erb'))
|
|
70
80
|
Lhj::ErbFormatter::Service.new(self).render_template(temp_str)
|
data/lib/lhj/tools/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lhj-tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.41
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- lihaijian
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-05-
|
|
11
|
+
date: 2022-05-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: claide
|
|
@@ -305,6 +305,7 @@ files:
|
|
|
305
305
|
- lib/lhj/command/head_import.rb
|
|
306
306
|
- lib/lhj/command/http.rb
|
|
307
307
|
- lib/lhj/command/init.rb
|
|
308
|
+
- lib/lhj/command/jenkins_build.rb
|
|
308
309
|
- lib/lhj/command/local/fetch.rb
|
|
309
310
|
- lib/lhj/command/local/filter.rb
|
|
310
311
|
- lib/lhj/command/local/local.rb
|