$ cat config/deploy.rb
# config valid only for Capistrano 3.1
lock '3.2.1'
require "capistrano/copy.rb"
set :log_level, :debug
set :servicename, "XYZ Service"
all_servers = %w{10.11.11.11}
set :app_name, 'nrpe'
set :deploy_to, '/tmp/blah/' + fetch(:app_name)
set :business_name, 'our.testing'
set :deploy_from, '/srv/props/' + fetch(:business_name) + '/' + fetch(:app_name) + '/app'
# This is where we rsync the code/config from
set :repo_base, '/var/tmp'
set :repo_url, fetch(:repo_base) + '/' + fetch(:app_name) + "/"
set :copy_cache, false
set :copy_compression, :zip
# from https://github.com/wercker/capistrano-scm-copy
# Default value for :scm is :git
set :scm, :copy
namespace :deploy do
desc "Show us the uname"
task :uname do
on all_servers do |host|
puts capture(:'uname -a')
end
end
desc "Go get our code"
task :pull do
run_locally do
execute "rsync -avH '#{repo_url}' '#{fetch(:deploy_from)}'"
end
end
end
[cstewart@da1shal012new nrpe]$ cap production deploy
INFO[ca2c8c3d] Running /usr/bin/env mkdir -pv /tmp/blah/nrpe/shared /tmp/blah/nrpe/releases on 10.11.11.11
DEBUG[ca2c8c3d] Command: /usr/bin/env mkdir -pv /tmp/blah/nrpe/shared /tmp/blah/nrpe/releases
INFO[ca2c8c3d] Finished in 0.183 seconds with exit status 0 (successful).
DEBUG[969505ec] Running /usr/bin/env [ -f /tmp/blah/nrpe/current/REVISION ] on 10.11.11.11
DEBUG[969505ec] Command: [ -f /tmp/blah/nrpe/current/REVISION ]
DEBUG[969505ec] Finished in 0.007 seconds with exit status 1 (failed).
tar -cvzf archive.tar.gz Capfile app config lib
Capfile
app/
app/CHANGES
app/Capfile
app/LICENSE
app/GPL
app/mkmf.log
app/OPENSSL
app/bin/
app/bin/dir_fresh.sh
app/bin/nrpe.cfg
app/bin/nrpe.cfg~
app/bin/ssleay32.dll
app/bin/nrpe_nt.log
app/bin/fraudtest.xml
app/bin/libeay32.dll
app/bin/NRPE_NT.exe
app/bin/test.cmd
app/bin/diskspace_check.sh
app/bin/dir_size.sh
app/bin/dbnstest.sh
app/INSTALL
config/
config/deploy/
config/deploy/staging.rb
config/deploy/production.rb
config/deploy.rb.1
config/deploy.rb
lib/
lib/capistrano/
lib/capistrano/tasks/
tar -cvzf archive.tar.gz Capfile app config lib
Capfile
app/
app/CHANGES
app/Capfile
app/LICENSE
app/GPL
app/mkmf.log
app/OPENSSL
app/bin/
app/bin/dir_fresh.sh
app/bin/nrpe.cfg
app/bin/nrpe.cfg~
app/bin/ssleay32.dll
app/bin/nrpe_nt.log
app/bin/fraudtest.xml
app/bin/libeay32.dll
app/bin/NRPE_NT.exe
app/bin/test.cmd
app/bin/diskspace_check.sh
app/bin/dir_size.sh
app/bin/dbnstest.sh
app/INSTALL
config/
config/deploy/
config/deploy/staging.rb
config/deploy/production.rb
config/deploy.rb.1
config/deploy.rb
lib/
lib/capistrano/
lib/capistrano/tasks/
==> release_path: /tmp/blah/nrpe/releases/20150218171024 is created on all roles <==
INFO[b90a47db] Running /usr/bin/env mkdir -p /tmp/blah/nrpe/releases/20150218171024 on 10.11.11.11
DEBUG[b90a47db] Command: /usr/bin/env mkdir -p /tmp/blah/nrpe/releases/20150218171024
INFO[b90a47db] Finished in 0.008 seconds with exit status 0 (successful).
DEBUG[28d3e164] Running /usr/bin/env mktemp on 10.11.11.11
DEBUG[28d3e164] Command: /usr/bin/env mktemp
DEBUG[28d3e164] /tmp/tmp.bAgr4auZbV
DEBUG[28d3e164] Finished in 0.018 seconds with exit status 0 (successful).
DEBUGUploading archive.tar.gz 0.0%
DEBUGUploading archive.tar.gz 2.69%
DEBUGUploading archive.tar.gz 5.37%
DEBUGUploading archive.tar.gz 8.06%
DEBUGUploading archive.tar.gz 10.74%
DEBUGUploading archive.tar.gz 13.43%
DEBUGUploading archive.tar.gz 16.11%
DEBUGUploading archive.tar.gz 18.8%
DEBUGUploading archive.tar.gz 21.49%
DEBUGUploading archive.tar.gz 24.17%
DEBUGUploading archive.tar.gz 26.86%
INFOUploading archive.tar.gz 29.54%
DEBUGUploading archive.tar.gz 32.23%
DEBUGUploading archive.tar.gz 34.91%
DEBUGUploading archive.tar.gz 37.6%
INFOUploading archive.tar.gz 40.28%
DEBUGUploading archive.tar.gz 42.97%
DEBUGUploading archive.tar.gz 45.66%
DEBUGUploading archive.tar.gz 48.34%
DEBUGUploading archive.tar.gz 51.03%
DEBUGUploading archive.tar.gz 53.71%
DEBUGUploading archive.tar.gz 56.4%
DEBUGUploading archive.tar.gz 59.08%
DEBUGUploading archive.tar.gz 61.77%
DEBUGUploading archive.tar.gz 64.46%
DEBUGUploading archive.tar.gz 67.14%
INFOUploading archive.tar.gz 69.83%
DEBUGUploading archive.tar.gz 72.51%
DEBUGUploading archive.tar.gz 75.2%
DEBUGUploading archive.tar.gz 77.88%
DEBUGUploading archive.tar.gz 80.57%
DEBUGUploading archive.tar.gz 83.25%
DEBUGUploading archive.tar.gz 85.94%
DEBUGUploading archive.tar.gz 88.63%
DEBUGUploading archive.tar.gz 91.31%
DEBUGUploading archive.tar.gz 94.0%
DEBUGUploading archive.tar.gz 96.68%
DEBUGUploading archive.tar.gz 99.37%
INFOUploading archive.tar.gz 100.0%
INFO[943be656] Running /usr/bin/env tar -xzf /tmp/tmp.bAgr4auZbV -C /tmp/blah/nrpe/releases/20150218171024 on 10.11.11.11
DEBUG[943be656] Command: /usr/bin/env tar -xzf /tmp/tmp.bAgr4auZbV -C /tmp/blah/nrpe/releases/20150218171024
INFO[943be656] Finished in 0.027 seconds with exit status 0 (successful).
INFO[cacf55f0] Running /usr/bin/env rm /tmp/tmp.bAgr4auZbV on 10.223.132.247
DEBUG[cacf55f0] Command: /usr/bin/env rm /tmp/tmp.bAgr4auZbV
INFO[cacf55f0] Finished in 0.006 seconds with exit status 0 (successful).
==> release_path: /tmp/blah/nrpe/releases/20150218171024 is created on all roles <==
INFO[a5717de9] Running /usr/bin/env mkdir -p /tmp/blah/nrpe/releases/20150218171024 on 10.11.11.11
DEBUG[a5717de9] Command: /usr/bin/env mkdir -p /tmp/blah/nrpe/releases/20150218171024
INFO[a5717de9] Finished in 0.007 seconds with exit status 0 (successful).
DEBUG[69ffbd93] Running /usr/bin/env mktemp on 10.11.11.11
DEBUG[69ffbd93] Command: /usr/bin/env mktemp
DEBUG[69ffbd93] /tmp/tmp.hvY0EB454U
DEBUG[69ffbd93] Finished in 0.006 seconds with exit status 0 (successful).
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 10.11.11.11: No such file or directory - archive.tar.gz
Errno::ENOENT: No such file or directory - archive.tar.gz
Tasks: TOP => copy:create_release => copy:deploy
(See full trace by running task with --trace)
The deploy has failed with an error: #<SSHKit::Runner::ExecuteError: Exception while executing on host 10.11.11.11 No such file or directory - archive.tar.gz>
--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/6b998dca-c3b9-4928-a3b3-2ba1d821d37d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/472e649f-276b-43ea-88c9-5b56926cd7f2%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/647a1381-7cef-439a-8685-1ea1e71589c4%40googlegroups.com.
send an email to capistrano+unsubscribe@googlegroups.com
<mailto:capistrano+unsub...@googlegroups.com>.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/capistrano/647a1381-7cef-439a-8685-1ea1e71589c4%40googlegroups.com
<https://groups.google.com/d/msgid/capistrano/647a1381-7cef-439a-8685-1ea1e71589c4%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to capistrano+unsubscribe@googlegroups.com
<mailto:capistrano+unsub...@googlegroups.com>.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/capistrano/CAN_%2BVLUyQskkLRO9FRkwo0iYEiERREoCL6EEqwAjk2D17thH7g%40mail.gmail.com
<https://groups.google.com/d/msgid/capistrano/CAN_%2BVLUyQskkLRO9FRkwo0iYEiERREoCL6EEqwAjk2D17thH7g%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/54E61C49.3020703%40jhu.edu.
on roles(tar_roles) do
# Make sure the release directory exists
puts "==> release_path: #{release_path} is created on #{tar_roles} roles <=="
send an email to capistrano+...@googlegroups.com
<mailto:capistrano+unsubscribe@googlegroups.com>.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/capistrano/647a1381-7cef-439a-8685-1ea1e71589c4%40googlegroups.com
<https://groups.google.com/d/msgid/capistrano/647a1381-7cef-439a-8685-1ea1e71589c4%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to capistrano+...@googlegroups.com
<mailto:capistrano+unsubscribe@googlegroups.com>.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/capistrano/CAN_%2BVLUyQskkLRO9FRkwo0iYEiERREoCL6EEqwAjk2D17thH7g%40mail.gmail.com
<https://groups.google.com/d/msgid/capistrano/CAN_%2BVLUyQskkLRO9FRkwo0iYEiERREoCL6EEqwAjk2D17thH7g%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/81bf41a0-cd09-4568-869e-10fbda651ce6%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/d0527002-a2e5-4696-b5a0-2d55c27dddab%40googlegroups.com.
$ cap production debug_tar_roles
Host Obj: 10.223.132.247
DEBUG[aabe7db0] Running /usr/bin/env hostname on 10.223.132.247
DEBUG[aabe7db0] Command: /usr/bin/env hostname
DEBUG[aabe7db0] localhost.localdomain
DEBUG[aabe7db0] Finished in 0.184 seconds with exit status 0 (successful).
DEBUG[4d67cb3d] Running /usr/bin/env uptime on 10.223.132.247
DEBUG[4d67cb3d] Command: /usr/bin/env uptime
DEBUG[4d67cb3d] 09:44:43 up 140 days, 8:34, 2 users, load average: 0.00, 0.01, 0.05
DEBUG[4d67cb3d] Finished in 0.009 seconds with exit status 0 (successful).
INFOlocalhost.localdomain: 09:44:43 up 140 days, 8:34, 2 users, load average: 0.00, 0.01, 0.05
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/321e1b7d-d393-455a-81dd-1cae8f55f36b%40googlegroups.com.
role :OurServers, %w{10.223.132.247}
set :tar_roles, fetch(:OurServers)
I think you’re confusing variables with roles.
Roles are groups of servers (anything Enumerable which looks like a hostname, or a server DSN, etc), variables are set and fetched with set() and fetch().
The plugin expects to fetch() a variable with the name of :tar_roles which contains a role name, this role name defaults to the special case :all.
Here the plugin looks up the variable :tar_roles.
Thus, if you have:
role :our_custom_role, %w{hostone hosttwo hostthree}
set :tar_roles, :our_custom_role
You’re telling the plugin what it seems to need to know, if you do what you are doing:
role :our_custom_role, %w{hostone hosttwo hostthree}
set :tar_roles, fetch(:our_custom_role)
You’re essentially setting :tar_roles to nothing, since fetch(:a_role_name) will find nothing.
--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/c361d1ed-944f-4aec-aa58-468343876755%40googlegroups.com.