deploygate 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +16 -0
- data/lib/deploygate/api/v1/push.rb +3 -2
- data/lib/deploygate/command_builder.rb +1 -0
- data/lib/deploygate/commands/deploy/push.rb +7 -6
- data/lib/deploygate/deploy.rb +3 -2
- data/lib/deploygate/version.rb +1 -1
- data/spec/deploygate/api/v1/push_spec.rb +2 -2
- data/spec/deploygate/deploy_spec.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d1564cd1f5e82528502eb8a2289415866047edc
|
4
|
+
data.tar.gz: 39bda05af733c6793dbb4c8f7090aea7db8a573d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a935a3bfc0a63a7a1d02c58b7bc2d7ffb6c9d335353b020776fe6c68359d7e4d76e4023acbc36abbeee6c2910a6b793aac5351256b060b86555a628789e210ee
|
7
|
+
data.tar.gz: 0a2cf62fe44fe62608e21e0e8efd2a18638620017f6cc946fa9e8a582eac08a96fbb0f15e435b7208255bbb4e855e95c2b091628e1bbef879baecd7a1a8a3f91
|
data/.travis.yml
CHANGED
@@ -1,3 +1,19 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
3
|
- 2.0.0
|
4
|
+
env:
|
5
|
+
global:
|
6
|
+
secure: IpGM1CW5bsn8DGgcKGMf5jmlJMMVYVZ3c55d8MpGALgxbBHu2GLdOpA/msG1Ura1jR7sNZkrn1SlwQZ2Quo311RPb3UpgPQOlzphVPd6PzYbrNSccEeiD5cemm+J4zUUc6vSFLVwfDE4lV8Ge4Zbt+TclgBgJ4mw42/YB7N/Dmg=
|
7
|
+
script:
|
8
|
+
- bundle exec rake
|
9
|
+
deploy:
|
10
|
+
provider: rubygems
|
11
|
+
api_key:
|
12
|
+
secure: GMEt+VCHGTvSIx/Z6iCTXE3eAbtNt6WB5Qr8AgMDOLjhuDcKCeGm6QEzcmBljnrtZmJhU1BIapzez5tS40H8wy/aRPknSsAOU+kt+BUIMfoQIv0KlVtWxI45R61+bytOfnrGqqLZKVC9mi/nI+qyHkLYuBa3FTEe9u4iyF8Ul/E=
|
13
|
+
gem: deploygate
|
14
|
+
on:
|
15
|
+
tags: true
|
16
|
+
repo: DeployGate/deploygate-cli
|
17
|
+
after_deploy:
|
18
|
+
- 'curl -X POST --data-urlencode "payload={\"text\": \"Released a deploygate gem in
|
19
|
+
<https://rubygems.org/gems/deploygate/|RubyGems>\"}" $SLACK_URL'
|
@@ -10,15 +10,16 @@ module DeployGate
|
|
10
10
|
# @param [String] target_user
|
11
11
|
# @param [String] token
|
12
12
|
# @param [String] message
|
13
|
+
# @param [String] distribution_key
|
13
14
|
# @param [Boolean] disable_notify
|
14
15
|
# @yield Upload process block
|
15
16
|
# @return [Hash]
|
16
|
-
def upload(file_path, target_user, token, message, disable_notify = false, &process_block)
|
17
|
+
def upload(file_path, target_user, token, message, distribution_key, disable_notify = false, &process_block)
|
17
18
|
res = nil
|
18
19
|
open(file_path) do |file|
|
19
20
|
res = Base.new(token).post(
|
20
21
|
sprintf(ENDPOINT, target_user),
|
21
|
-
{ :file => file , :message => message, :disable_notify => disable_notify ? 'yes' : 'no' }) { process_block.call unless process_block.nil? }
|
22
|
+
{ :file => file , :message => message, :distribution_key => distribution_key, :disable_notify => disable_notify ? 'yes' : 'no' }) { process_block.call unless process_block.nil? }
|
22
23
|
end
|
23
24
|
|
24
25
|
upload_results = {
|
@@ -29,6 +29,7 @@ module DeployGate
|
|
29
29
|
c.description = 'upload to deploygate'
|
30
30
|
c.option '--message STRING', String, 'release message'
|
31
31
|
c.option '--user STRING', String, 'owner name or group name'
|
32
|
+
c.option '--distribution-key STRING', String, 'update distribution key'
|
32
33
|
c.option '--open', 'open browser (OSX only)'
|
33
34
|
c.option '--disable_notify', 'disable notify via email (iOS app only)'
|
34
35
|
c.action do |args, options|
|
@@ -16,16 +16,17 @@ module DeployGate
|
|
16
16
|
session = DeployGate::Session.new()
|
17
17
|
end
|
18
18
|
|
19
|
-
message
|
20
|
-
owner
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
message = options.message
|
20
|
+
owner = options.user || session.name
|
21
|
+
distribution_key = options.distribution_key
|
22
|
+
open = options.open
|
23
|
+
disable_notify = options.disable_notify
|
24
|
+
file_path = args.first
|
24
25
|
|
25
26
|
data = nil
|
26
27
|
print "Uploading to #{owner}.."
|
27
28
|
begin
|
28
|
-
data = DeployGate::Deploy.push(file_path, owner, message, disable_notify) {
|
29
|
+
data = DeployGate::Deploy.push(file_path, owner, message, distribution_key, disable_notify) {
|
29
30
|
print '.'
|
30
31
|
sleep 0.2
|
31
32
|
}
|
data/lib/deploygate/deploy.rb
CHANGED
@@ -12,10 +12,11 @@ module DeployGate
|
|
12
12
|
# @param [String] file_path
|
13
13
|
# @param [String] target_user
|
14
14
|
# @param [String] message
|
15
|
+
# @param [String] distribution_key
|
15
16
|
# @param [Boolean] disable_notify
|
16
17
|
# @yield Upload process block
|
17
18
|
# @return [Hash]
|
18
|
-
def push(file_path, target_user, message, disable_notify = false, &process_block)
|
19
|
+
def push(file_path, target_user, message, distribution_key, disable_notify = false, &process_block)
|
19
20
|
raise NotFileExistError, 'Target file is not found' if file_path.nil? || !File.exist?(file_path)
|
20
21
|
|
21
22
|
session = DeployGate::Session.new()
|
@@ -23,7 +24,7 @@ module DeployGate
|
|
23
24
|
token = session.token
|
24
25
|
|
25
26
|
|
26
|
-
data = API::V1::Push.upload(file_path, target_user, token, message, disable_notify) { process_block.call unless process_block.nil? }
|
27
|
+
data = API::V1::Push.upload(file_path, target_user, token, message, distribution_key || '', disable_notify) { process_block.call unless process_block.nil? }
|
27
28
|
raise UploadError, data[:message] if data[:error]
|
28
29
|
|
29
30
|
data
|
data/lib/deploygate/version.rb
CHANGED
@@ -21,7 +21,7 @@ describe DeployGate::API::V1::Push do
|
|
21
21
|
to_return(:body => response.to_json)
|
22
22
|
|
23
23
|
call_process_block = false
|
24
|
-
results = DeployGate::API::V1::Push.upload(test_file_path, target_user, token, message)
|
24
|
+
results = DeployGate::API::V1::Push.upload(test_file_path, target_user, token, message, '')
|
25
25
|
expect(results).to eq ({
|
26
26
|
:error => response[:error],
|
27
27
|
:message => response[:because],
|
@@ -46,7 +46,7 @@ describe DeployGate::API::V1::Push do
|
|
46
46
|
with(:headers => { 'AUTHORIZATION' => token }).
|
47
47
|
to_return(:body => response.to_json)
|
48
48
|
|
49
|
-
results = DeployGate::API::V1::Push.upload(test_file_path, target_user, token, message)
|
49
|
+
results = DeployGate::API::V1::Push.upload(test_file_path, target_user, token, message, '')
|
50
50
|
expect(results).to eq ({:error => response[:error], :message => response[:because]})
|
51
51
|
end
|
52
52
|
end
|
@@ -5,13 +5,13 @@ describe DeployGate::Deploy do
|
|
5
5
|
allow_any_instance_of(DeployGate::Session).to receive(:login?) { false }
|
6
6
|
|
7
7
|
expect {
|
8
|
-
DeployGate::Deploy.push(test_file_path, 'test', 'message')
|
8
|
+
DeployGate::Deploy.push(test_file_path, 'test', 'message', nil)
|
9
9
|
}.to raise_error DeployGate::Deploy::NotLoginError
|
10
10
|
end
|
11
11
|
|
12
12
|
it "NotFileExistError" do
|
13
13
|
expect {
|
14
|
-
DeployGate::Deploy.push('no_file_path', 'test', 'message')
|
14
|
+
DeployGate::Deploy.push('no_file_path', 'test', 'message', nil)
|
15
15
|
}.to raise_error DeployGate::Deploy::NotFileExistError
|
16
16
|
end
|
17
17
|
|
@@ -20,7 +20,7 @@ describe DeployGate::Deploy do
|
|
20
20
|
allow(DeployGate::API::V1::Push).to receive(:upload).and_return({:error => true, :message => 'error message'})
|
21
21
|
|
22
22
|
expect {
|
23
|
-
DeployGate::Deploy.push(test_file_path, 'test', 'message')
|
23
|
+
DeployGate::Deploy.push(test_file_path, 'test', 'message', nil)
|
24
24
|
}.to raise_error DeployGate::Deploy::UploadError
|
25
25
|
end
|
26
26
|
end
|
@@ -31,7 +31,7 @@ describe DeployGate::Deploy do
|
|
31
31
|
allow_any_instance_of(DeployGate::Session).to receive(:login?) { true }
|
32
32
|
|
33
33
|
expect {
|
34
|
-
DeployGate::Deploy.push(test_file_path, 'test', 'message')
|
34
|
+
DeployGate::Deploy.push(test_file_path, 'test', 'message', nil)
|
35
35
|
}.not_to raise_error
|
36
36
|
end
|
37
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deploygate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- deploygate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -359,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
359
359
|
version: '0'
|
360
360
|
requirements: []
|
361
361
|
rubyforge_project:
|
362
|
-
rubygems_version: 2.4.5
|
362
|
+
rubygems_version: 2.4.5
|
363
363
|
signing_key:
|
364
364
|
specification_version: 4
|
365
365
|
summary: A command-line interface for DeployGate
|