简体   繁体   English

Bitbucket 的解决方案 -> 可以构建不同操作系统的管道 -> 部署到硬件

[英]Solution for Bitbucket -> pipeline that can build different OSes -> deploy to hardware

Our code is hosted in Bitbucket, originally we wanted to use Bitbucket pipeline to do the build.我们的代码托管在 Bitbucket 中,最初我们想使用 Bitbucket 管道来进行构建。 Since Bitbucket pipeline does not support building windows application, we need to find alternative solution to build.由于 Bitbucket 管道不支持构建 windows 应用程序,我们需要寻找替代解决方案来构建。

2 options: 1. Use Jenkins as build server to build 2. Use AWS CodePipeline to build 2 个选项: 1. 使用 Jenkins 作为构建服务器进行构建 2. 使用 AWS CodePipeline 进行构建

After code is built, it needs to be downloaded to a system connected with hardware.代码构建完成后,需要下载到与硬件相连的系统中。 Thus AWS CodeDeploy to on-premise solution seems the right choice.因此,AWS CodeDeploy 到本地解决方案似乎是正确的选择。

Here are the questions: 1. Is the assumption of using AWS CodeDeploy to download applications to on-premise correct?以下是问题: 1. 使用 AWS CodeDeploy 将应用程序下载到本地的假设是否正确? 2. If not correct, what should be the solution? 2. 如果不正确,应该如何解决?

If using Jenkins pipeline: 3. If using Jenkins for build server, would specifying "Poll SCM" or use GitPlugin be good enough for the connection from Bitbucket to Jenkins pipeline?如果使用 Jenkins 管道: 3. 如果使用 Jenkins 作为构建服务器,那么指定“Poll SCM”或使用 GitPlugin 是否足以实现从 Bitbucket 到 Jenkins 管道的连接? 4. Would Webhook help for the connection from Bitbucket to Jenkins' pipeline? 4. Webhook 是否有助于从 Bitbucket 连接到 Jenkins 的管道? Does it help in doing something when pull request?拉取请求时它有助于做某事吗? 5. How to connect Jenkins to AWS CodeDeploy if #1 assumption is correct? 5. 如果#1 假设正确,如何将 Jenkins 连接到 AWS CodeDeploy?

  1. If using AWS CodePipeline and then CodeDeploy, what are the steps?如果使用 AWS CodePipeline 然后使用 CodeDeploy,步骤是什么?

Thanks a lot in advance非常感谢提前

Here are the answers:以下是答案:

  1. Is the assumption of using AWS CodeDeploy to download applications to on-premise correct?使用 AWS CodeDeploy 将应用程序下载到本地的假设是否正确?

Yes是的

  1. If not correct, what should be the solution?如果不正确,应该如何解决?

CodeDeploy will download application or artifacts on the server where it is running. CodeDeploy 将在其运行的服务器上下载应用程序或工件。

  1. If using Jenkins for build server, would specifying "Poll SCM" or use GitPlugin be good enough for the connection from Bitbucket to Jenkins pipeline?如果使用 Jenkins 作为构建服务器,那么指定“Poll SCM”或使用 GitPlugin 是否足以用于从 Bitbucket 到 Jenkins 管道的连接?

You can use the BitBucket Jenkins Plugin @ https://wiki.jenkins.io/display/JENKINS/Bitbucket+Plugin您可以使用 BitBucket Jenkins 插件 @ https://wiki.jenkins.io/display/JENKINS/Bitbucket+Plugin

  1. Would Webhook help for the connection from Bitbucket to Jenkins' pipeline? Webhook 会帮助从 Bitbucket 连接到 Jenkins 的管道吗? Does it help in doing something when pull request?拉取请求时它有助于做某事吗?

You can look at the plugin documentation to figure out if this feature is supported.您可以查看插件文档以确定是否支持此功能。

  1. How to connect Jenkins to AWS CodeDeploy if #1 assumption is correct?如果#1 假设正确,如何将 Jenkins 连接到 AWS CodeDeploy?

You can use the Jenkins Plugin for CodeDeploy @ https://github.com/awslabs/aws-codedeploy-plugin您可以使用 Jenkins 插件进行 CodeDeploy @ https://github.com/awslabs/aws-codedeploy-plugin

If using AWS CodePipeline and then CodeDeploy, what are the steps?如果使用 AWS CodePipeline 然后使用 CodeDeploy,步骤是什么?

If you want to do the orchestration of the build process (eg pulling from SCM, building etc.) then you will use CodePipeline.如果您想对构建过程进行编排(例如从 SCM 中提取、构建等),那么您将使用 CodePipeline。 CodePipeline will kick-off as soon as it detects changes in the SCM and then will execute CodeBuild and eventually CodeDeploy to Deploy. CodePipeline 将在检测到 SCM 中的更改后立即启动,然后执行 CodeBuild 并最终执行 CodeDeploy to Deploy。 You may also end up setting a Notification using EventBus or CloudWatch Events.您最终还可以使用 EventBus 或 CloudWatch Events 设置通知。

We have a project which has used Jenkins in local server already.我们有一个已经在本地服务器中使用 Jenkins 的项目。 To utilize the existing work, creating 4-stage pipeline in AWS为了利用现有工作,在 AWS 中创建 4 阶段管道

For the above, you can use the CodeDeploy Plugin in Jenkins to deploy to AWS.对于上述情况,您可以使用 Jenkins 中的 CodeDeploy Plugin 部署到 AWS。 You can keep the existing Jenkins environment as is.您可以保持现有的 Jenkins 环境不变。

you want to do the orchestration of the build process您想要对构建过程进行编排

In a build process there are different steps that you would need to execute, eg pull from SCM, build/compile, and deploy.在构建过程中,您需要执行不同的步骤,例如从 SCM 中提取、构建/编译和部署。 Going from one state to another ( pull from sim -> build -> deploy) is called the orchestration of the build process.从一种状态到另一种状态(从 sim 拉取 -> 构建 -> 部署)被称为构建过程的编排。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM