byte buddy_与Buddy一起更快地部署应用

byte buddy

The software development ecosystem is ridden with tools and technologies supporting each phase of the software development lifecycle. From development, testing, deployment, maintenance, scaling, analytics, and feedback implementation, various tools abound which can be used to carry out these functions effectively.

支持软件开发生命周期各个阶段的工具和技术遍布软件开发生态系统。 从开发,测试,部署,维护,扩展,分析和反馈实施到现在,各种各样的工具可用于有效执行这些功能。

The question is, how efficient and effortless is it to mash up these tools in the right order and watch your application go through each process from start to finish at speed? These tools would also have processes running together or separately. We will answer these in this post by deploying a Node app to heroku with a CI/CD process flow.

问题是,以正确的顺序组合这些工具并看着您的应用程序从头到尾快速地完成每个过程,这是多么高效和轻松? 这些工具还将使进程一起运行或分别运行。 我们将在本文中通过使用CI / CD流程将Node应用程序部署到heroku来回答这些问题。

一个简单的软件开发过程 ( A Simple Software Development Process )

While building and deploying a typical application, you possibly go through the following simple process (or skip some):

在构建和部署典型应用程序时,您可能需要执行以下简单过程(或跳过一些过程):

  • Develop in a local environment.

    在当地环境中发展。
  • Push to a remote repository using Git.

    使用Git推送到远程存储库。
  • Use a module bundler to bundle assets and files.

    使用模块捆绑器捆绑资产和文件。
  • Build the application using a build tool to generate deploy-ready files.

    使用构建工具构建应用程序以生成可部署的文件。
  • Deploy to a staging server.

    部署到登台服务器。
  • Deploy to production.

    部署到生产。
  • Monitor and analyze the application.

    监视和分析应用程序。
  • Re-run the above process each time an authorized push or merge is made to the chosen branch in the repository.

    每当对存储库中的选定分支进行授权推送或合并时,请重新运行上述过程。

With these processes running, you possibly have to send notifications when one or more of the stages are passed. This could be emailed, via Slack or wherever. You most likely don't want to do these manually and have to trigger each action for every commit.

随着这些进程的运行,您可能必须在经过一个或多个阶段时发送通知。 可以通过Slack或任何地方通过电子邮件发送。 您很可能不想手动执行这些操作,而必须为每次提交触发每个操作。

It would be amazing to have a continuous integration and continuous deployment pipeline that works to handle the above processes and handle triggers. This system CI/CD runs the stages either recurrently, manually or for every push to a remote repository.

拥有一个连续的集成和连续的部署管道来处理上述过程并处理触发器,这将是惊人的。 此系统CI / CD周期性地,手动地或每次推送到远程存储库时都运行这些阶段。

Not just one that works, but very robust, highly customizable and extendable.

不仅可行,而且非常健壮,高度可定制和可扩展。

Here goes Buddy.

伙伴们来了

CI / CD使用Buddy ( CI/CD using Buddy )

Buddy is an all-round deployment and software development CI/CD management tool. Buddy ships a robust and fast CI/CD pipeline to integrate just about any tool or service in your software development process.

Buddy是全方位部署和软件开发CI / CD管理工具。 Buddy提供了强大而快速的CI / CD管道,可以将软件开发过程中的几乎任何工具或服务集成在一起。

In a nutshell, Buddy helps you deploy applications in the fastest time possible while maintaining an efficient pipeline, having all the cool modern tools and services.

简而言之,Buddy可帮助您以最快的时间部署应用程序,同时保持高效的管道,并拥有所有出色的现代化工具和服务。

Setting up a pipeline in Buddy is as simple as ABC, and I mean it, it's that seamless. We will proceed to create a pipeline to deploy a node app to Heroku. During the pipeline setup, you'll find several pipeline actions from the list of actions which you can use.

在Buddy中建立管道就像ABC一样简单,我的意思是,那是无缝的。 我们将继续创建管道以将节点应用程序部署到Heroku。 在管道设置期间,您可以从可以使用的操作列表中找到几个管道操作。

将应用程序部署到Heroku ( Deploy Application to Heroku )

Here's a simple Express app created and having a Heroku Procfile. Fork it and clone to your local dev environment to get started.

这是一个简单的Express应用程序,它创建并具有Heroku Procfile。 分叉并克隆到本地开发环境以开始使用。

https://github.com/Chuloo/scotch-buddy

https://github.com/Chuloo/scotch-buddy

Go to Heroku and create a new application.

转到Heroku并创建一个新的应用程序。

Next, Install the heroku CLI tool on your local machine.

接下来, 在您的本地计算机上安装heroku CLI工具。

In your local development terminal, add the Heroku repository as a remote repository. Do this with:

在本地开发终端中,将Heroku存储库添加为远程存储库。 为此,请执行以下操作:

heroku git:remote -a scotch-buddy

scotch-buddy, in this case, is the name of our app on Heroku.

在这种情况下, scotch-buddy是我们在Heroku上的应用程序的名称。

Push the application to Heroku to trigger an initial deploy. Do this with:

将应用程序推送到Heroku以触发初始部署。 为此,请执行以下操作:

git push heroku master

Run the following command to open the app in your browser:

运行以下命令以在浏览器中打开应用程序:

heroku open

With this you have a deployed application which looks like this:

有了这个,您就有了一个已部署的应用程序,如下所示:

You can find mine here: https://scotch-buddy.herokuapp.com/

您可以在这里找到我的: https : //scotch-buddy.herokuapp.com/

