使用--runtime命令设置Jenkins管道时在Powershell中出现问题 [英] Problem in Powershell with the --runtime command setting up Jenkins pipeline

查看:76
本文介绍了使用--runtime命令设置Jenkins管道时在Powershell中出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Jenkins配置管道并将其部署到Azure.我在本教程的最后一步:

I am trying to configure a Pipeline with Jenkins and deploying it to Azure. I am at the last step of a tutorial:

https ://docs.microsoft.com/zh-CN/azure/jenkins/tutorial-jenkins-deploy-web-app-azure-app-service

最后一步如下,我必须在Azure CLI中输入它:

This last step is as follows, i have to enter this in the Azure CLI:

az group create --name yourWebAppAzureResourceGroupName --location region
az appservice plan create --name appServicePlanName --resource-group rgname --is-linux
az webapp create --name webAppName --resource-group rgName --plan appServicePlanName --runtime "java|1.8|Tomcat|8.5"

最后一条命令给我错误:

The last command gives me the error:

'1.8'不被识别为内部或外部命令, 可操作的程序或批处理文件.

'1.8' is not recognized as an internal or external command, operable program or batch file.

因此,我认为也许没有在我的Azure VM(这是一台Linux计算机)上安装Tomcat.因此,我使用了下一个教程来安装Tomcat:

So I thought maybe Tomcat is not installed on my Azure VM, which is a Linux machine. So I used the next tutorial to install Tomcat:

https://www.howtoforge.com/tutorial/how-to-install-apache-tomcat-8-5-on-ubuntu-16-04/

此后,我尝试再次执行--runtime命令,但仍然遇到相同的错误.我不知道该如何解决.我希望有人可以帮助我解决这个问题.

After this I tried to do the --runtime command again, but I still get the same error. I have no idea how to fix this. I hope someone can help me with this problem.

我尝试检查webapp列表运行时,并得到以下列表:

I tried to check the webapp list-runtimes and I get this list:

"java | 1.8 | Tomcat | 8.5"在这里.我已经尝试了所有版本,但是没有用.

"java|1.8|Tomcat|8.5" is in here. I've tried all of the versions, but it did not work.

它可以在Azure Cloud Shell中运行,但是然后出现另一个错误:

It works in the Azure Cloud Shell, but then there is another error:

Linux Runtime 'java|1.8|Tomcat|8.5' is not supported.Please invoke 'list-runtimes' to cross check

我已经尝试了所有运行时版本,但是仍然出现此错误.我也尝试过用双引号

I have tried all the runtime versions, but still this error. I have also tried it with double quotes

推荐答案

好的,我明白了,该列表适用于Windows webapp,而不适用于linux.适用于Linux:

ok, i got it, that list is for windows webapp, not linux. for linux use:

az webapp list-runtimes --linux

可行的解决方案:

az webapp create --name yourWebAppName --resource-group yourWebAppAzureResourceGroupName --plan yourLinuxAppServicePlanName --runtime "TOMCAT|8.5-jre8" 

这篇关于使用--runtime命令设置Jenkins管道时在Powershell中出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