monupco-dotcloud-ruby 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Gemfile +3 -0
- data/LICENSE +19 -0
- data/README.md +57 -0
- data/Rakefile +1 -0
- data/bin/monupco-dotcloud +5 -0
- data/lib/monupco-dotcloud-ruby.rb +19 -0
- data/lib/monupco-dotcloud-ruby/version.rb +5 -0
- data/monupco-dotcloud-ruby.gemspec +25 -0
- metadata +78 -0
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2012, Alexander Todorov <atodorov [AT] otb.bg>
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
Registration agent for monupco.com, preconfigured for dotCloud / Ruby
|
2
|
+
applications.
|
3
|
+
|
4
|
+
It compiles a list of installed packages and sends it to monupco.com.
|
5
|
+
|
6
|
+
Installing on your dotCloud Ruby application
|
7
|
+
-----------------------------------------------------
|
8
|
+
|
9
|
+
- Create an account at http://monupco.com
|
10
|
+
|
11
|
+
- Create your Ruby application in dotCloud
|
12
|
+
|
13
|
+
- Add a dependency in your application's Gemfile
|
14
|
+
|
15
|
+
...
|
16
|
+
gem 'monupco-dotcloud-ruby'
|
17
|
+
...
|
18
|
+
|
19
|
+
- Enable the registration script in your postinstall hook. **Note:**
|
20
|
+
If you are using an "approot" your `postinstall` script should be in the
|
21
|
+
directory pointed by the “approot” directive of your `dotcloud.yml`.
|
22
|
+
For more information about `postinstall` turn to
|
23
|
+
http://docs.dotcloud.com/guides/postinstall/.
|
24
|
+
|
25
|
+
If a file named `postinstall` doesn't already exist, create it and add the following:
|
26
|
+
|
27
|
+
#!/bin/sh
|
28
|
+
bundle exec /home/dotcloud/vendor/bundle/ruby/1.8/bin/monupco-dotcloud
|
29
|
+
|
30
|
+
- Make `postinstall` executable
|
31
|
+
|
32
|
+
chmod a+x postinstall
|
33
|
+
|
34
|
+
- Run bundle install to install the monupco gems locally and regenerate Gemfile.lock
|
35
|
+
|
36
|
+
bundle install
|
37
|
+
|
38
|
+
- Commit your changes (if using git):
|
39
|
+
|
40
|
+
git add .
|
41
|
+
git commit -m "enable monupco registration"
|
42
|
+
|
43
|
+
- Set your monupco user id. You can get it from https://monupco-otb.rhcloud.com/profiles/mine/.
|
44
|
+
|
45
|
+
dotcloud var set <app name> MONUPCO_USER_ID=UserID
|
46
|
+
|
47
|
+
- Then push your application to dotCloud
|
48
|
+
|
49
|
+
dotcloud push <app name>
|
50
|
+
|
51
|
+
- If everything goes well you should see something like:
|
52
|
+
|
53
|
+
19:55:10 [www.0] Running postinstall script...
|
54
|
+
19:55:13 [www.0] response:200
|
55
|
+
19:55:13 [www.0] Monupco: Success, registered/updated application with id 35
|
56
|
+
|
57
|
+
That's it, you can now check your application statistics at http://monupco.com
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "common-ruby-monupco"
|
2
|
+
require "json"
|
3
|
+
|
4
|
+
module Monupco
|
5
|
+
class Dotcloud < Monupco::MonupcoBase
|
6
|
+
json = File.read('/home/dotcloud/environment.json')
|
7
|
+
dotcloud_env = JSON.parse(json)
|
8
|
+
|
9
|
+
configure({
|
10
|
+
'user_id' => dotcloud_env['MONUPCO_USER_ID'],
|
11
|
+
'app_name' => dotcloud_env['DOTCLOUD_PROJECT'] + '.' + dotcloud_env['DOTCLOUD_SERVICE_NAME'],
|
12
|
+
'app_uuid' => dotcloud_env['DOTCLOUD_WWW_HTTP_HOST'],
|
13
|
+
'app_type' => 'Ruby',
|
14
|
+
'app_url' => dotcloud_env['DOTCLOUD_WWW_HTTP_URL'],
|
15
|
+
'app_vendor' => 1,
|
16
|
+
'url' => ENV['MONUPCO_REGISTER_URL'],
|
17
|
+
})
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "monupco-dotcloud-ruby/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "monupco-dotcloud-ruby"
|
7
|
+
s.version = Monupco::Dotcloud::VERSION
|
8
|
+
s.authors = ["Alexander Todorov"]
|
9
|
+
s.email = ["atodorov@otb.bg"]
|
10
|
+
s.homepage = "http://github.com/monupco/monupco-dotcloud-ruby"
|
11
|
+
s.summary = %q{monupco.com registration agent for dotCloud / Ruby applications}
|
12
|
+
s.description = %q{monupco.com registration agent for dotCloud / Ruby applications. See the README for usage.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "monupco-dotcloud-ruby"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
# specify any dependencies here; for example:
|
22
|
+
# s.add_development_dependency "rspec"
|
23
|
+
s.add_runtime_dependency "common-ruby-monupco"
|
24
|
+
s.add_runtime_dependency "json"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: monupco-dotcloud-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Alexander Todorov
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-01 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: common-ruby-monupco
|
16
|
+
requirement: &73236630 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *73236630
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: json
|
27
|
+
requirement: &73236420 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *73236420
|
36
|
+
description: monupco.com registration agent for dotCloud / Ruby applications. See
|
37
|
+
the README for usage.
|
38
|
+
email:
|
39
|
+
- atodorov@otb.bg
|
40
|
+
executables:
|
41
|
+
- monupco-dotcloud
|
42
|
+
extensions: []
|
43
|
+
extra_rdoc_files: []
|
44
|
+
files:
|
45
|
+
- .gitignore
|
46
|
+
- Gemfile
|
47
|
+
- LICENSE
|
48
|
+
- README.md
|
49
|
+
- Rakefile
|
50
|
+
- bin/monupco-dotcloud
|
51
|
+
- lib/monupco-dotcloud-ruby.rb
|
52
|
+
- lib/monupco-dotcloud-ruby/version.rb
|
53
|
+
- monupco-dotcloud-ruby.gemspec
|
54
|
+
homepage: http://github.com/monupco/monupco-dotcloud-ruby
|
55
|
+
licenses: []
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options: []
|
58
|
+
require_paths:
|
59
|
+
- lib
|
60
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
requirements: []
|
73
|
+
rubyforge_project: monupco-dotcloud-ruby
|
74
|
+
rubygems_version: 1.8.15
|
75
|
+
signing_key:
|
76
|
+
specification_version: 3
|
77
|
+
summary: monupco.com registration agent for dotCloud / Ruby applications
|
78
|
+
test_files: []
|