有没有类似用 JavaScript 编写的 Fabric 的部署工具?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11088892/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 12:04:05  来源:igfitidea点击:

Is there a deployment tool similar to Fabric written in JavaScript?

javascriptnode.jsdeploymentfabric

提问by Peter Throwson

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.

我整理了一个几乎完全在 node.js 上使用 Javascript 的移动开发堆栈。除了SASS(更喜欢LESS)和Fabric。我不想污染我的开发目录,因为无论如何我必须组合和缩小 JS 和 CSS,我想我也可以使用 node.js 来提供我的代码。

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.

我想减少对 Ruby 和/或 Python 的依赖。我并没有真正使用 Fabric 的所有功能,所以我希望更换它。但是我找不到任何用 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.
  • 从 git 存储库中拉取。
  • 在本地安装依赖项。
  • 缩小并结合调用 require.js/SASS 的 JS/CSS。
  • 运行测试套件。
  • 通过 node.js 提供代码以进行动手操作或使用 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?

Fabric 可能已经有点矫枉过正了,我只将它用于我的 Python Web 项目,因为必要的服务器不在我的机器上运行,但这里的情况并非如此。在没有 Fabric 的情况下处理这个问题的最佳方法是什么?

采纳答案by jsalonen

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.

到目前为止,我发现的最有前途的直接候选者是 launch ( https://github.com/bengourley/launch)。然而,它已经有一年多没有更新了,这让我对它的未来状态有点怀疑。

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_modulesfrom .gitignore. One of the implications is that you don't have to install dependencies locally, removing the second step (try if reading thisconvinces 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 gruntwhen deploying to do the minification
  • 经过一些试验和错误后,我node_modules.gitignore. 其含义之一是您不必在本地安装依赖项,删除第二步(尝试阅读本文是否也说服了您)。
  • 我最终自动化了 JS/CSS 处理、linting 和运行grunt 的测试套件。强烈推荐。
  • 我很懒,现在我正在将缩小的内容添加到 git 中(希望我会在某个时候改变它)。
    • 编辑:我不再将缩小的东西添加到 git 中,而是grunt在部署时运行以进行缩小

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

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

  1. The best solution (deployment-wise) is to avoid running your own servers and use ready, cloud-solutions such as Herokuor Nodejitsu
  2. Alternatively, you could host your own node.js deployment tools. For instance you can install Nodesteron 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.
  1. 最好的解决方案(部署方面)是避免运行自己的服务器并使用现成的云解决方案,例如HerokuNodejitsu
  2. 或者,您可以托管自己的 node.js 部署工具。例如,您可以在自己的服务器上安装Nodester并使用提供的 API 和工具。
  3. 在 Linux 机器上,编写重新部署 node.js 应用程序的单行程序非常容易,所以我觉得我不需要为此使用任何额外的工具(除了 bash)。

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!

编辑:刚刚发现关于部署(https://github.com/visionmedia/deploy)。看起来很有希望。你也可以试试!

回答by Daniel

Flightplanlooks very interesting and is inspired by Fabric. Its documentation has extensive examples and is worth checking out.

Flightplan看起来很有趣,灵感来自 Fabric。它的文档有大量的例子,值得一看。

回答by ruffrey

stagecoachdoes staging and deployment, with support for dependency installation and upstart scripts.

stagecoach进行暂存和部署,支持依赖安装和新贵脚本。

Here's a blog postabout deploying node & mongo using stagecoach.

这是一篇关于使用驿马车部署节点和 mongo的博客文章

回答by nu everest

Another javascript deployment tool is shipitjs

另一个 javascript 部署工具是shipitjs

From their readme:

从他们的自述文件:

Shipit is an automation engine and a deployment tool written for node / iojs.

Shipit was built to be a Capistrano alternative for people who don't know ruby, or who experienced some issues with it. If you want to write tasks in JavaScript and enjoy the node ecosystem, Shipit is also for you.

Shipit是一个为node/iojs编写的自动化引擎和部署工具。

Shipit 是为不了解 ruby​​ 或遇到一些问题的人而构建的 Capistrano 替代品。如果你想用 JavaScript 编写任务并享受节点生态系统,Shipit 也适合你。