Skip to content

Commit

Permalink
add new features
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismail Akbudak committed Aug 21, 2015
1 parent 952a035 commit 5ade7e4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 16 deletions.
11 changes: 7 additions & 4 deletions lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -314,26 +314,29 @@ def setup_capistrano_settings
inject_into_file 'Capfile', :after => "require 'capistrano/deploy'\n" do <<-RUBY
require 'capistrano/rails'
require 'capistrano/bundler'
require 'sshkit/sudo'
require 'capistrano/maintenance'
RUBY
end

append_to_file 'config/deploy/production.rb' do
'server "example.com", user: "#{local_user}", roles: %w{app db web}, primary: true
#set :port, 2222
set :rails_env, "production"
set :branch, "master"'
set :branch, "master"
set :project_domain, "example.com"'
end
append_to_file 'config/deploy/staging.rb' do
'server "staging.example.com", user: "#{local_user}", roles: %w{app db web}, primary: true
#set :port, 2222
set :rails_env, "staging"
set :branch, "develop"'
set :branch, "develop"
set :project_domain, "staging.example.com"'
end
end

# Nor using
def setup_recipes
run 'rm config/deploy.rb'
def setup_recipes
generate 'recipes_matic:install'
end

Expand Down
6 changes: 3 additions & 3 deletions lib/cybele/generators/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ def setup_capistrano_settings
build :setup_capistrano_settings
end

# def setup_recipes
# build :setup_recipes
# end
def setup_recipes
build :setup_recipes
end

def setup_secret_token
say 'Setup secret token'
Expand Down
10 changes: 9 additions & 1 deletion templates/config/database.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ development: &default

test:
<<: *default
database: <%= app_name %>_test
database: <%= app_name %>_test

production:
<<: *default
database: <%= app_name %>_production

staging:
<<: *default
database: <%= app_name %>_staging
17 changes: 10 additions & 7 deletions templates/config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp

# Default deploy_to directory is /var/www/blog2
# set :deploy_to, '/var/www/blog2'
# Default deploy_to directory is /var/www/blog2
set :deploy_to, "/home/#{local_user}/apps/#{fetch(:application)}"

# Default value for :scm is :git
# set :scm, :git
set :scm, :git

# Default value for :format is :pretty
# set :format, :pretty
Expand All @@ -24,13 +23,13 @@
# set :log_level, :debug

# Default value for :pty is false
# set :pty, true
set :pty, true

# Default value for :linked_files is []
# set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
set :linked_files, fetch(:linked_files, []).push('config/database.yml')

# Default value for linked_dirs is []
# set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')

# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
Expand All @@ -39,7 +38,11 @@
# Default value for keep_releases is 5
# set :keep_releases, 5

namespace :deploy do
# Look our recipes
# https://github.com/lab2023/recipes_matic
load 'config/deploy/recipes/base.rb'

namespace :deploy do

after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
Expand Down
6 changes: 5 additions & 1 deletion templates/cybele_Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ gem 'capistrano', '~> 3.4.0'
group :development do
gem 'capistrano-rails', '~> 1.1', require: false
gem 'capistrano-bundler', '~> 1.1', require: false
gem 'sshkit-sudo', require: false
gem 'capistrano-maintenance', '~> 1.0', require: false
gem 'recipes_matic', git: '[email protected]:lab2023/recipes_matic.git', branch: 'feature/upgrade'
end
gem 'unicorn', '~> 4.9.0'
gem 'exception_notification', '~> 4.1.1'
Expand All @@ -34,7 +37,7 @@ gem 'jquery-rails', '~> 4.0.4'
gem 'turbolinks', '~> 2.5.3'
gem 'haml', '~> 4.0.2'
gem 'haml-rails', '0.9.0'
gem 'hierapolis-rails', '~> 1.1.0'
gem 'hierapolis-rails', git: '[email protected]:lab2023/recipes_matic.git', branch: 'feature/improvement'
gem 'breadcrumbs_on_rails', '~> 2.3.1'
gem 'blankable', '~> 0.2.0'

Expand All @@ -55,6 +58,7 @@ group :development, :test do
gem 'better_errors'
gem 'letter_opener'
gem 'rspec-rails'
gem 'binding_of_caller'
gem 'katip'
gem 'capybara'
gem 'bullet'
Expand Down

0 comments on commit 5ade7e4

Please sign in to comment.