Next step is to set up a CI/CD for the app, which triggers a Heroku deploy and shoots an email once new commits are pushed to the master branch of the repository.

下一步是为该应用程序设置CI / CD,一旦将新的提交推送到存储库的master分支,它就会触发Heroku部署并发送电子邮件。

设置好友 ( Setup Buddy )

Setting up buddy is pretty straightforward and you can signup using your GitHub, BitBucket or email account. Go on to Buddy.works to create a new account.

设置好友非常简单,您可以使用GitHub,BitBucket或电子邮件帐户进行注册。 转到Buddy.works创建一个新帐户。

设置好友管道 (Setup a Buddy Pipeline)

Sign in to get started. Create a new project and name it whatever you like.

登录以开始使用。 创建一个新项目,并随便命名。

Once created, add a new pipeline to the project.

创建完成后,将新管道添加到项目中。

This pipeline will contain all actions required for the app. An app can have multiple pipelines as well. Select the "On push" option for the trigger mode to trigger the pipeline flow once new commits are pushed to the repository. You can set it to happen at set times using "Recurrently" or manually using the "Manual" mode.

该管道将​​包含应用程序所需的所有操作。 一个应用程序也可以具有多个管道。 将新提交推送到存储库后,为触发模式选择“按推送”选项以触发管道流。 您可以将其设置为在“设置的时间”使用“循环”或在“手动”模式下进行。

Select the branch that triggers the deploy and in this case, master.

选择触发部署的分支,在这种情况下,选择master

添加一个Heroku动作 (Add a Heroku Action)

In the next page, select an action to add to the pipeline. This action will be triggered first. Not to worry, you can easily rearrange the flow of the actions later.

在下一页中,选择要添加到管道的操作。 此操作将首先触发。 不用担心,您以后可以轻松地重新安排操作流程。

Select an action from the list, and in this case, we select the "Heroku" action.

从列表中选择一个动作,在这种情况下,我们选择“ Heroku”动作。

Screen_Recording_2019-08-08_at_12-06632469-266d-41ff-ac84-3f9b928bf343.02.02_AM.mov

Screen_Recording_2019-08-08_at_12-06632469-266d-41ff-ac84-3f9b928bf343.02.02_AM.mov

This action transfers files from the repository to a specified Heroku Dyno otherwise known as project.

此操作将文件从存储库传输到指定的Heroku Dyno,也称为项目。

Authenticate your Heroku account and select an application from Heroku.

验证您的Heroku帐户,然后从Heroku中选择一个应用程序。

You can add custom .gitignore files here as well. Proceed to add the action.

您也可以在此处添加自定义.gitignore文件。 继续添加操作。

添加电子邮件操作 (Add an Email Action)

In the next page, which shows the pipeline, add a new action to send an email once the deploy action is completed. Do this by hitting the "+" icon under the deploy action.

在显示管道的下一页中,添加新操作以在完成部署操作后发送电子邮件。 通过单击部署操作下的“ +”图标来执行此操作。

You can quickly move the actions around, turn them on and off or choose if actions should run together or one should wait for the other.

您可以快速移动这些动作,打开和关闭它们,或者选择是应该同时执行动作还是应该等待另一个动作。

Screen_Recording_2019-08-07_at_11-9f26d3d5-5c46-4819-bc73-258df7887d69.57.18_PM.mov

Screen_Recording_2019-08-07_at_11-9f26d3d5-5c46-4819-bc73-258df7887d69.57.1​​8_PM.mov

You can also add an action to run on failure. Notification actions are suitable for this. You can also add an action for once the pipeline status changes from failed to successful.

您还可以添加操作以在失败时运行。 通知操作适用于此。 一旦管道状态从失败更改为成功,您还可以添加操作。

Hit the "Run Pipeline" button to the right of the screen.

点击屏幕右侧的“运行管道”按钮。

This runs the pipeline which deploys the app again and sends an email to the specified recipients.

这将运行管道,该管道将再次部署应用程序,并向指定的收件人发送电子邮件。

In the executions tab, you can see the list of executions as well as which passed, failed or is enqueued.

在执行选项卡中,您可以查看执行列表以及已通过,失败或排队的执行。

In the Pipelines tab, you can set variables for the pipeline and see analytics as well.

在“管道”选项卡中,您可以为管道设置变量,也可以查看分析。

Subsequent commits to master will automatically trigger a deploy to Heroku and notify a user via email. This is just a bit of what Buddy can do, with the tons of other actions, customizing a robust pipeline for an efficient workflow can be set up in minutes.

随后对master的提交将自动触发部署到Heroku并通过电子邮件通知用户。 这只是Buddy可以做的,还有大量其他动作,可以在几分钟之内建立一个健壮的管道来实现高效的工作流程。

结论 ( Conclusion )

In this post, we deployed a simple Heroku app to Heroku and set up a CI/CD pipeline using Buddy. This pipeline triggers a deploy to Heroku once a commit is pushed to the remote repositories then notifies specified email addresses.

在本文中,我们将一个简单的Heroku应用程序部署到了Heroku,并使用Buddy建立了CI / CD管道。 一旦将提交推送到远程存储库,该管道就会触发向Heroku的部署,然后通知指定的电子邮件地址。

Feel free to try out other actions on Buddy as it suits your workflow.

随意尝试Buddy上的其他操作,因为它适合您的工作流程。

翻译自: https://scotch.io/tutorials/deploy-apps-faster-with-buddy

byte buddy

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值