Push-AppveyorArtifact for entire folder end up in error

aliman's Avatar

aliman

27 Oct, 2014 05:40 PM

Hi,

In my appveyor project configuration in case of build error I have little ps script that aims to push some artifacts that may be produced by e.g. failed tests (in my case these are image files of browser screenshots of failed UI tests)
Script looks as following:

$path = "C:\projects\<full path to folder>\images"
$pathExists = Test-Path $path
if ($pathExists) {
Push-AppveyorArtifact "$path\*" -Type zip
}

Whatever I try, if build fails and $path exists this ps fails at Push-AppveyorArtifact with the following error:

Exception calling "AddArtifact" with "4" argument(s): "File not found:
787C:\projects\..full path with file name..
788C:\projects\...full path with file name"
789At C:\Program Files\AppVeyor\BuildAgent\Modules\build-worker-api\build-worker-api.psm1:205 char:5
790+ [Appveyor.BuildAgent.Api.RestBuildServices]::AddArtifact($fullPath, $FileNam ...
791+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
792 + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
793 + FullyQualifiedErrorId : FileNotFoundException
794

In case I specify concrete file name it works fine, but in case I space the whole folder it errors out. I tried different wildcards for <path> parameter like *.* , \* etc, but nothing seems to work. Files are certainly there as "Test-Path $path" returns true and also specifying direct file name it also works

Please advise how can I get it working

Thanks!
Artem

  1. Support Staff 1 Posted by Feodor Fitsner on 27 Oct, 2014 05:48 PM

    Feodor Fitsner's Avatar

    There was an issue with relative paths in -FileName of Push-AppveyorArtifact cmdlet that now fixed. We are going to apply patch later today.

  2. Support Staff 2 Posted by Feodor Fitsner on 28 Oct, 2014 02:10 AM

    Feodor Fitsner's Avatar

    Oh, I'm sorry I've misunderstood your question! Wildcards are not supported in Push-AppveyorArtifact cmdlet and appveyor PushArtifact command.

    However, with PowerShell you can use the following approach to push multiple files from some directory:

    Get-ChildItem .\*.nupkg | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
    

    From here (at the bottom): http://www.appveyor.com/docs/packaging-artifacts

  3. 3 Posted by aliman on 28 Oct, 2014 06:51 AM

    aliman's Avatar

    Hi,

    Well, I am not necessary need wildcards as long as I can push entire folder as it states in documentation

    As workaround I can also iterate over each file and push it one by one of course

    Thanks,
    Artem

  4. Support Staff 4 Posted by Feodor Fitsner on 28 Oct, 2014 07:26 AM

    Feodor Fitsner's Avatar

    Pushing entire folder is only supported by build worker (when you specify artifacts section in YML). For now you should create your own zip and then push it with cmdlet.

  5. 5 Posted by aliman on 28 Oct, 2014 07:44 AM

    aliman's Avatar

    Ok, got it.
    Is it possible to specify artifacts to be created in case if certain event like e.g build has failed? Or only script like trigger is possible?

    Thanks,
    Artem

  6. Support Staff 6 Posted by Feodor Fitsner on 28 Oct, 2014 01:44 PM

    Feodor Fitsner's Avatar

    Yeah, it's only a script right now.

    -Feodor

  7. 7 Posted by aliman on 28 Oct, 2014 02:44 PM

    aliman's Avatar

    Ok, дзякуй
    Artem

  8. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:49 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