jetfuel 1.19.3 → 1.19.4
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/jetfuel/app_builder.rb +17 -0
- data/lib/jetfuel/generators/app_generator.rb +15 -0
- data/lib/jetfuel/version.rb +1 -1
- data/templates/Capfile +25 -0
- data/templates/cap_deploy.erb +50 -0
- data/templates/cap_production.erb +45 -0
- data/templates/cap_staging.erb +45 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f3c06d2343e89b706c0794caa780d614a50849e
|
4
|
+
data.tar.gz: 56e16154ee4c869dbbd215e03fe41dc4c6708eeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 244a9422674fccbae63e493930d8b04c07b0ab26af15c61eb19e6311ca6e0a17b01f5e4900fe49a1e995b3928b347b74bffc57a204b41d0ea964dcec5de5446d
|
7
|
+
data.tar.gz: e2e5fad74d933b174f2e1e9cde8746c4d24b676b00afd4d771ef83e882b161db500006d8a6e68f2e372a75b5ffa5520e544fa68635a6a77d09d6e10b1b3ff166
|
data/Gemfile.lock
CHANGED
data/lib/jetfuel/app_builder.rb
CHANGED
@@ -174,6 +174,11 @@ end
|
|
174
174
|
after: /group :staging, :production do/
|
175
175
|
end
|
176
176
|
|
177
|
+
def setup_capistrano_specific_gems
|
178
|
+
inject_into_file 'Gemfile', "\n\s\sgem 'capistrano', '~> 3.2'\n\s\sgem 'capistrano-rails', '~> 1.1'",
|
179
|
+
after: /gem 'spring-commands-rspec'/
|
180
|
+
end
|
181
|
+
|
177
182
|
def enable_database_cleaner
|
178
183
|
copy_file 'database_cleaner_rspec.rb', 'spec/support/database_cleaner.rb'
|
179
184
|
end
|
@@ -344,6 +349,18 @@ fi
|
|
344
349
|
run "#{path_addition} heroku config:add SECRET_KEY_BASE=#{generate_secret} --remote=production"
|
345
350
|
end
|
346
351
|
|
352
|
+
def copy_capistrano_configuration_files
|
353
|
+
run "mkdir -p config/deploy"
|
354
|
+
template 'Capfile', 'Capfile'
|
355
|
+
template 'cap_deploy.erb', 'config/deploy.rb'
|
356
|
+
template 'cap_staging.rb.erb', 'config/deploy/staging.rb'
|
357
|
+
template 'cap_production.rb.erb', 'config/deploy/production.rb'
|
358
|
+
run "mkdir -p lib/capistrano/tasks"
|
359
|
+
|
360
|
+
replace_in_file 'config/deploy.rb', /GITHUB_REPO/, ask("What is your github repository address?")
|
361
|
+
replace_in_file 'config/deploy/production.rb', /IP_ADDRESS/, ask("What is your app's IP address?")
|
362
|
+
end
|
363
|
+
|
347
364
|
def create_github_repo(repo_name)
|
348
365
|
path_addition = override_path_for_tests
|
349
366
|
run "#{path_addition} hub create #{repo_name}"
|
@@ -9,6 +9,9 @@ module Jetfuel
|
|
9
9
|
class_option :heroku, :type => :boolean, :aliases => '-H', :default => false,
|
10
10
|
:desc => 'Create staging and production Heroku apps'
|
11
11
|
|
12
|
+
class_option :capistrano, :type => :boolean, :aliases => '-C', :default => false,
|
13
|
+
:desc => 'Install capistrano'
|
14
|
+
|
12
15
|
class_option :github, :type => :string, :aliases => '-G', :default => nil,
|
13
16
|
:desc => 'Create Github repository and add remote origin pointed to repo'
|
14
17
|
|
@@ -38,6 +41,7 @@ module Jetfuel
|
|
38
41
|
invoke :setup_git
|
39
42
|
invoke :setup_database
|
40
43
|
invoke :create_heroku_apps
|
44
|
+
invoke :install_capistrano
|
41
45
|
invoke :create_github_repo
|
42
46
|
invoke :setup_segment_io
|
43
47
|
invoke :install_leather
|
@@ -53,6 +57,10 @@ module Jetfuel
|
|
53
57
|
build :setup_heroku_specific_gems
|
54
58
|
end
|
55
59
|
|
60
|
+
if options[:capistrano]
|
61
|
+
build :setup_capistrano_specific_gems
|
62
|
+
end
|
63
|
+
|
56
64
|
bundle_command 'install'
|
57
65
|
end
|
58
66
|
|
@@ -172,6 +180,13 @@ module Jetfuel
|
|
172
180
|
end
|
173
181
|
end
|
174
182
|
|
183
|
+
def install_capistrano
|
184
|
+
if options[:capistrano]
|
185
|
+
say 'Installing capistrano'
|
186
|
+
build :copy_capistrano_configuration_files
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
175
190
|
def create_github_repo
|
176
191
|
if !options[:skip_git] && options[:github]
|
177
192
|
say 'Creating Github repo'
|
data/lib/jetfuel/version.rb
CHANGED
data/templates/Capfile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Load DSL and Setup Up Stages
|
2
|
+
require 'capistrano/setup'
|
3
|
+
|
4
|
+
# Includes default deployment tasks
|
5
|
+
require 'capistrano/deploy'
|
6
|
+
|
7
|
+
# Includes tasks from other gems included in your Gemfile
|
8
|
+
#
|
9
|
+
# For documentation on these, see for example:
|
10
|
+
#
|
11
|
+
# https://github.com/capistrano/rvm
|
12
|
+
# https://github.com/capistrano/rbenv
|
13
|
+
# https://github.com/capistrano/chruby
|
14
|
+
# https://github.com/capistrano/bundler
|
15
|
+
# https://github.com/capistrano/rails
|
16
|
+
#
|
17
|
+
# require 'capistrano/rvm'
|
18
|
+
# require 'capistrano/rbenv'
|
19
|
+
# require 'capistrano/chruby'
|
20
|
+
require 'capistrano/bundler'
|
21
|
+
require 'capistrano/rails/assets'
|
22
|
+
require 'capistrano/rails/migrations'
|
23
|
+
|
24
|
+
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
|
25
|
+
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# config valid only for Capistrano 3.1
|
2
|
+
lock '3.2.1'
|
3
|
+
|
4
|
+
set :application, '<%= app_name %>'
|
5
|
+
set :repo_url, 'GITHUB_REPO'
|
6
|
+
|
7
|
+
# Default branch is :master
|
8
|
+
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
|
9
|
+
|
10
|
+
# Default deploy_to directory is /var/www/my_app
|
11
|
+
set :deploy_to, "/var/www/apps/<%= app_name %>"
|
12
|
+
|
13
|
+
# Default value for :scm is :git
|
14
|
+
# set :scm, :git
|
15
|
+
|
16
|
+
# Default value for :format is :pretty
|
17
|
+
# set :format, :pretty
|
18
|
+
|
19
|
+
# Default value for :log_level is :debug
|
20
|
+
# set :log_level, :debug
|
21
|
+
|
22
|
+
# Default value for :pty is false
|
23
|
+
# set :pty, true
|
24
|
+
|
25
|
+
# Default value for :linked_files is []
|
26
|
+
# set :linked_files, %w{config/database.yml}
|
27
|
+
|
28
|
+
# Default value for linked_dirs is []
|
29
|
+
set :linked_dirs, %w{bin log pids tmp/cache tmp/sockets vendor/bundle public/system}
|
30
|
+
|
31
|
+
# Default value for default_env is {}
|
32
|
+
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
|
33
|
+
|
34
|
+
# Default value for keep_releases is 5
|
35
|
+
# set :keep_releases, 5
|
36
|
+
|
37
|
+
namespace :deploy do
|
38
|
+
%w[start stop restart].each do |command|
|
39
|
+
desc "#{command} unicorn server"
|
40
|
+
task command do
|
41
|
+
on roles(:app) do |host|
|
42
|
+
execute "/etc/init.d/unicorn #{command}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
after :finishing, 'deploy:cleanup'
|
48
|
+
end
|
49
|
+
|
50
|
+
after 'deploy:publishing', 'deploy:restart'
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Simple Role Syntax
|
2
|
+
# ==================
|
3
|
+
# Supports bulk-adding hosts to roles, the primary server in each group
|
4
|
+
# is considered to be the first unless any hosts have the primary
|
5
|
+
# property set. Don't declare `role :all`, it's a meta role.
|
6
|
+
|
7
|
+
# role :app, %w{deploy@example.com}
|
8
|
+
# role :web, %w{deploy@example.com}
|
9
|
+
# role :db, %w{deploy@example.com}
|
10
|
+
|
11
|
+
|
12
|
+
# Extended Server Syntax
|
13
|
+
# ======================
|
14
|
+
# This can be used to drop a more detailed server definition into the
|
15
|
+
# server list. The second argument is a, or duck-types, Hash and is
|
16
|
+
# used to set extended properties on the server.
|
17
|
+
|
18
|
+
server 'IP_ADDRESS', user: 'deploy', roles: %w{web app db}
|
19
|
+
|
20
|
+
|
21
|
+
# Custom SSH Options
|
22
|
+
# ==================
|
23
|
+
# You may pass any option but keep in mind that net/ssh understands a
|
24
|
+
# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start).
|
25
|
+
#
|
26
|
+
# Global options
|
27
|
+
# --------------
|
28
|
+
# set :ssh_options, {
|
29
|
+
# keys: %w(/home/rlisowski/.ssh/id_rsa),
|
30
|
+
# forward_agent: false,
|
31
|
+
# auth_methods: %w(password)
|
32
|
+
# }
|
33
|
+
#
|
34
|
+
# And/or per server (overrides global)
|
35
|
+
# ------------------------------------
|
36
|
+
# server 'example.com',
|
37
|
+
# user: 'user_name',
|
38
|
+
# roles: %w{web app},
|
39
|
+
# ssh_options: {
|
40
|
+
# user: 'user_name', # overrides user setting above
|
41
|
+
# keys: %w(/home/user_name/.ssh/id_rsa),
|
42
|
+
# forward_agent: false,
|
43
|
+
# auth_methods: %w(publickey password)
|
44
|
+
# # password: 'please use keys'
|
45
|
+
# }
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Simple Role Syntax
|
2
|
+
# ==================
|
3
|
+
# Supports bulk-adding hosts to roles, the primary server in each group
|
4
|
+
# is considered to be the first unless any hosts have the primary
|
5
|
+
# property set. Don't declare `role :all`, it's a meta role.
|
6
|
+
|
7
|
+
role :app, %w{deploy@example.com}
|
8
|
+
role :web, %w{deploy@example.com}
|
9
|
+
role :db, %w{deploy@example.com}
|
10
|
+
|
11
|
+
|
12
|
+
# Extended Server Syntax
|
13
|
+
# ======================
|
14
|
+
# This can be used to drop a more detailed server definition into the
|
15
|
+
# server list. The second argument is a, or duck-types, Hash and is
|
16
|
+
# used to set extended properties on the server.
|
17
|
+
|
18
|
+
server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value
|
19
|
+
|
20
|
+
|
21
|
+
# Custom SSH Options
|
22
|
+
# ==================
|
23
|
+
# You may pass any option but keep in mind that net/ssh understands a
|
24
|
+
# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start).
|
25
|
+
#
|
26
|
+
# Global options
|
27
|
+
# --------------
|
28
|
+
# set :ssh_options, {
|
29
|
+
# keys: %w(/home/rlisowski/.ssh/id_rsa),
|
30
|
+
# forward_agent: false,
|
31
|
+
# auth_methods: %w(password)
|
32
|
+
# }
|
33
|
+
#
|
34
|
+
# And/or per server (overrides global)
|
35
|
+
# ------------------------------------
|
36
|
+
# server 'example.com',
|
37
|
+
# user: 'user_name',
|
38
|
+
# roles: %w{web app},
|
39
|
+
# ssh_options: {
|
40
|
+
# user: 'user_name', # overrides user setting above
|
41
|
+
# keys: %w(/home/user_name/.ssh/id_rsa),
|
42
|
+
# forward_agent: false,
|
43
|
+
# auth_methods: %w(publickey password)
|
44
|
+
# # password: 'please use keys'
|
45
|
+
# }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jetfuel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.19.
|
4
|
+
version: 1.19.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FlyoverWorks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- spec/support/jetfuel.rb
|
144
144
|
- templates/.rspec
|
145
145
|
- templates/Brewfile
|
146
|
+
- templates/Capfile
|
146
147
|
- templates/Gemfile.erb
|
147
148
|
- templates/Guardfile
|
148
149
|
- templates/Procfile
|
@@ -156,6 +157,9 @@ files:
|
|
156
157
|
- templates/application_helper.rb
|
157
158
|
- templates/background_jobs_rspec.rb
|
158
159
|
- templates/bin_setup
|
160
|
+
- templates/cap_deploy.erb
|
161
|
+
- templates/cap_production.erb
|
162
|
+
- templates/cap_staging.erb
|
159
163
|
- templates/config_locales_en.yml
|
160
164
|
- templates/database_cleaner_rspec.rb
|
161
165
|
- templates/devise.rb
|