Script / MSBuild deployment Providers

Ryan's Avatar

Ryan

24 Sep, 2015 10:30 PM

For deployments, you can either use a script, or the providers. I can't do both.

It would be nice if script (and even MSBuild) was a provider so it can run based on the Deployment Conditions. If I choose script, I have to use a script to run all of my deployment, I can't take advantage of the providers.

I have done some what of a workaround for now to run my script as part of the "after deployment", but that isn't really what I want, because it is part of the deployment.

  1. Support Staff 1 Posted by Feodor Fitsner on 25 Sep, 2015 05:13 PM

    Feodor Fitsner's Avatar

    Could you please elaborate on your idea, maybe give some pseudo-appveyor.yml example of how it could look like? Thanks!

  2. 2 Posted by Ryan on 25 Sep, 2015 11:56 PM

    Ryan's Avatar

    Sure. This is sort of how i think the appveyor.yml may look. I am showing both a "Script" provider, and an "MSBuild" provider, along with an existing Github provider.

    When the EnvVariable CI_DEPLOY_SCRIPT = True, the power shell (or cmd) script would execute, same for the MSBuild provider, but that one, i was thinking you could even pass additional MSBuild properties to it ( that part is more of a 'nice to have', as you could accomplish that part with environment variables).

    For example, with MSBuild, I have existing msbuild scripts that create a release on codeplex, and upload the artifacts to the created release.

    During deployment phase, I want to be able to use the github provider, and execute a powershell/cmd script that can be dependent upon the value of an environment variable.
    During deployment phase, I want to be able to use the github provider, and execute an msbuild Target(s), which then logs back to the MSBuild appveyor log provider.

    deploy:
    - provider: GitHub
      tag: $(APPVEYOR_PROJECT_NAME)-v$(APPVEYOR_BUILD_VERSION)
      release: $(APPVEYOR_PROJECT_NAME)-v$(APPVEYOR_BUILD_VERSION)
      description: $(APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED)
      auth_token:
        secure: XXXXXXX
      artifact: ReleaseZips
      on:
        branch: master
        CI_DEPLOY_GITHUB: True
    - provider: Script
      ps: >- 
        $env:APPVEYOR_BUILD_FOLDER\deploy\somePowerShell.ps1
      on:
        branch: master
        CI_DEPLOY_SCRIPT: True
    - provider: MSBuild
      path: $(APPVEYOR_BUILD_FOLDER)\someMsbuild.msbuild
      variables:
      - MY_VAR1: Value
      - MY_VAR2:
          secure: XXXXXXXXX
      on:
        branch: master
        CI_DEPLOY_MSBUILD: True
    
  3. Support Staff 3 Posted by Feodor Fitsner on 28 Sep, 2015 01:04 AM

    Feodor Fitsner's Avatar

    OK, I see. Thanks for clarification. However, you should be aware that such kinds of deployment providers would be possible to run on build worker VMs, not from "Environments" section where deployments run on shared servers.

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:00 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