producer-rails 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/Gemfile +5 -0
- data/Rakefile +5 -0
- data/features/deploy_init.feature +35 -0
- data/features/steps/rails_steps.rb +10 -0
- data/features/support/env.rb +26 -0
- data/lib/producer/rails/version.rb +1 -1
- data/lib/producer/rails.rb +2 -4
- data/producer-rails.gemspec +9 -3
- metadata +84 -26
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3ecea15a3878eeff0a016f4524e97990a47c2f26
|
4
|
+
data.tar.gz: dae3fa6716e2ab50d81d8de1b0c853a8edbc710f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bd71e1361a7475fded1790e97c3ffd13514305750655573a84152c35045a827fff6a7caf85afa97f3b7adbf57e8b6041396d0fdc9997f44c65fa3ee4e6ada57d
|
7
|
+
data.tar.gz: d3a352ff6b085b11951cd100fe12d980889edfaa797d4ec922911c476bd8a72f71395f1d718ce03ad479571bfb923f46168132933078f93b264c9f0d0c42d49f
|
data/.gitignore
CHANGED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
@sshd @sshd_gem_env
|
2
|
+
Feature: `deploy_init' macro
|
3
|
+
|
4
|
+
Background:
|
5
|
+
Given a rails app repository in remote directory "repos/my_app"
|
6
|
+
And a recipe with:
|
7
|
+
"""
|
8
|
+
require 'producer/rails'
|
9
|
+
|
10
|
+
set :repository, 'repos/my_app'
|
11
|
+
set :app_path, 'deploys/my_app'
|
12
|
+
set :www_workers, 2
|
13
|
+
|
14
|
+
deploy_init
|
15
|
+
|
16
|
+
"""
|
17
|
+
|
18
|
+
Scenario: clones the app in configured remote directory
|
19
|
+
When I successfully execute the recipe on remote target
|
20
|
+
Then the remote file "deploys/my_app/config.ru" must exist
|
21
|
+
|
22
|
+
Scenario: configures the database connection
|
23
|
+
When I successfully execute the recipe on remote target
|
24
|
+
Then the remote file "deploys/my_app/config/database.yml" must contain exactly:
|
25
|
+
"""
|
26
|
+
default: &default
|
27
|
+
adapter: postgresql
|
28
|
+
encoding: unicode
|
29
|
+
pool: 5
|
30
|
+
|
31
|
+
production:
|
32
|
+
<<: *default
|
33
|
+
database: some_host_test
|
34
|
+
|
35
|
+
"""
|
@@ -0,0 +1,10 @@
|
|
1
|
+
Given /^a rails app repository in remote directory "([^"]+)"$/ do |dir|
|
2
|
+
in_current_dir do
|
3
|
+
[
|
4
|
+
"rails new --database=postgresql --skip-bundle #{dir} > /dev/null",
|
5
|
+
"git -C #{dir} init > /dev/null",
|
6
|
+
"git -C #{dir} add . > /dev/null",
|
7
|
+
"git -C #{dir} commit -m 'Add generated rails app' > /dev/null"
|
8
|
+
].each { |cmd| fail unless system cmd }
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'aruba/cucumber'
|
2
|
+
require 'producer/core/testing/cucumber'
|
3
|
+
|
4
|
+
GEMRC = "gem: --no-ri --no-rdoc\n".freeze
|
5
|
+
|
6
|
+
Before('@sshd_gem_env_bundler') do
|
7
|
+
env = { 'GEM_HOME' => "#{ENV['HOME']}/.gem" }
|
8
|
+
write_file '.gemrc', GEMRC
|
9
|
+
write_file '.ssh/rc', <<-eoh
|
10
|
+
export GEM_HOME=#{env['GEM_HOME']}
|
11
|
+
export PATH=#{env['GEM_HOME']}/bin:$PATH
|
12
|
+
eoh
|
13
|
+
with_env(env) do
|
14
|
+
unset_bundler_env_vars
|
15
|
+
fail unless system 'gem install bundler > /dev/null'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
Before('@sshd_gem_env') do
|
20
|
+
write_file '.gemrc', GEMRC
|
21
|
+
write_file '.ssh/rc', <<-eoh
|
22
|
+
export GEM_HOME=#{ENV['GEM_HOME']}
|
23
|
+
export PATH=#{ENV['GEM_HOME']}/bin:$PATH
|
24
|
+
export RAILS_ENV=production
|
25
|
+
eoh
|
26
|
+
end
|
data/lib/producer/rails.rb
CHANGED
@@ -125,12 +125,10 @@ default: &default
|
|
125
125
|
|
126
126
|
production:
|
127
127
|
<<: *default
|
128
|
-
database: #{target}
|
128
|
+
database: #{target.sub '.', '_'}
|
129
129
|
eoh
|
130
130
|
|
131
|
-
|
132
|
-
|
133
|
-
file_write path, conf
|
131
|
+
file_write_once path, conf
|
134
132
|
end
|
135
133
|
|
136
134
|
define_macro :db_init do |path|
|
data/producer-rails.gemspec
CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.version = Producer::Rails::VERSION.dup
|
6
6
|
s.summary = 'producer rails addon'
|
7
7
|
s.description = <<-eoh.gsub(/^ +/, '')
|
8
|
-
Rails
|
8
|
+
Rails helpers for producer (gem: producer-core).
|
9
9
|
eoh
|
10
10
|
s.homepage = 'https://rubygems.org/gems/producer-rails'
|
11
11
|
|
@@ -14,6 +14,12 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.files = `git ls-files`.split $/
|
16
16
|
|
17
|
-
s.add_dependency 'producer-core', '~> 0.
|
18
|
-
s.add_dependency 'producer-stdlib', '~> 0.
|
17
|
+
s.add_dependency 'producer-core', '~> 0.5'
|
18
|
+
s.add_dependency 'producer-stdlib', '~> 0.1'
|
19
|
+
|
20
|
+
s.add_development_dependency 'aruba', '~> 0.6'
|
21
|
+
s.add_development_dependency 'cucumber', '~> 2.0'
|
22
|
+
s.add_development_dependency 'cucumber-sshd', '~> 0.2'
|
23
|
+
s.add_development_dependency 'rake', '~> 10.4'
|
24
|
+
s.add_development_dependency 'rails', '~> 4.2'
|
19
25
|
end
|
metadata
CHANGED
@@ -1,93 +1,151 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: producer-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Thibault Jouan
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2015-
|
11
|
+
date: 2015-04-05 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: producer-core
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: '0.
|
22
|
-
|
19
|
+
version: '0.5'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
23
25
|
- !ruby/object:Gem::Version
|
24
|
-
version: 0.
|
26
|
+
version: '0.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: producer-stdlib
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.1'
|
25
34
|
type: :runtime
|
26
35
|
prerelease: false
|
27
36
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
37
|
requirements:
|
30
38
|
- - "~>"
|
31
39
|
- !ruby/object:Gem::Version
|
32
|
-
version: '0.
|
33
|
-
|
40
|
+
version: '0.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: aruba
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.6'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
34
53
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.
|
54
|
+
version: '0.6'
|
36
55
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
56
|
+
name: cucumber
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: cucumber-sshd
|
38
71
|
requirement: !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
72
|
requirements:
|
41
73
|
- - "~>"
|
42
74
|
- !ruby/object:Gem::Version
|
43
|
-
version: '0.
|
44
|
-
|
75
|
+
version: '0.2'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
45
81
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.
|
47
|
-
|
82
|
+
version: '0.2'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '10.4'
|
90
|
+
type: :development
|
48
91
|
prerelease: false
|
49
92
|
version_requirements: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
93
|
requirements:
|
52
94
|
- - "~>"
|
53
95
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
55
|
-
|
96
|
+
version: '10.4'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rails
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '4.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
56
109
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
110
|
+
version: '4.2'
|
58
111
|
description: |
|
59
|
-
Rails
|
112
|
+
Rails helpers for producer (gem: producer-core).
|
60
113
|
email: tj@a13.fr
|
61
114
|
executables: []
|
62
115
|
extensions: []
|
63
116
|
extra_rdoc_files: []
|
64
117
|
files:
|
65
118
|
- ".gitignore"
|
119
|
+
- Gemfile
|
120
|
+
- Rakefile
|
121
|
+
- features/deploy_init.feature
|
122
|
+
- features/steps/rails_steps.rb
|
123
|
+
- features/support/env.rb
|
66
124
|
- lib/producer/rails.rb
|
67
125
|
- lib/producer/rails/version.rb
|
68
126
|
- producer-rails.gemspec
|
69
127
|
homepage: https://rubygems.org/gems/producer-rails
|
70
128
|
licenses: []
|
129
|
+
metadata: {}
|
71
130
|
post_install_message:
|
72
131
|
rdoc_options: []
|
73
132
|
require_paths:
|
74
133
|
- lib
|
75
134
|
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
135
|
requirements:
|
78
136
|
- - ">="
|
79
137
|
- !ruby/object:Gem::Version
|
80
138
|
version: '0'
|
81
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
140
|
requirements:
|
84
141
|
- - ">="
|
85
142
|
- !ruby/object:Gem::Version
|
86
143
|
version: '0'
|
87
144
|
requirements: []
|
88
145
|
rubyforge_project:
|
89
|
-
rubygems_version:
|
146
|
+
rubygems_version: 2.4.5
|
90
147
|
signing_key:
|
91
|
-
specification_version:
|
148
|
+
specification_version: 4
|
92
149
|
summary: producer rails addon
|
93
150
|
test_files: []
|
151
|
+
has_rdoc:
|