tag:blogger.com,1999:blog-9238405.post4347529560708676227..comments2024-03-18T02:04:50.380-07:00Comments on Agile Testing: Automated deployments with Fabric - tips and tricksGrig Gheorghiuhttp://www.blogger.com/profile/17863511617654196370noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-9238405.post-86626095641260318302015-03-05T11:33:39.514-08:002015-03-05T11:33:39.514-08:00Hi Grig,
I like the idea of using environments.py...Hi Grig,<br /><br />I like the idea of using environments.py. However, I cannot figure out how to override the environments.py with fab -H hostname or just run on a single host without editing the environments.py file.<br /><br />Do you have any ideas on how I could do this ?<br /><br />Thanks,<br />Marianoodahttps://www.blogger.com/profile/04144407031328582940noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-41784992265947620642011-01-06T03:05:23.416-08:002011-01-06T03:05:23.416-08:00You should look into fabric roles instead of speci...You should look into fabric roles instead of specifying hosts in your own functions.carinadigitalnoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-86427105151738616512010-03-16T15:06:14.066-07:002010-03-16T15:06:14.066-07:00Paul -- hehe, you're right.Paul -- hehe, you're right.Grig Gheorghiuhttps://www.blogger.com/profile/17863511617654196370noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-75110327572811583192010-03-16T15:06:03.465-07:002010-03-16T15:06:03.465-07:00Kami -- thanks, the more fabfile examples we have,...Kami -- thanks, the more fabfile examples we have, the better off we are.Grig Gheorghiuhttps://www.blogger.com/profile/17863511617654196370noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-42586048540711215432010-03-16T15:01:10.408-07:002010-03-16T15:01:10.408-07:00> Just copy and paste your fabfiles (or Puppet ...> Just copy and paste your fabfiles (or Puppet manifests) into a wiki page and there you have it.<br /><br />Surely you should have a Fabric file for that?pauldwaitehttps://www.blogger.com/profile/12162638898333255888noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-49502806693047260002010-03-16T11:26:05.384-07:002010-03-16T11:26:05.384-07:00Andrew -- thanks a lot for the pointers to your fa...Andrew -- thanks a lot for the pointers to your fabfiles. As I mentioned in a comment above to njl, I think it would be great to create a repository of sample fabfiles (and associated templates, config. files etc.). I'll take a more in-depth look at your files, it's interesting how you use templates.<br /><br />GrigGrig Gheorghiuhttps://www.blogger.com/profile/17863511617654196370noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-12721039683165152612010-03-16T10:39:22.612-07:002010-03-16T10:39:22.612-07:00Hi Grig,
I use both in a fabfile for installing ...Hi Grig, <br /><br />I use both in a fabfile for installing django on fresh ubuntu installations. For example, here is a task to configure nginx with fastcgi.<br /><br /><a href="http://github.com/andrewwatts/ubuntu2django/blob/master/fabfile.py#L160" rel="nofollow">http://github.com/andrewwatts/.../fabfile.py#L160</a><br /><br />The context is pulled out of the environment file and then upload_template will render the template when uploading to the server. <br /><br />The github repo is <a href="http://github.com/andrewwatts/ubuntu2django" rel="nofollow">ubuntu2django</a>, where you can see examples of the environment file (.fabricrc.sample) and the templates in the etc directory (for the task i mentioned the template is etc/nginx/sites-available/site).<br /><br />I was wondering about maintaining individual environment files for test, staging and production and defining the config file (eg: nginx.conf) as a template, instead of your current approach of maintaining individual config files for each environment.<br /><br />I was just curious if you had tried it and what issues you had encountered.Andrew Wattshttp://andrew.ionoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-8105508184689302942010-03-16T10:07:28.623-07:002010-03-16T10:07:28.623-07:00Hey Will! That's great. I'll experiment wi...Hey Will! That's great. I'll experiment with it a bit. It's true, it's kinda strange not too many people are using paver. I heard good things about it, but like the other many people never actually used it....I'll check it out.Grig Gheorghiuhttps://www.blogger.com/profile/17863511617654196370noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-90192440790888757172010-03-16T09:48:15.733-07:002010-03-16T09:48:15.733-07:00With a little bit of putzing I found you can actua...With a little bit of putzing I found you can actually import the dependency tracker from Paver into fabfile.py files. I've written a short post about it on my blog <a href="http://www.willdampier.info/2010/its-python-so-i-must-be-able-to-do-it/" rel="nofollow">here</a>.JudoWillhttps://www.blogger.com/profile/15647997652758698518noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-92141750733203500272010-03-16T08:07:42.465-07:002010-03-16T08:07:42.465-07:00Will -- you're right, it would be nice to be a...Will -- you're right, it would be nice to be able to specify dependencies. The Fabric maintainer, @bitprophet, told me he has a long list of features that he'll add to it, so maybe it's already on his list.Grig Gheorghiuhttps://www.blogger.com/profile/17863511617654196370noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-21117723652809735072010-03-16T08:06:59.174-07:002010-03-16T08:06:59.174-07:00Andrew -- I haven't tried either of the approa...Andrew -- I haven't tried either of the approaches you mention, but I'll look into it. Which one do you prefer?Grig Gheorghiuhttps://www.blogger.com/profile/17863511617654196370noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-74887385010606435392010-03-16T08:06:01.768-07:002010-03-16T08:06:01.768-07:00@njl it would be nice if we had a repository of sa...@njl it would be nice if we had a repository of sample fabfiles. I'll get in touch with @bitprophet, the fabric maintainer, about it.Grig Gheorghiuhttps://www.blogger.com/profile/17863511617654196370noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-54228671186079369262010-03-16T07:56:33.565-07:002010-03-16T07:56:33.565-07:00Nice article. The only thing I've found missi...Nice article. The only thing I've found missing from Fabric that I'd love to see has been task dependencies ... like Paver or Rake. My solution has been to do what you've done (call each dependent function in the parent) but I use the "runs_once" decorator to ensure things don't get done repeatedly.JudoWillhttps://www.blogger.com/profile/15647997652758698518noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-85571634945920775312010-03-15T20:04:10.200-07:002010-03-15T20:04:10.200-07:00Nice article, I was surprised to see no mention of...Nice article, I was surprised to see no mention of fabric config files or use of upload_template. Have you tried config files as an alternative to leveraging tasks to define hosts and/or using config files plus templates instead of *.tst, *.stg, or *.prd files.<br /><br />If you've tried either approach, what were the downsides you encountered?Andrew Wattshttp://andrew.ionoreply@blogger.comtag:blogger.com,1999:blog-9238405.post-57366014649417234602010-03-15T17:46:40.392-07:002010-03-15T17:46:40.392-07:00I actually have a "deployment" user with...I actually have a "deployment" user with read-only access to my version control system. My fab file does a checkout of the head to the server file system, then links and copies as needed.<br /><br />It's great looking at other folks' fab files. Mine look so pristine I keep feeling like I'm missing something ;)njlhttps://www.blogger.com/profile/04062833903241422549noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-12265322014672773342010-03-15T15:42:26.426-07:002010-03-15T15:42:26.426-07:00We're leveraging fabric in the same way. We h...We're leveraging fabric in the same way. We have a fabfile deploy script that will pull a Java .war file and deploy it out to our environments. We also try to make sure that before an application is deployed to a common development environment, the fabfile script needs to be in place. Loving Fabric!Unknownhttps://www.blogger.com/profile/02327991562875131850noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-60947339092643248882010-03-15T14:37:12.524-07:002010-03-15T14:37:12.524-07:00Thanks, njl! I updated my post accordingly.Thanks, njl! I updated my post accordingly.Grig Gheorghiuhttps://www.blogger.com/profile/17863511617654196370noreply@blogger.comtag:blogger.com,1999:blog-9238405.post-86784652291874286892010-03-15T14:30:47.565-07:002010-03-15T14:30:47.565-07:00Copying files to the server from my local machine ...Copying files to the server from my local machine has always felt dangerous to me. To your "If it's not in a Fabric fabfile, it's not deployable" you should add, "Only deploy files that are checked out of source control."njlhttps://www.blogger.com/profile/04062833903241422549noreply@blogger.com