lhj-tools 0.1.37 → 0.1.40
Sign up to get free protection for your applications and to get access to all the features.
- 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 +37 -0
- 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 +2 -0
- data/lib/lhj/tools/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ece2424980560cc08874ad875b48bbe10430ac55004ab9e1a1999d7b3fd2595b
|
4
|
+
data.tar.gz: 353552a9c1da8537b64befffeae9bcb9b89d86c1a1d9e70f0545933ef105eb68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54b3713b1593883316dade8c04e69ad7b97de6fcc1e70c457fb61b6732cf907f3ecae44bd5281db9470e3632d533a76a03968dd342ac9863e903dcb78bd68f11
|
7
|
+
data.tar.gz: 4c11133c0fdfddf32b1f87fbcd9b0d669b35740b4d8ae3c2b9f488316afb454630779ca2121943776575da7b2f46d1759195fa9cc02f75ea732042e8218f1b03
|
@@ -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
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
# frozen_string_literal: true
|
3
|
+
require 'lhj/helper/oss_helper'
|
4
|
+
require 'highline'
|
5
|
+
|
6
|
+
module Lhj
|
7
|
+
class Command
|
8
|
+
class OSS < Command
|
9
|
+
class Download < OSS
|
10
|
+
|
11
|
+
def initialize(argv)
|
12
|
+
@current_path = argv.shift_argument || Dir.pwd
|
13
|
+
@cli = HighLine.new
|
14
|
+
super
|
15
|
+
end
|
16
|
+
|
17
|
+
def handle
|
18
|
+
objects = Lhj::OSS::Helper.instance.list
|
19
|
+
obj_keys = []
|
20
|
+
objects.each_with_index do |o, i|
|
21
|
+
obj_keys << o.key
|
22
|
+
puts "#{i}.#{o.key}".yellow
|
23
|
+
end
|
24
|
+
idx = @cli.ask('请选择下载的序号: '.green).strip.to_i
|
25
|
+
oss_key = obj_keys[idx]
|
26
|
+
puts "下载的key为:#{oss_key}".yellow
|
27
|
+
|
28
|
+
file_key = oss_key.split('/').last
|
29
|
+
file = File.join(@current_path, file_key)
|
30
|
+
Lhj::OSS::Helper.instance.down_load(oss_key, file)
|
31
|
+
puts "下载文件到目录: #{file}\n".yellow
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/lhj/command/oss/list.rb
CHANGED
data/lib/lhj/command/oss.rb
CHANGED
data/lib/lhj/command.rb
CHANGED
@@ -17,6 +17,7 @@ module Lhj
|
|
17
17
|
require 'lhj/command/oss/del'
|
18
18
|
require 'lhj/command/oss/upload'
|
19
19
|
require 'lhj/command/oss/list'
|
20
|
+
require 'lhj/command/oss/download'
|
20
21
|
require 'lhj/command/code/view'
|
21
22
|
require 'lhj/command/code/code_template'
|
22
23
|
require 'lhj/command/rename_image'
|
@@ -28,6 +29,7 @@ module Lhj
|
|
28
29
|
require 'lhj/command/sync_pod_version'
|
29
30
|
require 'lhj/command/pgyer_upload'
|
30
31
|
require 'lhj/command/duplicate_imageset'
|
32
|
+
require 'lhj/command/jenkins_build'
|
31
33
|
|
32
34
|
self.abstract_command = true
|
33
35
|
self.command = 'lhj'
|
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.40
|
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
|
@@ -312,6 +313,7 @@ files:
|
|
312
313
|
- lib/lhj/command/local/micro_service.rb
|
313
314
|
- lib/lhj/command/oss.rb
|
314
315
|
- lib/lhj/command/oss/del.rb
|
316
|
+
- lib/lhj/command/oss/download.rb
|
315
317
|
- lib/lhj/command/oss/list.rb
|
316
318
|
- lib/lhj/command/oss/upload.rb
|
317
319
|
- lib/lhj/command/pgyer_upload.rb
|