Hi,I'm developing several tasks that basically connect to a staging server fetches files from there, upload those file to other production servers; and then executes some commands on those server which are input those files.
I have created a :stage role so I can differentiate both kind of servers. The conf looks like:
role :production, ["server-A.example.com", "server-B.example.com"]
role :stage, "stage.example.com"
I have an internal task that fetches the desired files. Something like this:
task :fetch_from_staging, :roles => :stage do
stamp = Time.now.utc.strftime("%Y%m%d%H%M%S")
run "cd #{shared_path}; tar -cf /tmp/files.#{stamp}.tar ..."
get "/tmp/files.#{stamp}.tar", "/tmp/files.#{stamp}.tar"
stamp # returns the stamp so other tasks can have it
end
Then I have a task that runs only on :production servers but invokes the
:fetch_from_staging.
task :deploy_from_staging, :roles => :production do stamp = fetch_from_stagingupload File.open("/tmp/files.#{stamp}.tar", 'rb'), "/tmp/files.#{stamp}.tar"
run "something" endI have observed that after calling fetch_from_staging, calling run adds the staging server (stage.example.com) to the list of servers in which the command is executed. If I call fetch_from_staging with :roles => :stage option this does not happen. Is this documented or is it a bug?
Best regards, Manuel. -- * You received this message because you are subscribed to the Google Groups "Capistrano" group. * To post to this group, send email to [email protected] * To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano?hl=en
<<attachment: manuelva.vcf>>
