rls 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,69 @@
1
+ # RLS [Release]
2
+
3
+ Heroku deployment wrapper (rubygem). RLS aims at making Heroku deploys a bit
4
+ easier
5
+
6
+ What it currently does/support:
7
+
8
+ * deploys you app to Heroku
9
+ * Notifies NewRelic of the deployment
10
+
11
+ ## Things to come (todo)
12
+
13
+ * push to origin
14
+ * create diff/changelog
15
+ * notify airbrake
16
+ * tests!
17
+ * run migrations
18
+
19
+ ## Installation
20
+
21
+ `gem install rls` or add `gem 'rls'` to your `Gemfile`
22
+
23
+ ## Usage
24
+
25
+ Usage: rls [options]
26
+ Defaults to: rls -r heroku -b master -e production -a off -f false -d false
27
+ where [options] are:
28
+ --remote, -r <s>: Remote git repo (default: heroku)
29
+ --branch, -b <s>: Branch to push (default: master)
30
+ --env, -e <s>: Environment (default: production)
31
+ --app-name, -a <s>: Newrelic app name (default: off)
32
+ --force, -f: Force push update
33
+ --debug, -d: Only print, not perform actions
34
+ --version, -v: Print version and exit
35
+ --help, -h: Show this message
36
+
37
+ ## Contributing
38
+
39
+ 1. Fork it
40
+ 2. Create your feature branch (`git checkout -b release-brainz`)
41
+ 3. Commit your changes (`git commit -am 'Add mega release brainz!!!'`)
42
+ 4. Push to the branch (`git push origin release-brainz`)
43
+ 5. Create new Pull Request
44
+ 6. Go buy a Porche (you've earned it!)
45
+
46
+ ## Licence (MIT)
47
+
48
+ Copyright (c) 2012 Jesper Kjeldgaard
49
+
50
+ MIT License
51
+
52
+ Permission is hereby granted, free of charge, to any person obtaining
53
+ a copy of this software and associated documentation files (the
54
+ "Software"), to deal in the Software without restriction, including
55
+ without limitation the rights to use, copy, modify, merge, publish,
56
+ distribute, sublicense, and/or sell copies of the Software, and to
57
+ permit persons to whom the Software is furnished to do so, subject to
58
+ the following conditions:
59
+
60
+ The above copyright notice and this permission notice shall be
61
+ included in all copies or substantial portions of the Software.
62
+
63
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
64
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
65
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
66
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
67
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
68
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
69
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/rls ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
4
+
5
+ require 'rls'
6
+ require 'trollop'
7
+
8
+ options = Trollop::options do
9
+ version "rls v#{RLS::VERSION} by @thejspr"
10
+
11
+ banner <<-EOS
12
+ rls v#{RLS::VERSION} is a Heroku deployment wrapper.
13
+
14
+ Usage: rls [options]
15
+ Defaults to: rls -r heroku -b master -e production -a off -f false -d false
16
+ where [options] are:
17
+ EOS
18
+
19
+ opt :remote, 'Remote git repo', default: 'heroku'
20
+ opt :branch, 'Branch to push', default: 'master'
21
+ opt :env, 'Environment', default: 'production'
22
+ opt :app_name,'Newrelic app name', default: 'off'
23
+ opt :force, 'Force push update', default: false
24
+ opt :debug, 'Only print, not perform actions', default: false
25
+ end
26
+
27
+ RLS::Runner.new(options).release!
@@ -0,0 +1,36 @@
1
+ require 'rls/version'
2
+
3
+ class RLS::Runner < Struct.new(:options)
4
+ def release!
5
+ puts 'Debug run...' if debug
6
+ # TODO: show diff log since last deploy
7
+ # TODO: ensure all commits are pushed to github
8
+ # TODO: ask to run tests?
9
+ # deploy
10
+ execute "git push #{options[:remote]} #{branch} #{force ? '-ff' : ''}"
11
+ # notify newrelic
12
+ execute "newrelic deployments -a '#{app_name}' -e '#{env}'" if notify_newrelic?
13
+ # TODO: run any migrations (backup before)
14
+ end
15
+
16
+ private
17
+
18
+ def execute(cmd)
19
+ puts "Running: #{cmd.strip!}"
20
+
21
+ return true if debug
22
+
23
+ unless system(cmd)
24
+ $stderr.puts "command: '#{cmd}' failed!"
25
+ exit(1)
26
+ end
27
+ end
28
+
29
+ def notify_newrelic?
30
+ app_name.size > 0 && app_name != 'off'
31
+ end
32
+
33
+ def method_missing(m, *args, &block)
34
+ options.key?(m.to_sym) ? options[m.to_sym] : super
35
+ end
36
+ end
@@ -0,0 +1,3 @@
1
+ module RLS
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rls/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = 'rls'
8
+ gem.version = RLS::VERSION
9
+ gem.authors = ['Jesper Kjeldgaard']
10
+ gem.email = ['thejspr@gmail.com']
11
+ gem.description = %q{All in one deploy command for Heroku apps}
12
+ gem.summary = %q{Heroku deploy wrapper}
13
+ gem.homepage = 'http://github.com/thejspr/rls'
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.require_paths = ['lib']
18
+
19
+ gem.add_dependency 'trollop', '~>2.0'
20
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rls
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Jesper Kjeldgaard
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ none: false
21
+ name: trollop
22
+ type: :runtime
23
+ prerelease: false
24
+ requirement: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ version: '2.0'
29
+ none: false
30
+ description: All in one deploy command for Heroku apps
31
+ email:
32
+ - thejspr@gmail.com
33
+ executables:
34
+ - rls
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - .gitignore
39
+ - Gemfile
40
+ - README.md
41
+ - Rakefile
42
+ - bin/rls
43
+ - lib/rls.rb
44
+ - lib/rls/version.rb
45
+ - rls.gemspec
46
+ homepage: http://github.com/thejspr/rls
47
+ licenses: []
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ none: false
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ none: false
64
+ requirements: []
65
+ rubyforge_project:
66
+ rubygems_version: 1.8.23
67
+ signing_key:
68
+ specification_version: 3
69
+ summary: Heroku deploy wrapper
70
+ test_files: []
71
+ has_rdoc: