简体   繁体   English

IBM Cloud Code Engine:如何在没有 CLI 的情况下从 GitLab 源部署应用程序

[英]IBM Cloud Code Engine: How can I deploy an app from GitLab source without CLI

I create a project and saved it in GitLab.我创建了一个项目并将其保存在 GitLab 中。

I tried to download the IBM Cloud CLI to my Windows 10 system and I failed, I try to do it Run as administrator as mention in the CLI docs .我尝试将 IBM Cloud CLI 下载到我的 Windows 10 系统,但失败了,我尝试按照CLI 文档中的说明以管理员身份运行。

Now, I want to deploy this code project without CLI from source code.现在,我想从源代码部署这个代码项目,而不需要 CLI。 I could not find any docs about it.我找不到任何关于它的文档。

I read about Dockerfile I should insert into my project but I know nothing about it.我读到了 Dockerfile 我应该插入到我的项目中,但我对此一无所知。

Please help me in 2 ways:请通过两种方式帮助我:

  1. Deploy my project with source code (Gitlab connect to IBM Cloud Code Engine).使用源代码部署我的项目(Gitlab 连接到 IBM Cloud Code Engine)。

  2. Deploy my project using CLI in the windows 10 system.在 windows 10 系统中使用 CLI 部署我的项目。

I just did the same thing as part 1 of your question yesterday.我昨天刚刚做了与你问题的第 1 部分相同的事情。 As a prerequisite, you will need a container registry to put things into, such as a free account on Docker Hub.作为先决条件,您将需要一个容器注册表来放入内容,例如 Docker Hub 上的免费帐户。

Start on the Code Engine console .代码引擎控制台上启动。

Choose Start with Source Code, and paste in your on Gitlab URL.选择从源代码开始,然后粘贴到 Gitlab URL 上。 (The default is a sample repo which may be useful, especially https://github.com/IBM/hello . (默认是一个可能有用的示例 repo,尤其是https://github.com/IBM/hello

从源代码开始

On the next page, you can accept most of the defaults but you will need to create a project.在下一页上,您可以接受大部分默认设置,但您需要创建一个项目。 That's free, but it needs a credit card so you can use a Pay As You Go account.这是免费的,但它需要一张信用卡,因此您可以使用 Pay As You Go 帐户。

创建一个项目

You'll also need to Specify Build Details您还需要指定构建详细信息

指定构建细节

Here you tell it about your source repo, and where your Dockerfile lives.在这里,您将告诉它您的源代码库,以及您的 Dockerfile 所在的位置。 If you don't have a Dockerfile, you can probably find a sample one for your chosen runtime (C#? Node.js? Java?), or you can try using the Cloud Native buildpack.如果您没有 Dockerfile,您可能会为您选择的运行时找到一个示例(C#?Node.js?Java?),或者您可以尝试使用 Cloudpack 构建。 The build pack will try and work out how to run your code by inspecting what files you have.构建包将尝试通过检查您拥有的文件来确定如何运行您的代码。

云原生构建包

Finally, on the last page of the build details, you will need to tell it where your container registry lives.最后,在构建详细信息的最后一页,您需要告诉它您的容器注册表所在的位置。 This is a repository used to store the built images.这是一个用于存储构建图像的存储库。 If you set up a personal account on docker hub, you can just enter the credentials.如果您在 docker 集线器上设置个人帐户,则只需输入凭据即可。

容器策略

Once you've done that, you can choose Done in the sidebar:完成后,您可以在边栏中选择“完成”:

完毕

and then Create然后创建

创造

You should get a page which shows your image is building你应该得到一个页面,显示你的图像正在构建

建造

and then once the build is done, in the top right you'll get a link to take you to your app's web page:然后在构建完成后,您将在右上角获得一个链接,将您带到应用程序的 web 页面:

打开应用网址

If you get stuck, there's a good set of documentation .如果您遇到困难,这里有一套很好的文档

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

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