如何使用Appveyor部署已编译的元素Azure Web App?

时间:2016-07-07 16:04:10

标签: azure-web-sites devops appveyor

我正在使用Appveyor将Web应用程序部署到Azure中,但是所有组件都是使用grunt编译的,构建是成功的并且也可以部署,问题不是通过grunt部署bower_components文件夹和生成的文件和文件夹。

我在appveyor.yml上错过了任何代码?

shallow_clone: true
# version format
version: 1.1.{build}
# Fix line endings in Windows. (runs before repo cloning)
init:
  - git config --global core.autocrlf true

cache:
  - packages -> **\packages.config
  - Sigma.Website\bower_components -> Sigma.Website\bower.json
  - Sigma.Website\node_modules -> Sigma.Website\package.json

install:
  - npm install -g grunt-cli  1> nul

before_build:
  - ps: .\CreateBuildTxt.ps1  
  - nuget restore
  - cmd: |
          cd Sigma.Website
          npm install
          grunt
          cd ..

build:
  publish_wap: true

#Deployment configuration
deploy:
- provider: WebDeploy
  server: https://sigma.scm.azurewebsites.net:443/msdeploy.axd?site=sigma
  website: sigma
  username: $sigma
  password:
    secure: xxxxxx
  ntlm: false
  remove_files: false 
  app_offline: false
  artifact: Sigma.Website
  on:
    branch: master

notifications:
  - provider: Slack
    incoming_webhook: xxxx
    channel: '#sigma-dev'
    on_build_success: true
    on_build_failure: true

1 个答案:

答案 0 :(得分:0)

将以下BeforeBuild目标添加到网络应用程序.csproj(或.vbproj):

<Target Name="BeforeBuild">
  <ItemGroup>
    <Content Include="bower_components\**\*.*" />
  </ItemGroup>
</Target>