bintray_deploy 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +32 -0
- data/README.md +50 -0
- data/Rakefile +8 -0
- data/bin/bintray +22 -0
- data/bintray-deploy.gemspec +23 -0
- data/lib/bintray_deploy/actions.rb +20 -0
- data/lib/bintray_deploy/model/base.rb +8 -0
- data/lib/bintray_deploy/model/package.rb +36 -0
- data/lib/bintray_deploy/model/repo.rb +18 -0
- data/lib/bintray_deploy/model/version.rb +18 -0
- data/lib/bintray_deploy/version.rb +4 -0
- data/lib/bintray_deploy.rb +9 -0
- metadata +115 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6a10ee709038f59c24c1763e2746206c1b06b6ab
|
4
|
+
data.tar.gz: 9877e358101074cffbda9510fe7f1085890cd8e5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e1744ea7987ca3fd478bc0fd61e2b09b9c8233e3e573c5fb1f5e0dd1a78d75dec21d7a89e95557249fd2ce92c18b30929a75fb7cf1e584c9f592c9e356627e25
|
7
|
+
data.tar.gz: 0a76ef4c2b23feecfcf6f432c0d652770c0a92adc456432284dfc166dbd3ef8d89f05846e4cf1a117b81f0fe0b2b0c75a43cf73e0573eb414cc774a6f1e14857
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
bintray-deploy
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.0.0
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
bintray_deploy (0.0.1)
|
5
|
+
configuration
|
6
|
+
rest-client
|
7
|
+
thor
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
coderay (1.1.0)
|
13
|
+
configuration (1.3.2)
|
14
|
+
method_source (0.8.2)
|
15
|
+
mime-types (2.0)
|
16
|
+
minitest (5.0.8)
|
17
|
+
pry (0.9.12.4)
|
18
|
+
coderay (~> 1.0)
|
19
|
+
method_source (~> 0.8)
|
20
|
+
slop (~> 3.4)
|
21
|
+
rest-client (1.6.7)
|
22
|
+
mime-types (>= 1.16)
|
23
|
+
slop (3.4.7)
|
24
|
+
thor (0.18.1)
|
25
|
+
|
26
|
+
PLATFORMS
|
27
|
+
ruby
|
28
|
+
|
29
|
+
DEPENDENCIES
|
30
|
+
bintray_deploy!
|
31
|
+
minitest
|
32
|
+
pry
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# Intro
|
2
|
+
A quick and dirty deployment to bintray ruby gem
|
3
|
+
|
4
|
+
# Usage
|
5
|
+
|
6
|
+
Configuration:
|
7
|
+
|
8
|
+
```ruby
|
9
|
+
# HOME/.configuration
|
10
|
+
Configuration.for('bintray-deploy') {
|
11
|
+
user 'name'
|
12
|
+
password 'API-KEY'
|
13
|
+
}
|
14
|
+
```
|
15
|
+
|
16
|
+
Basic cli client:
|
17
|
+
|
18
|
+
```bash
|
19
|
+
$ bintray setup generic kibana-sandbox 'A kibana sandbox package' 'Apache-2.0,MIT'
|
20
|
+
|
21
|
+
$ bintray deploy generic kibana-sandbox 0.0.3 kibana-sandbox-0.0.3.tar.gz
|
22
|
+
```
|
23
|
+
|
24
|
+
Using as a library:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
|
28
|
+
require 'bintray_deploy'
|
29
|
+
|
30
|
+
bintray = BintrayDeploy::Actions.new
|
31
|
+
bintray.deploy(repo, pkg, version, path)
|
32
|
+
bintray.setup(repo, name, desc, licenses)
|
33
|
+
|
34
|
+
```
|
35
|
+
|
36
|
+
# Copyright and license
|
37
|
+
|
38
|
+
Copyright [2013] [Ronen Narkis]
|
39
|
+
|
40
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
41
|
+
you may not use this file except in compliance with the License.
|
42
|
+
You may obtain a copy of the License at
|
43
|
+
|
44
|
+
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
45
|
+
|
46
|
+
Unless required by applicable law or agreed to in writing, software
|
47
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
48
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
49
|
+
See the License for the specific language governing permissions and
|
50
|
+
limitations under the License.
|
data/Rakefile
ADDED
data/bin/bintray
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$:.push 'lib'
|
4
|
+
require 'rubygems'
|
5
|
+
require 'thor'
|
6
|
+
require 'bintray_deploy'
|
7
|
+
|
8
|
+
|
9
|
+
class Main < Thor
|
10
|
+
desc 'deploy repo pkg version file','Releases a package into an bintray repo/pkg creating a new version'
|
11
|
+
def deploy(repo, pkg, version, path)
|
12
|
+
BintrayDeploy::Actions.new.deploy(repo, pkg, version, path)
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'setup repo package desc licenses','Create a new package licenses is a comma seperated list'
|
16
|
+
def setup(repo, name, desc, licenses)
|
17
|
+
BintrayDeploy::Actions.new.setup(repo, name, desc, licenses)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
Main.start(ARGV)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'bintray_deploy/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "bintray_deploy"
|
8
|
+
gem.version = BintrayDeploy::VERSION
|
9
|
+
gem.authors = ["narkisr"]
|
10
|
+
gem.email = ["narkisr@gmail.com"]
|
11
|
+
gem.description = %q{A bintray deployment gem}
|
12
|
+
gem.summary = %q{A quick and dirty deployment gem to bintray}
|
13
|
+
gem.homepage = "https://github.com/narkisr/bintray-deployment"
|
14
|
+
gem.add_dependency('thor')
|
15
|
+
gem.add_dependency('rest-client')
|
16
|
+
gem.add_dependency('configuration')
|
17
|
+
gem.add_development_dependency('minitest')
|
18
|
+
|
19
|
+
gem.files = `git ls-files`.split($/)
|
20
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
21
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
22
|
+
gem.require_paths = ["lib"]
|
23
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'rest-client'
|
2
|
+
require 'json'
|
3
|
+
require 'time'
|
4
|
+
|
5
|
+
module BintrayDeploy
|
6
|
+
|
7
|
+
ROOT = 'https://api.bintray.com/'
|
8
|
+
|
9
|
+
class Actions
|
10
|
+
def deploy(repo, pkg, version, path)
|
11
|
+
Version.new(repo).create(pkg, version)
|
12
|
+
Package.new(repo).upload(path, pkg, version)
|
13
|
+
end
|
14
|
+
|
15
|
+
def setup(repo, pkg, desc, licenses)
|
16
|
+
Package.new(repo).create(pkg, desc, licenses)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module BintrayDeploy
|
2
|
+
class Package < Base
|
3
|
+
def initialize(repo)
|
4
|
+
super(repo)
|
5
|
+
end
|
6
|
+
|
7
|
+
|
8
|
+
def create(name, desc, licenses)
|
9
|
+
payload = {:name => name, :desc => desc, :licenses => licenses.split(',')}.to_json
|
10
|
+
@bintray["/packages/#{C.user}/#{@repo}"].post(payload, :content_type =>:json){ |resp, req, res, &b|
|
11
|
+
if(resp.code !=201)
|
12
|
+
raise Exception.new("package creation failed #{resp}")
|
13
|
+
end
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
def upload(path, pkg, version)
|
18
|
+
@bintray["/content/#{C.user}/#{@repo}/#{pkg}/#{version}/#{File.basename(path)};publish=1"].put(:file => File.new(path, 'rb')){ |resp, req, res, &b|
|
19
|
+
if(resp.code !=201)
|
20
|
+
raise Exception.new("package upload failed #{resp}")
|
21
|
+
end
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def package_exists?(pkg)
|
26
|
+
@bintray["/packages/#{C.user}/#{@repo}/#{pkg}"].get{ |resp, req, res, &b|
|
27
|
+
if(resp.code !=200)
|
28
|
+
return false
|
29
|
+
else
|
30
|
+
return true
|
31
|
+
end
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module BintrayDeploy
|
2
|
+
class Repo < Base
|
3
|
+
|
4
|
+
def initialize(repo)
|
5
|
+
super(repo)
|
6
|
+
end
|
7
|
+
|
8
|
+
def exists?(repo)
|
9
|
+
@bintray["/repos/#{C.user}/#{repo}"].get{ |resp, req, res, &b|
|
10
|
+
if(resp.code !=201)
|
11
|
+
return false
|
12
|
+
else
|
13
|
+
return true
|
14
|
+
end
|
15
|
+
}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module BintrayDeploy
|
2
|
+
class Version < Base
|
3
|
+
|
4
|
+
def initialize(repo)
|
5
|
+
super(repo)
|
6
|
+
end
|
7
|
+
|
8
|
+
def create(pkg, name, desc='')
|
9
|
+
payload = {:name => name, :released => Time.now.utc.iso8601, :desc => desc}.to_json
|
10
|
+
@bintray["/packages/#{C.user}/#{@repo}/#{pkg}/versions"].post(payload, :content_type =>:json){ |resp, req, res, &b|
|
11
|
+
if(resp.code !=201)
|
12
|
+
raise Exception.new("package versioning failed #{resp}")
|
13
|
+
end
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'configuration'
|
2
|
+
require "#{ENV['HOME']}/.configuration.rb"
|
3
|
+
C = Configuration.for 'bintray-deploy'
|
4
|
+
|
5
|
+
require 'bintray_deploy/model/base'
|
6
|
+
require 'bintray_deploy/model/package'
|
7
|
+
require 'bintray_deploy/model/repo'
|
8
|
+
require 'bintray_deploy/model/version'
|
9
|
+
require 'bintray_deploy/actions'
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bintray_deploy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- narkisr
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-11-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rest-client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: configuration
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: A bintray deployment gem
|
70
|
+
email:
|
71
|
+
- narkisr@gmail.com
|
72
|
+
executables:
|
73
|
+
- bintray
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .ruby-gemset
|
78
|
+
- .ruby-version
|
79
|
+
- Gemfile
|
80
|
+
- Gemfile.lock
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- bin/bintray
|
84
|
+
- bintray-deploy.gemspec
|
85
|
+
- lib/bintray_deploy.rb
|
86
|
+
- lib/bintray_deploy/actions.rb
|
87
|
+
- lib/bintray_deploy/model/base.rb
|
88
|
+
- lib/bintray_deploy/model/package.rb
|
89
|
+
- lib/bintray_deploy/model/repo.rb
|
90
|
+
- lib/bintray_deploy/model/version.rb
|
91
|
+
- lib/bintray_deploy/version.rb
|
92
|
+
homepage: https://github.com/narkisr/bintray-deployment
|
93
|
+
licenses: []
|
94
|
+
metadata: {}
|
95
|
+
post_install_message:
|
96
|
+
rdoc_options: []
|
97
|
+
require_paths:
|
98
|
+
- lib
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - '>='
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
requirements: []
|
110
|
+
rubyforge_project:
|
111
|
+
rubygems_version: 2.1.11
|
112
|
+
signing_key:
|
113
|
+
specification_version: 4
|
114
|
+
summary: A quick and dirty deployment gem to bintray
|
115
|
+
test_files: []
|