【发布时间】:2021-04-21 09:06:48
【问题描述】:
我目前在 Azure Dev Ops 中有一个管道,用于构建、复制、存档,然后将 Vue.js 应用部署到在 Linux 上运行的 Azure 应用服务。当我通过 SSH 连接到服务器时,我确实看到构建的输出成功地出现在 wwwroot 文件夹中,但是当我拉起应用服务的 URL 时,我只看到了默认登录页面。下面是我的 wwwroot 文件夹的屏幕截图,当我提取 URL 时看到的页面和管道的 yml 文件的副本。 yml 文件中是否还缺少其他东西,我需要添加以告诉应用服务偶然启动 vue.js 应用,我对这些东西还很陌生。
# Build a Node.js project that uses Vue.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
displayName: 'npm install and build'
workingDirectory: $(Build.SourcesDirectory)/client-app
- task: CopyFiles@2
inputs:
Contents: '$(Build.SourcesDirectory)/client-app/dist/**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
replaceExistingArchive: true
verbose: true
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'Azure subscription 1 (f719f76c-c23e-4160-aa93-914eb7851fdb)'
appType: 'webAppLinux'
WebAppName: 'trashbot'
packageForLinux: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
【问题讨论】:
-
如果我的回复有帮助,请采纳为答案(点击回复旁边的标记选项将其从灰色切换为填写。),请参阅meta.stackexchange.com/questions/5234/…
-
@JasonPan 是的,成功了,谢谢。
标签: node.js azure vue.js azure-devops azure-web-app-service