heploy 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore ADDED
@@ -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/.rvmrc ADDED
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
+ # development environment upon cd'ing into the directory
5
+
6
+ # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
7
+ environment_id="ruby-1.9.3-p0@heploy"
8
+
9
+ #
10
+ # Uncomment the following lines if you want to verify rvm version per project
11
+ #
12
+ # rvmrc_rvm_version="1.10.1" # 1.10.1 seams as a safe start
13
+ # eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
14
+ # echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
15
+ # return 1
16
+ # }
17
+ #
18
+
19
+ #
20
+ # Uncomment following line if you want options to be set only for given project.
21
+ #
22
+ # PROJECT_JRUBY_OPTS=( --1.9 )
23
+ #
24
+ # The variable PROJECT_JRUBY_OPTS requires the following to be run in shell:
25
+ #
26
+ # chmod +x ${rvm_path}/hooks/after_use_jruby_opts
27
+ #
28
+
29
+ #
30
+ # First we attempt to load the desired environment directly from the environment
31
+ # file. This is very fast and efficient compared to running through the entire
32
+ # CLI and selector. If you want feedback on which environment was used then
33
+ # insert the word 'use' after --create as this triggers verbose mode.
34
+ #
35
+ if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
36
+ && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
37
+ then
38
+ \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
39
+
40
+ if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
41
+ then
42
+ . "${rvm_path:-$HOME/.rvm}/hooks/after_use"
43
+ fi
44
+ else
45
+ # If the environment file has not yet been created, use the RVM CLI to select.
46
+ if ! rvm --create "$environment_id"
47
+ then
48
+ echo "Failed to create RVM environment '${environment_id}'."
49
+ return 1
50
+ fi
51
+ fi
52
+
53
+ #
54
+ # If you use an RVM gemset file to install a list of gems (*.gems), you can have
55
+ # it be automatically loaded. Uncomment the following and adjust the filename if
56
+ # necessary.
57
+ #
58
+ # filename=".gems"
59
+ # if [[ -s "$filename" ]]
60
+ # then
61
+ # rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
62
+ # fi
63
+
64
+ # If you use bundler, this might be useful to you:
65
+ # if [[ -s Gemfile ]] && ! command -v bundle >/dev/null
66
+ # then
67
+ # printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
68
+ # gem install bundler
69
+ # fi
70
+ # if [[ -s Gemfile ]] && command -v bundle
71
+ # then
72
+ # bundle install
73
+ # fi
74
+
75
+ if [[ $- == *i* ]] # check for interactive shells
76
+ then
77
+ echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green
78
+ else
79
+ echo "Using: $GEM_HOME" # don't use colors in interactive shells
80
+ fi
81
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in heploy.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Nathan Borgo
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # Heploy
2
+
3
+ Deploying your Rails application to Heroku is easy. Managing development, staging and production branches and servers is a bit more annoying. Creating backups. Migrating your database. Flipping the maintenance switch on and off. All a little bit more annoying.
4
+
5
+ So Heploy does that for you. And for me. Instead of going down your long list of deploy checkboxes, let Heploy do it.
6
+
7
+ (NOTE: I'm going for Readme Driven Development here, so not everything will be ready right away.)
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ gem 'heploy'
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install heploy
22
+
23
+ ## Usage
24
+
25
+ ### Basic usage
26
+
27
+ Heploy defaults to you using a "dev", "staging" and "production" branch. We'll go over how to change the default later. But for now, here we go.
28
+
29
+ Deploying to staging:
30
+
31
+ $ heploy staging
32
+
33
+ Deploying to production:
34
+
35
+ $ heploy production
36
+
37
+ Simple.
38
+
39
+ ### What's going on?
40
+
41
+ Let's start with `$ heploy staging`. When you run it, you:
42
+
43
+ 1. Merge "dev" branch into "staging".
44
+ 2. Creates a backup of the database, using the PG Backups add-on.
45
+ 3. Tags the current release as "staging-26" (or whatever your Heroku release number is).
46
+ 4. Flips Heroku maintenance on.
47
+ 5. Pushes the "staging" branch to your Heroku staging server.
48
+ 6. Runs any recent database migrations.
49
+ 7. Restarts the server.
50
+ 8. Turns maintenace off.
51
+
52
+ As you might have guessed, `$ heploy production` does pretty much the same thing, except merges the "staging" branch into "production".
53
+
54
+ ### Changing the defaults
55
+
56
+ I'm looking into the best way to do this now.
57
+
58
+ ### Other things
59
+
60
+ Heploy can also help set up your staging and production environments.
61
+
62
+ Your production and staging environments should be as similiar as possible. To help with this, you can compare the two environments to see if anything needs to be changed.
63
+
64
+ $ heploy compare
65
+
66
+ This doesn't actually change anything. It just gives you an overview.
67
+
68
+ ## Contributing
69
+
70
+ 1. Fork it.
71
+ 2. Create your feature branch (`git checkout -b my-new-feature`).
72
+ 3. Commit your changes (`git commit -am 'Add some feature'`).
73
+ 4. Push to the branch (`git push origin my-new-feature`).
74
+ 5. Create new Pull Request.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/heploy ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env ruby
2
+
data/heploy.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'heploy/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "heploy"
8
+ gem.version = Heploy::VERSION
9
+ gem.authors = ["Nathan Borgo"]
10
+ gem.email = ["nathan@subtractiv.com"]
11
+ gem.description = %q{Heploy deploys your application to Heroku, using a bunch of best practices and other nice things.}
12
+ gem.summary = %q{Deploy your application to Heroku, even easier.}
13
+ gem.homepage = ""
14
+
15
+ gem.add_dependency "thor"
16
+ gem.add_dependency "git"
17
+
18
+ gem.files = `git ls-files`.split($/)
19
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
+ gem.require_paths = ["lib"]
22
+ end
data/lib/heploy/cli.rb ADDED
@@ -0,0 +1,3 @@
1
+ class Heploy::CLI < Thor
2
+
3
+ end
@@ -0,0 +1,3 @@
1
+ module Heploy
2
+ VERSION = "0.0.1"
3
+ end
data/lib/heploy.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "heploy/version"
2
+
3
+ module Heploy
4
+ # Your code goes here...
5
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: heploy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Nathan Borgo
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-09-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: thor
16
+ requirement: &70123629232420 !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: *70123629232420
25
+ - !ruby/object:Gem::Dependency
26
+ name: git
27
+ requirement: &70123629231840 !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: *70123629231840
36
+ description: Heploy deploys your application to Heroku, using a bunch of best practices
37
+ and other nice things.
38
+ email:
39
+ - nathan@subtractiv.com
40
+ executables:
41
+ - heploy
42
+ extensions: []
43
+ extra_rdoc_files: []
44
+ files:
45
+ - .gitignore
46
+ - .rvmrc
47
+ - Gemfile
48
+ - LICENSE.txt
49
+ - README.md
50
+ - Rakefile
51
+ - bin/heploy
52
+ - heploy.gemspec
53
+ - lib/heploy.rb
54
+ - lib/heploy/cli.rb
55
+ - lib/heploy/version.rb
56
+ homepage: ''
57
+ licenses: []
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubyforge_project:
76
+ rubygems_version: 1.8.10
77
+ signing_key:
78
+ specification_version: 3
79
+ summary: Deploy your application to Heroku, even easier.
80
+ test_files: []