restorando / capistrano-hipchat Goto Github PK
View Code? Open in Web Editor NEWCapistrano plugin to notify deployments on HipChat
License: MIT License
Capistrano plugin to notify deployments on HipChat
License: MIT License
I'm getting a weird error when running rake assets:precompile with this gem installed.
rake aborted!
NoMethodError: undefined method `before' for main:Object
/home/nuke/.rvm/gems/ruby-2.1.4/gems/capistrano-hipchat-0.1.1/lib/capistrano/tasks/hipchat.cap:27:in `block in <top (required)>'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/capistrano-hipchat-0.1.1/lib/capistrano/tasks/hipchat.cap:1:in `<top (required)>'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `block in load'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/capistrano-hipchat-0.1.1/lib/capistrano/hipchat.rb:3:in `<top (required)>'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler/runtime.rb:85:in `require'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler/runtime.rb:85:in `rescue in block in require'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler/runtime.rb:68:in `block in require'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
/home/nuke/Projects/ponysfm/config/application.rb:7:in `<top (required)>'
/home/nuke/Projects/ponysfm/Rakefile:4:in `require'
/home/nuke/Projects/ponysfm/Rakefile:4:in `<top (required)>'
/home/nuke/.rvm/gems/ruby-2.1.4/bin/ruby_executable_hooks:15:in `eval'
/home/nuke/.rvm/gems/ruby-2.1.4/bin/ruby_executable_hooks:15:in `<main>'
LoadError: cannot load such file -- capistrano-hipchat
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
/home/nuke/.rvm/gems/ruby-2.1.4/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
/home/nuke/Projects/ponysfm/config/application.rb:7:in `<top (required)>'
/home/nuke/Projects/ponysfm/Rakefile:4:in `require'
/home/nuke/Projects/ponysfm/Rakefile:4:in `<top (required)>'
/home/nuke/.rvm/gems/ruby-2.1.4/bin/ruby_executable_hooks:15:in `eval'
/home/nuke/.rvm/gems/ruby-2.1.4/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
It says capistrano-hipchat is not installed when it clearly is.
My Capfile
# Load DSL and set up stages
require 'capistrano/setup'
# Include default deployment tasks
require 'capistrano/deploy'
require 'capistrano/rails'
require 'capistrano/bundler'
require 'capistrano/rvm'
require 'capistrano/puma'
require 'capistrano/hipchat'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
My Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# Use 'next' branch of bootstrap-sass
gem 'bootstrap-sass', :git => 'https://github.com/twbs/bootstrap-sass.git', :branch => 'next'
gem 'coffee-script-source', '1.8.0'
gem 'filesize', '~> 0.1.0'
gem 'paperclip', '~> 4.3'
gem 'carrierwave'
gem 'dropzonejs-rails'
gem 'slideshow'
gem 'font-awesome-sass'
gem 'rspec-rails', '~> 3.0'
gem 'cached_counts'
gem 'mysql2'
group :development do
gem 'capistrano', require: false
gem 'capistrano-rvm', require: false
gem 'capistrano-rails', require: false
gem 'capistrano-bundler', require: false
gem 'capistrano3-puma', require: false
end
gem 'puma'
gem 'net-ssh', '!= 2.10.0'
gem 'redcarpet'
gem "recaptcha", :require => "recaptcha/rails"
gem 'facebox-rails'
gem 'twitter'
gem 'capistrano-hipchat'
config/deploy.rb
# config valid only for current version of Capistrano
lock '3.4.0'
server 'xxx', port: 19595, roles: [:web, :app, :db], primary: true
set :application, 'PonySFM'
set :repo_url, 'xxx'
set :user, 'nuke928'
set :branch, 'master'
set :puma_threads, [4, 16]
set :puma_workers, 0
set :hipchat_token, "xxx"
set :hipchat_room_name, "xxx"
set :hipchat_announce, true # notify users?
# Don't change these unless you know what you're doing
set :pty, true
set :use_sudo, false
set :stage, :production
set :deploy_via, :remote_cache
set :deploy_to, "/home/#{fetch(:user)}/apps/#{fetch(:application)}"
set :puma_bind, "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock"
set :puma_state, "#{shared_path}/tmp/pids/puma.state"
set :puma_pid, "#{shared_path}/tmp/pids/puma.pid"
set :puma_access_log, "#{release_path}/log/puma.error.log"
set :puma_error_log, "#{release_path}/log/puma.access.log"
set :ssh_options, { forward_agent: true, user: fetch(:user), keys: %w(~/.ssh/id_rsa.pub) }
set :puma_preload_app, true
set :puma_worker_timeout, nil
set :puma_init_active_record, true # Change to false when not using ActiveRecord
## Defaults:
# set :scm, :git
# set :branch, :master
# set :format, :pretty
# set :log_level, :debug
# set :keep_releases, 5
## Linked Files & Directories (Default None):
# set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{public/system public/data}
namespace :puma do
desc 'Create Directories for Puma Pids and Socket'
task :make_dirs do
on roles(:app) do
execute "mkdir #{shared_path}/tmp/sockets -p"
execute "mkdir #{shared_path}/tmp/pids -p"
end
end
before :start, :make_dirs
end
namespace :deploy do
desc "Make sure local git is in sync with remote."
task :check_revision do
on roles(:app) do
unless `git rev-parse HEAD` == `git rev-parse origin/master`
puts "WARNING: HEAD is not the same as origin/master"
puts "Run `git push` to sync changes."
end
end
end
desc 'Initial Deploy'
task :initial do
on roles(:app) do
before 'deploy:restart', 'puma:start'
invoke 'deploy'
end
end
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
invoke 'puma:restart'
end
end
before :starting, :check_revision
after :finishing, :compile_assets
after :finishing, :cleanup
after :finishing, :restart
end
# ps aux | grep puma # Get puma pid
# kill -s SIGUSR2 pid # Restart puma
# kill -s SIGTERM pid # Stop puma
Using Rails 4.2.3, Ruby 2.1.4, Capistrano 3.4.0 and Rake 10.4.2
The bot DOES connect with the "is deploying to production" message but that's it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.