当把java webapp (.war)从azure devops repo集成到azure应用服务linux计划时,如何编写azure-pipeline.yaml脚本?

问题描述 投票:0回答:1

我使用任务助手开始了第一个scirpt,但.war文件最终没有正确部署,我需要一些帮助来组织这个azure-pipeline.yaml文件与正确的命令来正确部署应用程序。

# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- master

pool:
  vmImage: 'ubuntu-latest'

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'

- script: |
    echo Add other tasks to build, test, and deploy your project.
    echo See https://aka.ms/yaml
    displayName: 'Run a multi-line script'


- task: AzureRmWebAppDeployment@4
  inputs:
    ConnectionType: 'AzureRM'
    azureSubscription: 'Free Trial(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)'
    appType: 'webAppLinux'
    WebAppName: 'usernamephp01'
    packageForLinux: '$(System.DefaultWorkingDirectory)/**/*.war'
    RuntimeStack: 'TOMCAT|8.5-java11'
azure-devops yaml azure-web-sites
1个回答
0
投票

当把java webapp (.war)从azure devops repo整合到azure app服务linux计划时,如何编写azure-pipeline.yaml脚本?

由于应用是基于java的,我们需要将应用部署到一个合适的目录结构中。尝试使用 文件重命名 更名 ROOT.war:

enter image description here

然后在Azure App Service部署任务的包或文件夹选择中选择新的名称战争文件。

enter image description here

你可以检查 本文件 以了解更多细节。

希望对大家有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.