Is it possible to publish a artifact to the buildjob after then build completed.

Ilan's Avatar

Ilan

14 Mar, 2019 01:04 PM

Is it possible to publish a artifact to the build job after then build completed ?

    $filePath = "C:\Users\hello\Desktop\2018.png";
    $fileName  = "2018.png";     
    Write-Host  $artifactUrl
    $request = @{   path =  $filePath;
                    fileName  =  $fileName;
                    name= $null;
                    type= "Auto";
                }| ConvertTo-Json;

    Write-Host  $request
    $newArtifactUrl = Invoke-RestMethod -Method Post -Uri $artifactUrl -Headers $headers -Body $request
    Write-Host  $newArtifactUrl
    (New-Object System.Net.WebClient).UploadFile( $newArtifact, $filePath )

Tried the following url and both didnot work.
https://ci.appveyor.com/api/artifacts/
https://ci.appveyor.com/api/buildjobs/buildId/artifacts/

Invoke-RestMethod : {"message":"The requested resource does not support http method 'POST'."}
At C:\PsHome\Get-AppVeyorArtifacts.ps1:119 char:23
+ ... tifactUrl = Invoke-RestMethod -Method Post -Uri $artifactUrl -Headers ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:Htt 
   pWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe 
   ll.Commands.InvokeRestMethodCommand
  1. Support Staff 1 Posted by Ilya Finkelshte... on 14 Mar, 2019 06:26 PM

    Ilya Finkelshteyn's Avatar

    It is not supported now. Can you please explain the scenario when this can be needed?

  2. Ilya Finkelshteyn closed this discussion on 14 May, 2019 09:00 PM.

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

Recent Discussions

21 Aug, 2019 11:06 PM
21 Aug, 2019 02:08 PM
21 Aug, 2019 01:37 PM
21 Aug, 2019 10:21 AM
21 Aug, 2019 09:10 AM

 

21 Aug, 2019 05:56 AM
21 Aug, 2019 03:08 AM
20 Aug, 2019 11:33 PM
20 Aug, 2019 08:07 PM
20 Aug, 2019 05:50 PM
20 Aug, 2019 12:35 PM