TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to automate Python apps deployment?

4 点作者 aalhour超过 9 年前
Hello,<p>I am researching how to automate the development environment setup for a team of 15+ developers that is currently manual and requires a lot of repetitive work. In addition to that I am researching how to automate testing, integration and deployment of these web apps to different environments (staging, and production).<p>How would you implement this huge workflow and how would you tackle it? Any success stories of automating the deployment of similar apps (Python, JS, SASS, Config files, git cloning of projects) in other companies&#x2F;projects?<p>The current workflow is that each developer clones all the apps (30+) and sets them up locally via editing config files, then sets up Apache for some internal URLs, and then starts working on them. Finishes work, commits to remote development branch and from their everything is just manual work: review of pull-requests and merging branches...etc. Production releases are manual as well.<p>I am also interested in knowing how to setup&#x2F;refactor&#x2F;change Apps in such away that would enable further automation to be as easy as possible.<p>Cheers!

5 条评论

twunde超过 9 年前
1) Look into configuration management. Ansible and Salt Stack are both python-based so everyone should be able to contribute if needed.<p>2)It&#x27;s popular to run your automation through CI tools like Jenkins because it has auditing and logging built in and it&#x27;s easy to set up.<p>3) Don&#x27;t run bower&#x2F;npm install&#x2F;update on production because if npm or github go down then your production site will break because a partial code change has taken place. You should build (and test) on a separate server and then copy the code changes over to production.<p>Really you&#x27;re looking for a Capistrano for python apps. If you&#x27;re going to build a deployment tool on your own it&#x27;s worth looking at their approach. For python, fabric is a fairly standard way to automate code deployments. The good news is that you&#x27;re on the right path. Having automated deployment procedures will give devs a lot more time back AND remove a whole class of errors<p>I&#x27;ve moved my current company&#x27;s deployment from manual line by line ftp deployment to an automated build and deploy using Jenkins to trigger ansible playbooks. Given the choice, I&#x27;d probably just use capistrano or fabric instead of building from scratch. I&#x27;d estimate that we&#x27;ve saved several months of work per a year in both deployment time and in debugging production issues.
评论 #10994502 未加载
NicoJuicy超过 9 年前
I could integrate my entire workflow with Jenkins and custom parameters and custom development of console applications ( creating automated versions of packages ( npm &#x2F; nuget &#x2F; .. ), mostly with the use of the &quot;build number&quot;)<p>It handles 3 situations:<p>- local ( not included in Jenkins, but is automated within the development tools -- eg. Visual Studio. It uses local databases and local paths)<p>- development<p>- beta<p>- live &#x2F; production<p>So my entire workflow is automated now, the merging of branches and etc. is done by the developer. Testing is automated ( unit tests) ... Deploying is just a matter of minutes instead of 1,5 hours. And best of all, all related packages are updated automaticly with the correct tag ( development, beta, ..)<p>Another way would be using TeamCity ( instead of Jenkins)
评论 #10988634 未加载
dozzie超过 9 年前
For deployment: use your OS&#x27;s packaging system, for both dependencies and actual applications. `git pull&#x27; rarely does good job, but `apt-get install&#x27; often is just enough.<p>For development: use your OS&#x27;s packaging system for installing dependencies and a makefile for compiling things.<p>Really, I don&#x27;t understand why programmers tend to avoid using sysadmins&#x27; tools in their work, especially now with this DevOps thing, when programmers are supposed to see some administration themselves.
评论 #10988816 未加载
andrewjshults超过 9 年前
Longer blog post here: <a href="http:&#x2F;&#x2F;dna.hioscar.com&#x2F;2015&#x2F;10&#x2F;14&#x2F;scaling-deployments-at-oscar&#x2F;" rel="nofollow">http:&#x2F;&#x2F;dna.hioscar.com&#x2F;2015&#x2F;10&#x2F;14&#x2F;scaling-deployments-at-osc...</a><p>We work out of a mono-repo and use pants (<a href="https:&#x2F;&#x2F;pantsbuild.github.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pantsbuild.github.io&#x2F;</a>) for python&#x2F;jvm&#x2F;js packaging to deploy on mesos (<a href="https:&#x2F;&#x2F;mesos.apache.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mesos.apache.org&#x2F;</a>). Pants gives us (effectively) the same development workflow as in production and let&#x27;s us treat any application (we have ~500 at this point) as just a command line executable (for things with weird lib dependencies, we do statically compiled wheels for each architecture - CentOS and OS X in our case - on our own pypi mirror). We&#x27;ve got a few kinks to still workout for local development of web projects (mostly related to JS&#x2F;CSS) but for things that don&#x27;t touch the frontend it&#x27;s pretty beautiful.
afarrell超过 9 年前
I am currently finishing up writing a step-by-step tutorial on this very topic. Please check it out and, if you have a question about any piece of it, write a comment and I&#x27;d be happy to help.<p><a href="https:&#x2F;&#x2F;amfarrell.com&#x2F;saltstack-from-scratch&#x2F;" rel="nofollow">https:&#x2F;&#x2F;amfarrell.com&#x2F;saltstack-from-scratch&#x2F;</a><p>Also let me know if any of the integration tests for any of the tests fail on your setup.
评论 #10994493 未加载