Unable to deploy

Barry's Avatar

Barry

Sep 19, 2017 @ 04:01 PM

Hello,

I am trying to get started with AppVeyor but struggling somewhat to get deployments working.

My requirements are basically this, I want to setup one "Environment" which will be an FTP site. I have installed the AppVeyor Deployment Agent on this FTP server. I then want to have multiple projects use this environment to deploy to their respective IIS sites.

e.g.
Project A builds and deploys to Environment A publishing to WebSite A
Project B builds and deploys to Environment A publishing to WebSite B

I have tried to set up environment variables etc to deploy but I can't see to get the settings correct.

Can anyone point me in the right direction

Thanks

Barry

  1. 1 Posted by Barry on Sep 19, 2017 @ 04:17 PM

    Barry's Avatar

    This is my appveyor.yml

    version: 1.0.{build}
    branches:
      only:
      - develop
    environment:
      AutoParameterizationWebConfigConnectionStrings: false
      site_name: SiteName
      APPVEYOR_WAP_ARTIFACT_NAME: WebApplication.zip
      deployname: DeployName
    install:
    - cmd: nuget sources add -Name TSDNuget -Source http://nugetfeed.com
    before_build:
    - cmd: nuget restore PathToProject
    build:
      project: PathToProject
      publish_wap: true
      verbosity: minimal
    artifacts:
    - path: WebApplication.zip
      name: $(deployname)
    deploy:
    - provider: Environment
      debug: true
      name: NameOfFtpServer
    

    I've also attached the Environment settings

  2. 2 Posted by Ilya Finkelshte... on Sep 19, 2017 @ 06:49 PM

    Ilya Finkelshteyn's Avatar

    Some notes:

    • You do not need to use environment variables that much, at least to make things work for your scenario.
    • APPVEYOR_WAP_ARTIFACT_NAME is not a file name, but deployment name, you do not have to even know a file name to setup this. If your projects have different names, WebDeploy artifacts created by AppVeyor will have different deployment names and you can rely on them without introducing APPVEYOR_WAP_ARTIFACT_NAME but let us leave it for now.
    • To distinguish between different deployments using the same environment, you have to use artifact name, for example WebApplicationA.deploy_website: true will start deploying when artifact deployment name is WebApplicationA, and WebApplicationB.deploy_website: true will start deploying when artifact deployment name is WebApplicationB
    • You do not need artifacts section at all if you have build/publish_wap: true, AppVeyor will package artifacts for you.
    • I could not understand what debug: true supposed to mean
    • Also I could not understand what is role of FTP here, because deployment is IIS based and sites looks like Web sites and not FTP ones. I use NameOfFtpServer in my sample just as Environment name, it can be any. It just should be the same for Environment and in YAML.

    Here is YAML and Environment settings which should work. Similar YAML should be done for the WebApplicationB. And again you can easily get rig of APPVEYOR_WAP_ARTIFACT_NAME, because AppVeyor will create artifacts with different names for ProjectA and ProjectB anyway (if projects has different names in .csproj).

    version: 1.0.{build}
    branches:
      only:
      - develop
    environment:
      AutoParameterizationWebConfigConnectionStrings: false
      site_name: SiteName
      APPVEYOR_WAP_ARTIFACT_NAME: WebApplicationA
      deployname: DeployName
    install:
    - cmd: nuget sources add -Name TSDNuget -Source http://nugetfeed.com
    before_build:
    - cmd: nuget restore PathToProject
    build:
      project: PathToProject
      publish_wap: true
      verbosity: minimal
    artifacts:
    
    deploy:
    - provider: Environment
      name: NameOfFtpServer
    
  3. 3 Posted by Barry on Sep 20, 2017 @ 08:03 AM

    Barry's Avatar

    Thank you so much! This is working great now.

    Thank you for the notes too - very helpful.

  4. 4 Posted by Ilya Finkelshte... on Sep 20, 2017 @ 04:47 PM

    Ilya Finkelshteyn's Avatar

    OK, good. Now if you still feel that you need to parametrize something, or need this in the future, look closely at this part of documentation.

  5. Ilya Finkelshteyn closed this discussion on Aug 25, 2018 @ 02:19 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac