shuttle 1.2.9 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,17 +1,3 @@
1
1
  *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
2
  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
3
  tmp
data/LICENSE CHANGED
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
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.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Shuttle
2
2
 
3
- A simplest continuous integration for a Rails application. Enjoy it!
3
+ A simple continuous integration for a Rails application. Enjoy it!
4
4
 
5
- Get a new code from another team members, install new gems, run new migrations, run specs, send your new feature to the origin repository and deploy your application. At the simplest way!
5
+ Get a new code from another team members, install new gems, run new migrations, run specs, send your new feature to the origin repository and deploy your application. At simplest way!
6
6
 
7
7
  ## Installation
8
8
 
9
- Add this line to your application's Gemfile:
9
+ Add this line into your application's Gemfile:
10
10
 
11
11
  gem 'shuttle'
12
12
 
@@ -20,31 +20,27 @@ And then configure default Shuttle Steps:
20
20
 
21
21
  $ rails g shuttle:install
22
22
 
23
- This will create a configuration file in `config/initializers/shuttle.rb` looks like this:
24
-
25
- Shuttle.setup do |s|
26
- s.steps = [
27
- 'shuttle:git:check',
28
- 'shuttle:git:pull',
29
- 'shuttle:bundle',
30
- 'db:migrate',
31
- 'shuttle:spec',
32
- 'shuttle:git:push',
33
- # 'log:clear',
34
- # 'tmp:clear',
35
- ]
36
-
37
- # s.stages = {
38
- # staging: 'your@server.com:staging-repository.git',
39
- # production: 'your@server.com:production-repository.git'
40
- # }
41
- end
23
+ This will create a configuration file in `config/shuttle.yml` who looks like this:
24
+
25
+ steps:
26
+ - shuttle:git:check
27
+ - shuttle:git:pull
28
+ - shuttle:bundle
29
+ - db:migrate
30
+ - shuttle:spec
31
+ - shuttle:git:push
32
+ # - log:clear
33
+ # - tmp:clear
34
+
35
+ # stages:
36
+ # staging: your@server.com:staging-repository.git
37
+ # production: your@server.com:production-repository.git
42
38
 
43
39
  ### Understanding
44
40
 
45
41
  #### Shuttle Steps
46
42
 
47
- The steps are nothing more than Rake tasks that are performed at the time of integration. The order of the steps in the array will be the order they will be executed. You have the freedom to rearrange, add or delete steps according to your need.
43
+ The steps are nothing more than Rake tasks, performed at the integration time. The array steps order will be the execution order. You have the freedom to rearrange, add or delete steps according to your need.
48
44
 
49
45
  ##### Shuttle's pre-defined Steps:
50
46
 
@@ -4,7 +4,7 @@ module Shuttle
4
4
  source_root File.expand_path('../templates', __FILE__)
5
5
 
6
6
  def copy_install_file
7
- template 'shuttle.rb', 'config/initializers/shuttle.rb'
7
+ template 'shuttle.yml', 'config/shuttle.yml'
8
8
  end
9
9
  end
10
10
  end
@@ -0,0 +1,13 @@
1
+ steps:
2
+ - shuttle:git:check
3
+ - shuttle:git:pull
4
+ - shuttle:bundle
5
+ - db:migrate
6
+ - shuttle:spec
7
+ - shuttle:git:push
8
+ # - log:clear
9
+ # - tmp:clear
10
+
11
+ # stages:
12
+ # staging: your@server.com:staging-repository.git
13
+ # production: your@server.com:production-repository.git
@@ -1,9 +1,19 @@
1
- require "shuttle/railtie"
1
+ require 'shuttle/railtie'
2
2
 
3
3
  module Shuttle
4
- mattr_accessor :steps, :stages
4
+ def self.yaml
5
+ begin
6
+ YAML.load_file(Rails.root.join('config/shuttle.yml').to_s)
7
+ rescue Errno::ENOENT
8
+ nil
9
+ end
10
+ end
11
+
12
+ def self.steps
13
+ yaml['steps'] if yaml.present?
14
+ end
5
15
 
6
- def self.setup
7
- yield self
16
+ def self.stages
17
+ yaml['stages'] if yaml.present?
8
18
  end
9
19
  end
@@ -1,7 +1,7 @@
1
1
  module Shuttle
2
2
  class Railtie < Rails::Railtie
3
3
  rake_tasks do
4
- Dir[File.join(File.dirname(__FILE__), '../tasks/*.rake')].each { |file| load file }
4
+ Dir[File.expand_path('../../tasks/*.rake', __FILE__)].each { |f| load f }
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module Shuttle
2
- VERSION = "1.2.9"
2
+ VERSION = '2.0.0'
3
3
  end
@@ -15,11 +15,11 @@ namespace :shuttle do
15
15
  end
16
16
 
17
17
  task :pull do
