git 如何轻松地将我的 bitbucket 代码部署到我的生产服务器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16518129/
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-09-10 16:08:26  来源:igfitidea点击:

How to deploy my bitbucket code easily to my production server

gitbitbucket

提问by Xavier

I got a private git repo on Bitbucket, i update it from my local repo. It works just fine. But now my project is about to be done and i need to find a solution to deploy my code to the production server.

我在 Bitbucket 上有一个私人 git 存储库,我从我的本地存储库更新它。它工作得很好。但是现在我的项目即将完成,我需要找到一个解决方案将我的代码部署到生产服务器。

I look for a easy and fast solution but i did not find anything for bitbucket, all solution seems to be designed for github...

我正在寻找一个简单快速的解决方案,但我没有找到任何适用于 bitbucket 的解决方案,所有解决方案似乎都是为 github 设计的...

Of course i can connect to the serv and make a git pullbut i really want to find something to automate this.

当然,我可以连接到服务器并制作一个,git pull但我真的很想找到一些东西来自动化这个。

Do you know a service, a tool for that ?

你知道一个服务,一个工具吗?

采纳答案by Xavier

I finally use choose Dandelion.

我终于使用选择蒲公英

It's really easy to install : gem install dandelionand easy to use, you just have to edit dandelion.yml put your connection info there and then dandelion deploy!

它真的很容易安装:gem install dandelion并且易于使用,您只需要编辑 dandelion.yml 将您的连接信息放在那里然后dandelion deploy

Works fine, fully integrated with git and service agnostic :)

工作正常,与 git 和服务不可知论完全集成:)

回答by Jon Cairns

The idea that there is a easy and fast solution to deploy your code is a lie - don't believe it. There are always things that you've missed, and there are always things that go wrong. So don't underestimate it or leave it as an afterthought.

有一个简单快速的解决方案来部署您的代码的想法是一个谎言 - 不要相信它。总有一些事情你错过了,总有一些事情出错了。所以不要低估它或把它作为事后的想法。

You haven't given away anything about your application, so I can't give you specific details, but if you own your own server and are looking for a way of simplifying the deployment step, take a look at capistrano. It's not only for rails apps, despite the fact that it works for these out of the box. I've used it on PHP projects with great success - it just takes a bit more setup.

您没有透露有关您的应用程序的任何信息,因此我无法提供具体细节,但是如果您拥有自己的服务器并且正在寻找一种简化部署步骤的方法,请查看capistrano。它不仅适用于 rails 应用程序,尽管它适用于这些开箱即用的应用程序。我已经在 PHP 项目中使用它取得了巨大的成功 - 只需要进行更多的设置。

If you're looking for a fully automated solution including hosting, you might like something like heroku. However, this is dependent on your application, and what technology you've used.

如果您正在寻找包括托管在内的全自动解决方案,您可能会喜欢heroku 之类的东西。但是,这取决于您的应用程序以及您使用的技术。

回答by aymericbeaumet

Without the necessary of an external service, you can use the Git hooksto automatically deploy your code to your server.

无需外部服务,您可以使用Git 挂钩自动将代码部署到您的服务器。

For example, you can copy your code using rsyncor scpafter each commit on the masterbranch.

例如,您可以使用master分支上的每次提交rsyncscp在每次提交之后复制您的代码。

回答by Abhishek Choudhary

if its bitbucket , the first thing comes in mind is easy , scalable. During my deployment of BitBucket , I did a preety big research and I used Jelastic. Its been a while now and now I can confirm you that its super stable-

如果它的 bitbucket,首先想到的是容易,可扩展。在我部署 BitBucket 期间,我做了一个非常大的研究,我使用了Jelastic。它已经有一段时间了,现在我可以向你确认它超级稳定-

Maven is a build automation and software comprehension tool which is primarily used for Java programming. With Maven you can add any public or private project to Jelastic and build it in the cloud. Jelastic takes your application's source code directly from your version control system (SVN or Git).

Maven 是一个构建自动化和软件理解工具,主要用于 Java 编程。使用 Maven,您可以将任何公共或私有项目添加到 Jelastic 并在云中构建它。Jelastic 直接从您的版本控制系统(SVN 或 Git)获取应用程序的源代码。

I will recommend to try Jelastic once for bitbucket implementation and compare. More details can be found -

我会建议尝试一次 Jelastic 来实现 bitbucket 并进行比较。可以找到更多详细信息 -

http://jelastic.com/docs/bitbucket-project-maven

http://jelastic.com/docs/bitbucket-project-maven