简体   繁体   English

需要 CLI 指令以将示例应用程序部署到 IBM Code Engine

[英]Require CLI instructions for deploying a sample app to IBM Code Engine

Since the IBM CloudFoundry Service is getting deprecated real soon, I am in need of migrating my existing apps from CloudFoundry to CodeEngine.由于 IBM CloudFoundry 服务很快就会被弃用,因此我需要将现有的应用程序从 CloudFoundry 迁移到 CodeEngine。 I am successful in creating sample app by following the UI instructions provided in IBM docs using the dockerfile provided in same page.我按照 IBM 文档中提供的 UI 说明使用同一页面中提供的 dockerfile 成功创建了示例应用程序。

Now i have requirement to automate the following task using the jenkins pipeline jobs.

              
                Creating/deploying a new sample app in CE environment(dockerfile)

                 Update the deployed app on code changes(dockerfile)

                 setup a job to include the environment variables during deployment

I would like to get the CLI command to build and push the sample app dockerfile first, which then followed by other requirements.Quick help on this really appreciated.我想先获取 CLI 命令来构建和推送示例应用程序 dockerfile,然后是其他要求。对此非常感谢快速帮助。

First of all, make sure you have correctly setup your IBM Cloud CLI, ie the region and resource group match your expected settings.首先,确保您已正确设置 IBM Cloud CLI,即区域和资源组与您的预期设置相匹配。

ibmcloud target -r <region> -g <resource-group>

The CLI and Code Engine plugin will tell in case this is not setup.如果未设置,CLI 和代码引擎插件会告诉您。

Next, make sure you have a project.接下来,确保您有一个项目。 So either use one that you already have and create a new one.因此,要么使用您已有的一个并创建一个新的。

ibmcloud ce project create --name f00b4r          # new one
ibmcloud ce project select --name <your-project>  # existing one

Similar to the cf apps command, you can list the apps you already have:cf apps命令类似,您可以列出您已经拥有的应用程序:

ibmcloud ce app list

To create an app, use the following command:要创建应用程序,请使用以下命令:

ibmcloud ce application create --name myapp --image icr.io/codeengine/hello

There is a tutorial in the docs that covers this topic.文档中有一个涵盖此主题的教程

Coming from Cloud Foundry, you might be more interested or familiar with pushing source code rather than building the image or using a pre-existing image.来自 Cloud Foundry,您可能更感兴趣或熟悉推送源代码,而不是构建映像或使用预先存在的映像。 The command looks very similar:该命令看起来非常相似:

ibmcloud ce app create --name myapp --build-source . --strategy buildpacks

Check the Cloud Foundry to Code Engine migration guide for more details.有关更多详细信息,请查看Cloud Foundry 到代码引擎迁移指南

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

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