18
- sh "git pull --rebase"
18
+ sh 'git pull --rebase'
19
19
  end
20
20
 
21
21
  task :push do
22
- sh "git push"
22
+ sh 'git push'
23
23
  end
24
24
  end
25
25
 
@@ -36,8 +36,8 @@ desc 'Launch the code to space!'
36
36
  task :shuttle, [:stages] => :environment do |t, args|
37
37
  if Shuttle.steps.blank?
38
38
  puts %{
39
- You should define Shuttle Steps in 'config/initializers/shuttle.rb'.
40
- Or run 'rails g shuttle:install' to create this file with default steps.
39
+ You should define Shuttle Steps and Stages in 'config/shuttle.yml'.
40
+ Or run 'rails g shuttle:install' to create this file with default steps and stages.
41
41
  }.yellow
42
42
 
43
43
  exit
@@ -57,7 +57,7 @@ task :shuttle, [:stages] => :environment do |t, args|
57
57
 
58
58
  if args[:stages].present?
59
59
  args[:stages].split(':').each do |stage|
60
- if repository = Shuttle.stages.try(:[], stage.try(:to_sym))
60
+ if repository = Shuttle.stages.try(:[], stage)
61
61
  p80("Executing deploy to #{stage}...") do
62
62
  sh "git push #{repository} HEAD:master -f"
63
63
  end
@@ -1,15 +1,15 @@
1
1
  require File.expand_path('../lib/shuttle/version', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |gem|
4
- gem.authors = ["Felipe Bazzarella"]
5
- gem.email = ["fbazzarella@gmail.com"]
6
- gem.description = %q{A simplest continuous integration for a Rails application. Enjoy it!}
7
- gem.summary = %q{Get a new code from another team members, install new gems, run new migrations, run specs, send your new feature to the origin repository and deploy your application. At the simplest way!}
4
+ gem.authors = ['Felipe Bazzarella']
5
+ gem.email = ['fbazzarella@gmail.com']
6
+ gem.description = %q{A simple continuous integration for a Rails application. Enjoy it!}
7
+ gem.summary = %q{Get a new code from another team members, install new gems, run new migrations, run specs, send your new feature to the origin repository and deploy your application. At simplest way!}
8
8
 
9
9
  gem.files = `git ls-files`.split($\)
10
10
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
11
- gem.name = "shuttle"
12
- gem.require_paths = ["lib"]
11
+ gem.name = 'shuttle'
12
+ gem.require_paths = ['lib']
13
13
  gem.version = Shuttle::VERSION
14
14
 
15
15
  gem.add_runtime_dependency('colored', '~> 1.2')
metadata CHANGED
@@ -1,33 +1,33 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shuttle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.9
5
4
  prerelease:
5
+ version: 2.0.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Felipe Bazzarella
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-05 00:00:00.000000000 Z
12
+ date: 2013-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
+ prerelease: false
16
+ type: :runtime
15
17
  name: colored
16
- requirement: !ruby/object:Gem::Requirement
18
+ version_requirements: !ruby/object:Gem::Requirement
17
19
  none: false
18
20
  requirements:
19
21
  - - ~>
20
22
  - !ruby/object:Gem::Version
21
23
  version: '1.2'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
24
+ requirement: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '1.2'
30
- description: A simplest continuous integration for a Rails application. Enjoy it!
30
+ description: A simple continuous integration for a Rails application. Enjoy it!
31
31
  email:
32
32
  - fbazzarella@gmail.com
33
33
  executables: []
@@ -40,7 +40,7 @@ files:
40
40
  - README.md
41
41
  - Rakefile
42
42
  - lib/generators/shuttle/install_generator.rb
43
- - lib/generators/shuttle/templates/shuttle.rb
43
+ - lib/generators/shuttle/templates/shuttle.yml
44
44
  - lib/shuttle.rb
45
45
  - lib/shuttle/railtie.rb
46
46
  - lib/shuttle/version.rb
@@ -71,5 +71,5 @@ signing_key:
71
71
  specification_version: 3
72
72
  summary: Get a new code from another team members, install new gems, run new migrations,
73
73
  run specs, send your new feature to the origin repository and deploy your application.
74
- At the simplest way!
74
+ At simplest way!
75
75
  test_files: []
@@ -1,17 +0,0 @@
1
- Shuttle.setup do |s|
2
- s.steps = [
3
- 'shuttle:git:check',
4
- 'shuttle:git:pull',
5
- 'shuttle:bundle',
6
- 'db:migrate',
7
- 'shuttle:spec',
8
- 'shuttle:git:push',
9
- # 'log:clear',
10
- # 'tmp:clear',
11
- ]
12
-
13
- # s.stages = {
14
- # staging: 'your@server.com:staging-repository.git',
15
- # production: 'your@server.com:production-repository.git'
16
- # }
17
- end