I am working on a Rails app, for deployment I usually checkout the code from git repository to the production servers which are running apache with mod-rails. But checking out the complete code, I am also checking out the spec and tests folder, I would like to avoid having test/specs code on my production servers. Is there a set way of packaging rails application for deployment ? I am using capistrano, so is there a way in capistrano to package so that test/spec are ignored while deploying ? Regards, Amiruddin Nagri, Bangalore, 560008, KA India Y! IM : amir_nagri-/E1597aS9LQAvxtiuMwx3w@public.gmane.org GTalk : amir.nagri-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sep 21, 9:31 am, Amiruddin Nagri <amir.na...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am working on a Rails app, for deployment I usually checkout the code from > git repository to the production servers which are running apache with > mod-rails. > > But checking out the complete code, I am also checking out the spec and > tests folder, I would like to avoid having test/specs code on my production > servers.Why would you want to do that? How will you run tests on your production application if you exclude those directories? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
For deployment what things you are going to used? Are you deploying it automatically? Is the problem with the spec''s cleaning your database? can you give clarification on that? On Tue, Sep 21, 2010 at 7:01 PM, Amiruddin Nagri <amir.nagri-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> I am working on a Rails app, for deployment I usually checkout the code > from git repository to the production servers which are running apache with > mod-rails. > > But checking out the complete code, I am also checking out the spec and > tests folder, I would like to avoid having test/specs code on my production > servers. > > Is there a set way of packaging rails application for deployment ? I am > using capistrano, so is there a way in capistrano to package so that > test/spec are ignored while deploying ? > > Regards, > Amiruddin Nagri, > Bangalore, 560008, KA > India > > Y! IM : amir_nagri-/E1597aS9LQAvxtiuMwx3w@public.gmane.org > GTalk : amir.nagri-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- Thanks & Regards, MuraliDharaRao.T +91-9642234646 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Why would you want to do that?I want to follow a good practice of deploying only the code required to run the functionality on production servers. If you are coming from java world, that is what you do, have your application jar/war only containing your source code and resources, the tests are packaged in a separate jar.> > How will you run tests on your production application if you exclude those > directories? > >Why would I want to run tests on my production servers ??? I have staging, uat and other environments to emulate production environment. Regards, Amiruddin Nagri, Bangalore, 560008, KA India Y! IM : amir_nagri-/E1597aS9LQAvxtiuMwx3w@public.gmane.org GTalk : amir.nagri-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Sep 21, 2010 at 9:31 PM, murali dhararao <sumudhar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> For deployment what things you are going to used? Are you deploying it > automatically? >I am deploying it using capistrano, it has built in tasks, you just have to configure your server address, username, password etc in a config file.> > Is the problem with the spec''s cleaning your database? can you give > clarification on that? > > No, I am not even running the specs against my production servers. I amtrying to follow a good practice where you package only the things required to run your application, and exclude the development necessary stuffs like specs/test. This is what I used to follow when I was doing java projects, have separate jar/war for production code and separate packaging of tests. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
there is a manual way to do it . git rm -r . --cached then edit .gitignore and add the specs folder git add . git commit -am " with no specs folder" git push to go back to normal git rm -r . --cached then edit .gitignore and remove the specs folder git add . git commit -am " with no specs folder" git push i think is possible to add this to you cap recipe , but the thing is you could add the specs folder to the .gitignore file and push, but before adding it you have to flush the cached index. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Amiruddin Nagri wrote:> On Tue, Sep 21, 2010 at 9:31 PM, murali dhararao <sumudhar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > >> For deployment what things you are going to used? Are you deploying it >> automatically? >> > > I am deploying it using capistrano, it has built in tasks, you just have > to > configure your server address, username, password etc in a config file.Just write a statement in your Cap recipe that deletes files you don''t want. But it would be best to keep the tests. If you run into a problem on your production server, you should be able to run the tests to see where things are going wrong. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Sep 22, 2010 at 10:53 PM, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> > But it would be best to keep the tests. If you run into a problem on > your production server, you should be able to run the tests to see where > things are going wrong. > >I will be very skeptical about running tests against production servers, what if by mistake I corrupt the data or drop the database itself. Deleting the spec folder sounds ok, but there are also many test configuration files floating around that are not need for eg environments/test.rb etc. What about them ? Rails is clearly missing the isolation for the necessary final executable code and rest of the files required for eg testing etc. It is much more clearly defined in Java world. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I think it is easy enough to do that. First of all, it is not rails fault since rails never know what plugins you''re using for test(e.g. rspec). You just make a branch and a tag for your particular release that doesn''t include all the files and folders you don''t need in production environment. Then let your capistrano to checkout that tag from your git repository. Regards, Lewisou On Sep 21, 9:31 pm, Amiruddin Nagri <amir.na...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am working on a Rails app, for deployment I usually checkout the code from > git repository to the production servers which are running apache with > mod-rails. > > But checking out the complete code, I am also checking out the spec and > tests folder, I would like to avoid having test/specs code on my production > servers. > > Is there a set way of packaging rails application for deployment ? I am > using capistrano, so is there a way in capistrano to package so that > test/spec are ignored while deploying ? > > Regards, > Amiruddin Nagri, > Bangalore, 560008, KA > India > > Y! IM : amir_na...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org > GTalk : amir.na...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Amiruddin Nagri wrote:> On Wed, Sep 22, 2010 at 10:53 PM, Marnen Laibow-Koser > <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote: > >> >> But it would be best to keep the tests. If you run into a problem on >> your production server, you should be able to run the tests to see where >> things are going wrong. >> >> > I will be very skeptical about running tests against production servers, > what if by mistake I corrupt the data or drop the database itself.Don''t run them against the production *database*!> > Deleting the spec folder sounds ok,But it isn''t.> but there are also many test > configuration files floating around that are not need for eg > environments/test.rb etc. What about them ? > > Rails is clearly missing the isolation for the necessary final > executable > code and rest of the files required for eg testing etc. It is much more > clearly defined in Java world.No...you''re trying to define an isolation point where there really isn''t one. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.