TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Deploying code with packages

10 pointsby balouover 11 years ago

8 comments

grosskurover 11 years ago
Packages are great because they simplify automation. Once you&#x27;ve got a package built and uploaded to a repository, you can install it across a large fleet of machines one-line of Chef or Puppet code.<p>There are some pitfalls, however:<p>* It can be time-consuming dealing with the arcane details of Debian package metadata or RPM spec files. If you&#x27;re deploying your own application code, you&#x27;re likely better off using fpm to generate a package from a directory tree:<p><a href="https://github.com/jordansissel/fpm" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jordansissel&#x2F;fpm</a><p>* If you have a complex stack, e.g., a specific version of Ruby and a large number of gem dependencies, you should avoid trying to separate things into individual packages. Just create a single Omnibus-style package that installs everything into a directory in &#x2F;opt:<p><a href="https://github.com/opscode/omnibus-ruby" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;opscode&#x2F;omnibus-ruby</a><p>* Maintaining build machines and repository servers takes ongoing effort. Shameless plug: This is why I created Package Lab---a hosted service for building packages and managing repositories. Currently in private beta and would love feedback:<p><a href="https://packagelab.com/" rel="nofollow">https:&#x2F;&#x2F;packagelab.com&#x2F;</a>
onliover 11 years ago
Yeah, sure. Because it is so easy to build packages, as the shortlyness of the article and the amount of the involved commands prove, it is surely a fast and good way to produce those packages to deploy your code.<p>For reference, it is not. Packages solve a different problem, and he even writes it: Well made packages with dependencies enable everyone to use the software, regardless of the involved system, given some constraints. They don&#x27;t need to be fast and they don&#x27;t need to be easy (as much as I would like them to), because they are used by specialists in a lengthy process.<p>But if one deploys code on a system, we know a bit more of the system than &quot;it is a computer&quot;. Maybe it is a standardized production instance, maybe it is a vm - in any case, we have direct access. So it is possible to use easier and faster methods to deploy code directly, without having to resort to arcane voodoo.<p>If you really want to use debs for deployment, at least use checkinstall and handle the dependencies manually. Then you need at most 3 command (.&#x2F;configure, make, checkinstall).
lambyover 11 years ago
I&#x27;ve done this for a few years, and when it&#x27;s all setup the integration with the underlying system is absolutely wonderful. In particular, your app is &quot;just&quot; another package - there&#x27;s no magical special-casing you ever need to think of.<p>You can also make your app quite modular - you can build multiple binary packages from one source which is perfect for different server roles that share a lot of code or configuration.<p>The only drawbacks are the fair amount of knowledge you need to share within your team, as well as quite a bit of machinery needed to get everything up and running once you move beyond a single &quot;dpkg -i&quot;-able .deb (some sort of APT repo, signing keys, blah blah).
datrover 11 years ago
How does this work with:<p>1) Clusters of application servers, where I will only want operations on shared resources to fire from one of the servers? E.g. database updates, shared file changes, etc.<p>2) When I want to deploy the code to a different location on the server so that I can have multiple versions of the application available? Do I have to spin up new servers for each version?<p>3) You mention roll back by just specifying an earlier package but I don&#x27;t see how this would work with stuff like database changes either.
评论 #7276342 未加载
评论 #7276338 未加载
评论 #7276318 未加载
ABSover 11 years ago
An (ex) colleague of mine blogged about the valid reasons behind this some time ago: <a href="http://www.thoughtworks.com/insights/blog/deploy-package-not-just-tag-branch-or-binary" rel="nofollow">http:&#x2F;&#x2F;www.thoughtworks.com&#x2F;insights&#x2F;blog&#x2F;deploy-package-not...</a>
olgeniover 11 years ago
&quot;Just avoid Debian, and everything else related to .deb packages&quot; seems a fitting solution to me.<p>(even more so after rewriting Erlang packages to get something that a) works and b) is not stale)
balouover 11 years ago
Very wordy but plenty of usefulness!
cauliturtleover 11 years ago
open my mind on deployment