Accessing build artifacts from one project in another

Volker Enderlein's Avatar

Volker Enderlein

23 Apr, 2018 09:13 PM

I started using AppVeyor a week ago and was really excited. Got my jobs up and running. But when using more than one configuration for a project I stumbled across the question how to access an artifact from another project on the same account.
So my base project has following appveyor.yml:

version: 1.3.0-{branch}-ci-{build}
  - sh: sudo apt-get install freeglut3-dev -y
  - AppVeyorCI
  - Visual Studio 2015
  - x64
  - Debug
  - Release
  - cmd: cmake -H. -Bbuild -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%\installdir
  - cmd: cmake --build build --target INSTALL --config %CONFIGURATION% -- /nologo /verbosity:minimal /maxcpucount
  - set
  - cmd: 7z a %BUILD_ARCHIVE% installdir
  - appveyor PushArtifact %BUILD_ARCHIVE%
  - path: '*.zip'

in my dependent project I try to download the artifact the following way:

version: 4.0.0-{branch}-ci-{build}
  - appveyor DownloadFile<accountname>/<projectname>/artifacts/<projectname>
  - appveyor DownloadFile<accountname>/<projectname>/artifacts/<projectname>
  - 7z x <projectname> -oc:\projects
  - 7z x <projectname> -oc:\projects

According to the docs this should work but I`m constantly getting the error:

Error downloading remote file: One or more errors occurred.
Inner Exception: Remote server returned 400: Bad Request
'job' is not recognized as an internal or external command,
operable program or batch file.
Command exited with code 9009

I can view the artifacts in the GUI, they are present, but I cannot access them.
Having only one configuration and omitting the job parameter works flawlessly.
Obviously i`m doing something wrong but I did not manage to find my error and got stuck here.

Thanks in advance

Cheers Volker

  1. 1 Posted by Ilya Finkelshte... on 24 Apr, 2018 02:04 AM

    Ilya Finkelshteyn's Avatar

    You need to wrap URL in double quotes.

  2. 2 Posted by Volker Enderlei... on 25 Apr, 2018 08:21 AM

    Volker Enderlein's Avatar

    Thank you Ilya,

    that fixed the first part, but I am still unable to download the artifacts using the command `appveyor DownloadFile <link>` or `curl -L -o<name> <link>` in the appveyor.yml. It always gives a 404 Error.

    Cheers Volker

  3. 3 Posted by Volker Enderlei... on 25 Apr, 2018 08:38 AM

    Volker Enderlein's Avatar

    Forgot to mention:

    if I copy the link to the browser the download immediately starts. So it is still mysterious to me.

    Cheers Volker

  4. 4 Posted by Ilya Finkelshte... on 25 Apr, 2018 03:46 PM

    Ilya Finkelshteyn's Avatar

    Try to run the same command in PowerShell (- ps: prefix), or even use Start-FileDownload cmdlet. It is simpler to run command containing all those special symbols in PowerShell.

  5. 5 Posted by Volker Enderlei... on 26 Apr, 2018 10:30 PM

    Volker Enderlein's Avatar

    As the job name can be arbitrarily complex for build matrices I came up with the following solution:

      - sh: DOWNLOAD_ADDRESS=<account>/<project>/artifacts/$DOWNLOAD_FILE

    You might feel free to add this note as example to the download file section of the documentation.

    Thank you again Ilya for your support.

  6. 6 Posted by Ilya Finkelshte... on 04 May, 2018 05:33 PM

    Ilya Finkelshteyn's Avatar

    @Volker thanks a lot for sharing!

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