-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:AbleTech/easy-deployment
- Loading branch information
Showing
26 changed files
with
154 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
*.gem | ||
*.rbc | ||
.bundle | ||
.DS_Store | ||
.config | ||
.yardoc | ||
Gemfile.lock | ||
pkg/* | ||
InstalledFiles | ||
_yardoc | ||
coverage | ||
doc/ | ||
lib/bundler/man | ||
pkg | ||
rdoc | ||
spec/reports | ||
test/tmp | ||
test/version_tmp | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--format progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
source "http://rubygems.org" | ||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in the .gemspec | ||
# Specify your gem's dependencies in easy-deployment.gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Copyright (c) 2012 Able Technology | ||
|
||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Easy::Deployment | ||
|
||
This gem is for encapsulating Abletech's common deployment patterns using capistrano. | ||
|
||
## Installation | ||
|
||
Add this line to your application's Gemfile: | ||
|
||
gem 'easy-deployment', :git => "[email protected]:AbleTech/easy-deployment.git" | ||
|
||
And then execute: | ||
|
||
$ bundle | ||
|
||
Or install it yourself as: | ||
|
||
$ gem install easy-deployment | ||
|
||
## Usage | ||
|
||
Run: | ||
|
||
$ rails g easy:deployment | ||
|
||
## Contributing | ||
|
||
1. Fork it | ||
2. Create your feature branch (`git checkout -b my-new-feature`) | ||
3. Commit your changes (`git commit -am 'Added some feature'`) | ||
4. Push to the branch (`git push origin my-new-feature`) | ||
5. Create new Pull Request |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
require 'bundler' | ||
Bundler::GemHelper.install_tasks | ||
#!/usr/bin/env rake | ||
require "bundler/gem_tasks" | ||
|
||
require 'rake/testtask' | ||
Rake::TestTask.new(:test) do |test| | ||
test.libs << 'lib' << 'test' | ||
test.pattern = 'test/**/test_*.rb' | ||
test.verbose = true | ||
end | ||
|
||
require 'rcov/rcovtask' | ||
Rcov::RcovTask.new do |test| | ||
test.rcov_opts << '--exclude /gems/,/Library/,/usr/,spec,lib/tasks' # exclude external gems/libraries | ||
test.libs << 'test' | ||
test.pattern = 'test/**/test_*.rb' | ||
test.verbose = true | ||
end | ||
|
||
task :default => :test | ||
require 'rspec/core/rake_task' | ||
RSpec::Core::RakeTask.new('spec') |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- encoding: utf-8 -*- | ||
require File.expand_path('../lib/easy-deployment/version', __FILE__) | ||
|
||
Gem::Specification.new do |gem| | ||
gem.authors = ["Jeremy Olliver", "Nigel Ramsay", "Shevaun Coker"] | ||
gem.email = ["[email protected]", "[email protected]", "[email protected]"] | ||
gem.description = %q{Easy deployment: includes a generator, and capistrano configuration} | ||
gem.summary = %q{Gem for encapsulating abletech's deployment practices} | ||
gem.homepage = "" | ||
|
||
gem.files = `git ls-files`.split($\) | ||
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } | ||
gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) | ||
gem.name = "easy-deployment" | ||
gem.require_paths = ["lib"] | ||
gem.version = Easy::Deployment::VERSION | ||
|
||
|
||
gem.add_runtime_dependency 'rails', '>= 3.0.0' | ||
gem.add_runtime_dependency 'capistrano' | ||
gem.add_runtime_dependency 'capistrano-ext' | ||
gem.add_runtime_dependency 'capistrano_colors' | ||
|
||
gem.add_development_dependency 'bundler' | ||
gem.add_development_dependency 'rspec', '~> 2.8' | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require "easy-deployment/version" | ||
require 'easy/generators/deployment_generator' | ||
require 'easy/generators/stage_generator' |
2 changes: 1 addition & 1 deletion
2
lib/abletech/deployment/version.rb → lib/easy-deployment/version.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Abletech | ||
module Easy | ||
module Deployment | ||
VERSION = "0.0.7" | ||
end | ||
|
12 changes: 6 additions & 6 deletions
12
lib/abletech/deployment/backup.rb → lib/easy/deployment/backup.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# To load this capistrano configuration, require 'abletech/deployment/backup' from deploy.rb | ||
# To load this capistrano configuration, require 'easy/deployment/backup' from deploy.rb | ||
Capistrano::Configuration.instance(:must_exist).load do | ||
namespace :abletech do | ||
namespace :easy do | ||
namespace :backup do | ||
desc "Creates the shared folders that backup requires" | ||
task :setup, :except => { :no_release => true } do | ||
run "mkdir -p #{shared_path}/backup/data" | ||
end | ||
|
||
desc "Adds a symbolic link from the s3.yml file in the shared/backup into the current/config folder" | ||
task :symlink_s3_config do | ||
run "ln -sf #{shared_path}/backup/s3.yml #{current_path}/config/s3.yml" | ||
end | ||
end | ||
end | ||
after 'deploy:setup', 'abletech:backup:setup' | ||
after 'deploy:symlink', 'abletech:backup:symlink_s3_config' | ||
|
||
after 'deploy:setup', 'easy:backup:setup' | ||
after 'deploy:symlink', 'easy:backup:symlink_s3_config' | ||
end |
2 changes: 1 addition & 1 deletion
2
lib/abletech/deployment/capistrano.rb → lib/easy/deployment/capistrano.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
lib/abletech/deployment/logrotate.rb → lib/easy/deployment/logrotate.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
lib/abletech/deployment/whenever.rb → lib/easy/deployment/whenever.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
# To load this capistrano configuration, require 'abletech/deployment/whenever' from deploy.rb | ||
# To load this capistrano configuration, require 'easy/deployment/whenever' from deploy.rb | ||
Capistrano::Configuration.instance(:must_exist).load do | ||
namespace :abletech do | ||
namespace :easy do | ||
namespace :whenever do | ||
desc "Removes this application's entries from the user's crontab file" | ||
task :clear_crontab do | ||
run "cd #{release_path} && #{bundle_cmd} exec whenever -f #{release_path}/config/deploy/#{rails_env}/whenever.rb --clear-crontab #{application}" | ||
end | ||
|
||
desc "Updates this application's crontab file entries" | ||
task :update_crontab do | ||
run "cd #{current_path} && #{bundle_cmd} exec whenever -f #{current_path}/config/deploy/#{rails_env}/whenever.rb --update-crontab #{application} --set \"current_path=#{current_path}&bundle_cmd=#{fetch(:bundle_cmd, 'bundle')}&rails_env=#{rails_env}&application=#{application}\"" | ||
end | ||
end | ||
end | ||
end | ||
|
||
after "deploy:update_code", "abletech:whenever:clear_crontab" | ||
after "deploy:symlink", "abletech:whenever:update_crontab" | ||
after "deploy:rollback", "abletech:whenever:update_crontab" | ||
after "deploy:update_code", "easy:whenever:clear_crontab" | ||
after "deploy:symlink", "easy:whenever:update_crontab" | ||
after "deploy:rollback", "easy:whenever:update_crontab" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...bletech/generators/logrotate_generator.rb → lib/easy/generators/logrotate_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
lib/abletech/generators/stage_generator.rb → lib/easy/generators/stage_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ require "capistrano/ext/multistage" | |
require "capistrano_colors" | ||
require "bundler/capistrano" | ||
begin | ||
require "abletech/deployment/capistrano" | ||
require "easy/deployment/capistrano" | ||
rescue LoadError | ||
$stderr.puts "couldn't load abletech-deployment gem, try `bundle install` and running again with `bundle exec cap <stage> deploy`" | ||
$stderr.puts "couldn't load easy-deployment gem, try `bundle install` and running again with `bundle exec cap <stage> deploy`" | ||
exit(1) | ||
end | ||
|
||
|
@@ -15,7 +15,7 @@ set :application, "<%= application_name %>" # TODO: edit application name | |
set :deploy_to, "/var/apps/#{application}" | ||
|
||
# TODO: fill in git repo | ||
# set :repository, "[email protected]:AbleTech/abletech-deployment.git" | ||
# set :repository, "[email protected]:AbleTech/easy-deployment.git" | ||
set :scm, :git | ||
set :deploy_via, :remote_cache | ||
set :git_shallow_clone, 1 | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'spec_helper.rb' | ||
|
||
describe Easy::Deployment do | ||
it "has a version number" do | ||
Easy::Deployment::VERSION.should be_present | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This file was generated by the `rspec --init` command. Conventionally, all | ||
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. | ||
# Require this file using `require "spec_helper.rb"` to ensure that it is only | ||
# loaded once. | ||
# | ||
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration | ||
|
||
require 'rubygems' | ||
require 'bundler' | ||
|
||
require 'easy-deployment' | ||
|
||
RSpec.configure do |config| | ||
config.mock_with :rspec | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.