PS Script before build

mark.garcia's Avatar


19 Aug, 2019 07:11 AM

I am trying to run this script without creating a yml file. How come the script is being called as one command instead of one line at a time?

  1. 1 Posted by mark.garcia on 19 Aug, 2019 07:18 AM

    mark.garcia's Avatar

    This is what happened

  2. 2 Posted by Owen McDonnell on 19 Aug, 2019 04:34 PM

    Owen McDonnell's Avatar

    Can you go to the project's Export YAML tab and download the config file it produces and post it here.

  3. 3 Posted by mark.garcia on 19 Aug, 2019 11:06 PM

    mark.garcia's Avatar

    version: 1.0.{build}
    image: Visual Studio 2017
    configuration: Release
    - ps: >-
        Install-Product node $Env:nodejs_version

        npm install -g npm

        npm install -g webpack

        npm install -g webpack-cli


        cd BuchananGroup.Plugin

        ((Get-Content -path .\src\services.js -Raw) -replace 'http://htc_api.local',$env:API_DOMAIN_NAME) | Set-Content -Path .\src\services.js

        npm install

        npm run build


        nuget restore
      publish_wap: true
      verbosity: minimal
    - path: BuchananGroup.Plugin\dist\widget.js
      name: WidgetJs
    - provider: Environment
      name: HTC-Api-Beta
        branch: master

  4. 4 Posted by Owen McDonnell on 20 Aug, 2019 01:30 PM

    Owen McDonnell's Avatar

    It's quite perplexing indeed. I can't see anything wrong except for the fact that you are using cmd variable syntax %APPVEYOR_BUILD_FOLDER% for powershell (should use $env:APPVEYOR_BUILD_FOLDER) but that doesn't seem to be the problem here.

    Can you try to remove all but the first few commands and run a build.
    Also, if this is blocking you, I'm guessing that checking in an appveyor.yml file with the above config in it would not run into this error. Though, of course, we'd still like to find out why this error is occurring.

  5. 5 Posted by mark.garcia on 20 Aug, 2019 03:49 PM

    mark.garcia's Avatar

    Removing all the script would successfully build and I think adding them into an appveyor.yml file would also work but I am trying to avoid adding a yml because I need to push to git everytime I want to try something in the build process.

  6. 6 Posted by Owen McDonnell on 20 Aug, 2019 09:16 PM

    Owen McDonnell's Avatar

    Would you be able to add me ([email blocked]) as a collaborator with build permissions to this project so that i could investigate further?

  7. 7 Posted by mark.garcia on 21 Aug, 2019 05:56 AM

    mark.garcia's Avatar

    I don't think it will be allowed. I think I'll just use the appveyor file. Will let you know if it works.

  8. mark.garcia closed this discussion on 15 Oct, 2019 03:25 AM.

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

Keyboard shortcuts


? 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