有没有类似于用JavaScript编写的Fabric的部署工具? [英] Is there a deployment tool similar to Fabric written in JavaScript?

查看:160
本文介绍了有没有类似于用JavaScript编写的Fabric的部署工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我把一个几乎完全使用JavaScript的移动开发栈放在了node.js上。唯一的例外是SASS(比较喜欢LESS)和Fabric。我不喜欢污染我的开发目录,因为我必须结合和缩小JS和CSS,我想我也可以使用node.js来服务我的代码。



我想减少对Ruby和/或Python的依赖。我没有真正使用Fabric的所有功能,所以我希望更换它。但是我找不到任何类似的Javascript工具。



我需要的是:




  • 从git存储库中取出。

  • 在本地安装depencies。

  • 调整require / js /

  • 运行testuite。

  • 通过node.js提供代码,供实际操作或使用Ripple进行测试。



Fabric可能已经过度了,我只将它用于我的Python Web项目,因为必要的服务器不会在我的机器上运行,但这不是这样的。如果没有Fabric,最好的处理方式是什么?

解决方案

我一直在思考同样的问题。



目前,我发现的最有希望的直接候选人是启动( https://github.com/bengourley/launch )。但是,它一年没有更新,这让我对它的未来状况有点怀疑。



在明显好的解决方案的缺席中,我结束了以下列方式逐条解决整个构建/部署问题:




  • 经过一些尝试和错误,我删除了 node_modules .gitignore 。其中一个含义是您不必在本地安装依赖项,删除第二步(尝试如果阅读这个也说服你)。


  • 我最终自动化了JS / CSS处理,使用 grunt 运行的linting和测试套件。强烈推荐。

  • 我很懒惰,只是现在我正在将最简单的东西添加到git中(希望我会在某些时候改变它)。


    • 编辑:我不再将简化的东西添加到git中,而是运行 grunt 部署时进行细化




通过这样做,我有效地消除了一些完全需要Fabric,只需要解决实际部署:


  1. 最好的解决方案(部署方式)是避免运行您自己的服务器并使用准备好的云解决方案,例如 Heroku Nodejitsu

  2. 或者,您可以托管自己的node.js部署工具。例如,您可以在自己的服务器上安装 Nodester ,并使用提供的API和工具。

  3. 在Linux框上,编写一个重新部署node.js应用程序的单行是非常容易的,所以我不觉得我需要使用任何额外的工具(除了bash)。就是说,我也很高兴听到更好的解决方案。



    编辑刚刚发现有关部署( https://github.com/visionmedia/deploy )。似乎很有希望你也可以尝试一下!


    I put together a mobile development stack that is almost entirely using Javascript on node.js. With the only exception of SASS (prefer it to LESS) and Fabric. I prefer not to pollute my development directory and as I have to combine and minify JS and CSS anyway, I thought I could also use node.js to serve my code.

    I would like to reduce my dependence on Ruby and/or Python. I don't really use all features of Fabric so I have the hope of replacing it. But I couldn't find any similar tool written in Javascript.

    All I need is to:

    • Pull from git repository.
    • Install depencies locally.
    • Minify and combine JS/CSS invoking require.js/SASS.
    • Run testsuite.
    • Serve the code via node.js for hands-on or testing with Ripple.

    Fabric might already be overkill, I only use it for my Python web projects because the necessary servers don't run on my machine, but that wouldn't be the case here. What would be the best way to handle this without Fabric?

    解决方案

    I've been pondering the same question myself.

    The most promising direct candidate I've found so far is launch (https://github.com/bengourley/launch). However, it hasn't been updated in like a year, which makes me a little suspicious about its future status.

    In the absense of obviously good solutions, I ended up solving the whole build/deployment problem, piece by piece in the following fashion:

    • After some trial and error, I removed node_modules from .gitignore. One of the implications is that you don't have to install dependencies locally, removing the second step (try if reading this convinces you as well).
    • I ended up automating JS/CSS processing, linting and test suite running with grunt. Highly recommended.
    • I'm lazy and just now I'm adding the minified stuff into git (hopefully I will change this at some point).
      • Edit: I no longer add minified stuff into git, but instead run grunt when deploying to do the minification

    By doing so, I effectively eliminated some of the need for Fabric altogether, leaving only the actual deployment to be solved:

    1. The best solution (deployment-wise) is to avoid running your own servers and use ready, cloud-solutions such as Heroku or Nodejitsu
    2. Alternatively, you could host your own node.js deployment tools. For instance you can install Nodester on your own servers and use the provided APIs and tools.
    3. On a Linux box, it is very easy to write one-liners that re-deploy a node.js app, so I don't feel like I need to use any extra tools (besides bash) for that.

    That being said, I too would be glad to hear about better solutions.

    Edit: just found out about deploy (https://github.com/visionmedia/deploy). Seems very promising. You could try that as well!

    这篇关于有没有类似于用JavaScript编写的Fabric的部署工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