Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #20 from 6fusion/crm-3.2.0

Crm 3.2.0
  • Loading branch information...
commit c9be06cefa2184a8be6a9b36fcaa1fe783363e0a 2 parents 52b421e + f950b9c
Kevin Olbrich olbrich authored
Showing with 144 additions and 172 deletions.
  1. +18 −18 .rvmrc
  2. +2 −4 Gemfile
  3. +72 −103 Gemfile.lock
  4. +0 −8 config/deploy.rb
  5. +52 −39 models/machine.rb
36 .rvmrc
View
@@ -4,7 +4,7 @@
# development environment upon cd'ing into the directory
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
-environment_id="jruby-1.7.1@adaptor-vmware"
+environment_id="jruby-1.7.2@adaptor-vmware"
#
# Uncomment the following lines if you want to verify rvm version per project
@@ -16,38 +16,38 @@ environment_id="jruby-1.7.1@adaptor-vmware"
# }
#
-#
-# Uncomment following line if you want options to be set only for given project.
-#
-#PROJECT_JRUBY_OPTS=( --1.8 )
-#
+PROJECT_JRUBY_OPTS=( -Xcext.enabled=true -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-noverify )
# The variable PROJECT_JRUBY_OPTS requires the following to be run in shell:
-#
# chmod +x ${rvm_path}/hooks/after_use_jruby_opts
-#
-#
# First we attempt to load the desired environment directly from the environment
# file. This is very fast and efficient compared to running through the entire
# CLI and selector. If you want feedback on which environment was used then
# insert the word 'use' after --create as this triggers verbose mode.
-#
-if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
+if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
then
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
-
- if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
- then
- . "${rvm_path:-$HOME/.rvm}/hooks/after_use"
+ for __hook in ${rvm_path:-$HOME/.rvm}/hooks/after_use*
+ do
+ if
+ [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" &&
+ "${rvm_path:-$HOME/.rvm}/hooks/after_use*" != "${__hook}" ]]
+ then
+ \. "${__hook}" || true
+ fi
+ done
+ unset __hook
+ if [[ $- == *i* ]] # check for interactive shells
+ then echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green
+ else echo "Using: $GEM_HOME" # don't use colors in non-interactive shells
fi
else
# If the environment file has not yet been created, use the RVM CLI to select.
- if ! rvm --create use "$environment_id"
- then
+ rvm --create use "$environment_id" || {
echo "Failed to create RVM environment '${environment_id}'."
return 1
- fi
+ }
fi
#
6 Gemfile
View
@@ -1,4 +1,4 @@
-source 'http://rubygems.org'
+source 'https://rubygems.org'
gem 'padrino', git: 'https://github.com/padrino/padrino-framework.git', branch: 'master'
@@ -9,20 +9,18 @@ gem 'haml'
gem 'rabl'
gem 'yajl-ruby'
gem 'rake'
-gem 'kaminari', require: 'kaminari/sinatra'
gem 'rubyzip', git: 'https://github.com/aussiegeek/rubyzip.git', require: "zip/zip"
gem 'uuid'
gem 'json-jruby', require: 'json'
gem 'jruby-rack'
gem 'rack'
-torquebox_version = "2.2.0"
+torquebox_version = "2.3.0"
gem 'torquebox-cache', torquebox_version
gem 'torquebox-messaging', torquebox_version
gem 'torquebox-rake-support', torquebox_version
gem 'torquebox', torquebox_version
gem 'padrino-rpm', git: 'https://github.com/6fusion/padrino-rpm.git'
-gem 'newrelic_rpm'
group :development do
gem 'trinidad'
175 Gemfile.lock
View
@@ -13,7 +13,7 @@ GIT
GIT
remote: https://github.com/padrino/padrino-framework.git
- revision: aa3617ce79639fbee9869dc2073f8a918d682066
+ revision: 2eb060ab502a5f9aa520ec56f876bda248ae460b
branch: master
specs:
padrino (0.10.7)
@@ -46,28 +46,18 @@ GIT
padrino-core (= 0.10.7)
GEM
- remote: http://rubygems.org/
+ remote: https://rubygems.org/
specs:
- actionpack (3.2.11)
- activemodel (= 3.2.11)
- activesupport (= 3.2.11)
+ activemodel (3.2.12)
+ activesupport (= 3.2.12)
builder (~> 3.0.0)
- erubis (~> 2.7.0)
- journey (~> 1.0.4)
- rack (~> 1.4.0)
- rack-cache (~> 1.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.2.1)
- activemodel (3.2.11)
- activesupport (= 3.2.11)
- builder (~> 3.0.0)
- activesupport (3.2.11)
+ activesupport (3.2.12)
i18n (~> 0.6)
multi_json (~> 1.0)
- addressable (2.3.2)
+ addressable (2.3.3)
blankslate (2.1.2.4)
builder (3.0.4)
- capistrano (2.14.1)
+ capistrano (2.14.2)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
@@ -80,11 +70,9 @@ GEM
git
tinder
capistrano_colors (0.5.5)
- diff-lcs (1.1.3)
+ diff-lcs (1.2.1)
edn (1.0.0)
parslet (~> 1.4.0)
- erubis (2.7.0)
- eventmachine (0.12.10)
eventmachine (0.12.10-java)
faraday (0.7.6)
addressable (~> 2.2)
@@ -93,25 +81,19 @@ GEM
faraday_middleware (0.7.0)
faraday (~> 0.7.3)
git (1.2.5)
- haml (3.1.7)
+ haml (4.0.0)
+ tilt
hashie (1.2.0)
highline (1.6.15)
- hike (1.2.1)
- http_parser.rb (0.5.3)
http_parser.rb (0.5.3-java)
http_router (0.10.2)
rack (>= 1.0.0)
url_mount (~> 0.2.1)
- i18n (0.6.1)
- journey (1.0.4)
- jruby-rack (1.1.12)
- json (1.5.0)
+ i18n (0.6.4)
+ jruby-rack (1.1.13.1)
json (1.5.0-java)
json-jruby (1.5.0-java)
json (= 1.5.0)
- kaminari (0.14.1)
- actionpack (>= 3.0.0)
- activesupport (>= 3.0.0)
macaddr (1.6.1)
systemu (~> 2.5.0)
mail (2.5.3)
@@ -119,116 +101,105 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
- mime-types (1.19)
- mocha (0.13.1)
+ mime-types (1.21)
+ mocha (0.13.2)
metaclass (~> 0.0.1)
- multi_json (1.5.0)
- multipart-post (1.1.5)
- net-scp (1.0.4)
- net-ssh (>= 1.99.1)
- net-sftp (2.0.5)
- net-ssh (>= 2.0.9)
- net-ssh (2.6.2)
- net-ssh-gateway (1.1.0)
- net-ssh (>= 1.99.1)
- newrelic_rpm (3.5.5.38)
+ multi_json (1.6.1)
+ multipart-post (1.2.0)
+ net-scp (1.1.0)
+ net-ssh (>= 2.6.5)
+ net-sftp (2.1.1)
+ net-ssh (>= 2.6.5)
+ net-ssh (2.6.6)
+ net-ssh-gateway (1.2.0)
+ net-ssh (>= 2.6.5)
+ newrelic_rpm (3.5.8.72)
parslet (1.4.0)
blankslate (~> 2.0)
polyglot (0.3.3)
- rabl (0.7.9)
+ rabl (0.8.0)
activesupport (>= 2.3.14)
- multi_json (~> 1.0)
- rack (1.4.3)
- rack-cache (1.2)
- rack (>= 0.4)
- rack-protection (1.3.2)
+ rack (1.5.2)
+ rack-protection (1.4.0)
rack
rack-test (0.6.2)
rack (>= 1.0)
rake (10.0.3)
rest-client (1.6.7)
mime-types (>= 1.16)
- rspec (2.12.0)
- rspec-core (~> 2.12.0)
- rspec-expectations (~> 2.12.0)
- rspec-mocks (~> 2.12.0)
- rspec-core (2.12.2)
- rspec-expectations (2.12.1)
- diff-lcs (~> 1.1.3)
- rspec-mocks (2.12.1)
+ rspec (2.13.0)
+ rspec-core (~> 2.13.0)
+ rspec-expectations (~> 2.13.0)
+ rspec-mocks (~> 2.13.0)
+ rspec-core (2.13.0)
+ rspec-expectations (2.13.0)
+ diff-lcs (>= 1.1.3, < 2.0)
+ rspec-mocks (2.13.0)
simple_oauth (0.1.9)
- sinatra (1.3.4)
+ sinatra (1.3.5)
rack (~> 1.4)
rack-protection (~> 1.3)
tilt (~> 1.3, >= 1.3.3)
- sprockets (2.2.2)
- hike (~> 1.2)
- multi_json (~> 1.0)
- rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
systemu (2.5.2)
thor (0.16.0)
- tilt (1.3.3)
+ tilt (1.3.4)
tinder (1.8.0)
activesupport (>= 2.3, < 4)
- activesupport (>= 2.3, < 4)
eventmachine (~> 0.12)
faraday (>= 0.6, < 0.8)
- faraday (>= 0.6, < 0.8)
- faraday_middleware (>= 0.6, < 0.8)
faraday_middleware (>= 0.6, < 0.8)
hashie (~> 1.0)
mime-types (~> 1.16)
multi_json (~> 1.0)
multipart-post (~> 1.1)
twitter-stream (~> 0.1)
- torquebox (2.2.0)
+ torquebox (2.3.0)
thor (>= 0.14.6)
- torquebox-cache (= 2.2.0)
- torquebox-configure (= 2.2.0)
- torquebox-core (= 2.2.0)
- torquebox-messaging (= 2.2.0)
- torquebox-naming (= 2.2.0)
- torquebox-rake-support (= 2.2.0)
- torquebox-security (= 2.2.0)
- torquebox-stomp (= 2.2.0)
- torquebox-transactions (= 2.2.0)
- torquebox-web (= 2.2.0)
- torquebox-cache (2.2.0-java)
- torquebox-core (= 2.2.0)
- torquebox-transactions (= 2.2.0)
- torquebox-configure (2.2.0-java)
+ torquebox-cache (= 2.3.0)
+ torquebox-configure (= 2.3.0)
+ torquebox-core (= 2.3.0)
+ torquebox-messaging (= 2.3.0)
+ torquebox-naming (= 2.3.0)
+ torquebox-rake-support (= 2.3.0)
+ torquebox-security (= 2.3.0)
+ torquebox-stomp (= 2.3.0)
+ torquebox-transactions (= 2.3.0)
+ torquebox-web (= 2.3.0)
+ torquebox-cache (2.3.0-java)
+ torquebox-core (= 2.3.0)
+ torquebox-transactions (= 2.3.0)
+ torquebox-configure (2.3.0-java)
blankslate (= 2.1.2.4)
- torquebox-core (2.2.0-java)
- torquebox-messaging (2.2.0-java)
+ torquebox-core (2.3.0-java)
+ torquebox-messaging (2.3.0-java)
edn (= 1.0.0)
- torquebox-core (= 2.2.0)
- torquebox-transactions (= 2.2.0)
- torquebox-naming (2.2.0-java)
- torquebox-rake-support (2.2.0)
+ torquebox-core (= 2.3.0)
+ torquebox-transactions (= 2.3.0)
+ torquebox-naming (2.3.0-java)
+ torquebox-rake-support (2.3.0)
rake (>= 0.8.7)
- torquebox-security (2.2.0-java)
- torquebox-core (= 2.2.0)
- torquebox-stomp (2.2.0)
- torquebox-core (= 2.2.0)
- torquebox-messaging (= 2.2.0)
- torquebox-transactions (2.2.0)
- torquebox-core (= 2.2.0)
- torquebox-web (2.2.0-java)
+ torquebox-security (2.3.0-java)
+ torquebox-core (= 2.3.0)
+ torquebox-stomp (2.3.0)
+ torquebox-core (= 2.3.0)
+ torquebox-messaging (= 2.3.0)
+ torquebox-transactions (2.3.0)
+ torquebox-core (= 2.3.0)
+ torquebox-web (2.3.0-java)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
trinidad (1.4.4)
jruby-rack (>= 1.1.10)
trinidad_jars (>= 1.1.0)
- trinidad_jars (1.1.1)
+ trinidad_jars (1.2.1)
twitter-stream (0.1.16)
eventmachine (>= 0.12.8)
http_parser.rb (~> 0.5.1)
simple_oauth (~> 0.1.4)
url_mount (0.2.1)
rack
- uuid (2.3.6)
+ uuid (2.3.7)
macaddr (~> 1.0)
yajl-ruby (1.1.0)
@@ -245,9 +216,7 @@ DEPENDENCIES
haml
jruby-rack
json-jruby
- kaminari
mocha
- newrelic_rpm
padrino!
padrino-rpm!
rabl
@@ -257,10 +226,10 @@ DEPENDENCIES
rest-client
rspec
rubyzip!
- torquebox (= 2.2.0)
- torquebox-cache (= 2.2.0)
- torquebox-messaging (= 2.2.0)
- torquebox-rake-support (= 2.2.0)
+ torquebox (= 2.3.0)
+ torquebox-cache (= 2.3.0)
+ torquebox-messaging (= 2.3.0)
+ torquebox-rake-support (= 2.3.0)
trinidad
uuid
yajl-ruby
8 config/deploy.rb
View
@@ -5,7 +5,6 @@
require 'bundler/capistrano'
require 'open-uri'
require 'rest_client'
-require 'new_relic/recipes'
default_run_options[:pty] = true
@@ -49,7 +48,6 @@
before "deploy", "verify:rules"
after "deploy:cleanup", "alert:hipchat"
-after "deploy:cleanup", "newrelic:notice_deployment"
after("deploy") do
# Setup data directory
@@ -76,16 +74,10 @@
run "#{sudo} mkdir -p #{current_path}/tmp"
run "#{sudo} chmod 0755 #{current_path}/tmp"
run "#{sudo} chown -R torquebox:torquebox #{current_path}/tmp"
-
- # compile any java resources
- run "cd #{current_path} && #{sudo} rake"
# Deploy the application
run "#{sudo} torquebox deploy #{current_path} --name #{application} --env #{deploy_env} --context-path=#{context_path}"
- # Setup New Relic
- run "if [ -f #{shared_path}/newrelic.yml ]; then #{sudo} ln -sfn #{shared_path}/newrelic.yml #{current_path}/config; fi"
-
deploy.cleanup
end
91 models/machine.rb
View
@@ -21,8 +21,6 @@ def floor(seconds = 60)
class Machine < Base::Machine
include TorqueBox::Messaging::Backgroundable
- # include ::NewRelic::Agent::MethodTracer
-
attr_accessor :external_vm_id,
:external_host_id,
:stats
@@ -56,7 +54,6 @@ def create_from_ovf(inode, ovf)
inode.close_connection
end
end
- add_method_tracer :create_from_ovf
def self.all(inode)
begin
@@ -165,38 +162,67 @@ def readings(_interval = 300, _since = 10.minutes.ago.utc, _until = 5.minutes.ag
raise Exceptions::Unrecoverable, e.to_s
end
end
- add_method_tracer :readings
- def start(inode)
- logger.info("machine.start")
- machine = inode.vmware_api_adaptor.start(uuid)
- end
- def stop(inode)
- logger.info("machine.stop")
- machine = inode.vmware_api_adaptor.stop(uuid)
- end
+ # def start(inode)
+ # logger.info("machine.start")
+ # machine = inode.vmware_api_adaptor.start(uuid)
+ # end
- def restart(inode)
- logger.info("machine.restart")
- machine = inode.vmware_api_adaptor.restart(uuid)
- end
+ #def stop(inode)
+ # logger.info("machine.stop")
+ # machine = inode.vmware_api_adaptor.stop(uuid)
+ #end
+ #
+ #def restart(inode)
+ # logger.info("machine.restart")
+ # machine = inode.vmware_api_adaptor.restart(uuid)
+ #end
+ #
+ #def force_restart(inode)
+ # logger.info("machine.start")
+ # machine = inode.vmware_api_adaptor.force_restart(uuid)
+ #end
+ #
+ #def force_stop(inode)
+ # logger.info("machine.stop")
+ # machine = inode.vmware_api_adaptor.force_stop(uuid)
+ #end
- def force_restart(inode)
- logger.info("machine.start")
- machine = inode.vmware_api_adaptor.force_restart(uuid)
- end
+ # rescue RbVmomi::Fault => e
+ # logger.error(e.message)
+ # raise Exceptionss::Forbidden.new(e.message)
+
+ # rescue => e
+ # logger.error(e.message)
+ # raise Exceptionss::Unrecoverable
+ # end
+ # end
- def force_stop(inode)
- logger.info("machine.stop")
- machine = inode.vmware_api_adaptor.force_stop(uuid)
- end
+
+ # def force_restart(inode)
+ # logger.info("machine.force_restart")
+
+ # begin
+ # vm.ResetVM_Task.wait_for_completion
+ # @power_state = "restarting"
+
+ # rescue RbVmomi::Fault => e
+ # logger.error(e.message)
+ # raise Exceptionss::Forbidden.new(e.message)
+
+ # rescue => e
+ # logger.error(e.message)
+ # raise Exceptionss::Unrecoverable
+ # end
+ # end
+ # add_method_tracer :force_restart
# def save(inode)
# logger.info("machine.save")
# raise Exceptionss::NotImplemented
# end
- # add_method_tracer :save
+
# def delete(inode)
# logger.info("machine.delete")
@@ -214,7 +240,7 @@ def force_stop(inode)
# raise Exceptionss::Unrecoverable
# end
# end
- # add_method_tracer :delete
+
def nics=(_nics)
@nics = _nics.map {|nic| MachineNic.new(nic)}
@@ -224,7 +250,6 @@ def nics=(_nics)
end
end
end
- add_method_tracer :nics=
def disks=(_disks)
@disks = _disks.map {|disk| MachineDisk.new(disk)}
@@ -234,7 +259,6 @@ def disks=(_disks)
end
end
end
- add_method_tracer :disks=
private
@@ -268,15 +292,4 @@ def self.convert_power_state(tools_status, power_status)
raise Exceptions::Unrecoverable, e.message
end
end
-
- class << self
- include ::NewRelic::Agent::MethodTracer
- add_method_tracer :vmware_adaptor
- add_method_tracer :all
- add_method_tracer :all_with_readings
- add_method_tracer :find_by_uuid
- add_method_tracer :find_by_uuid_with_readings
- end
-
-
end
Please sign in to comment.
Something went wrong with that request. Please try again.