Accessing build artifacts from one project in another
Hi,
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}
install:
- sh: sudo apt-get install freeglut3-dev -y
branches:
only:
- AppVeyorCI
os:
- Visual Studio 2015
platform:
- x64
configuration:
- Debug
- Release
before_build:
- cmd: cmake -H. -Bbuild -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%\installdir
build_script:
- cmd: cmake --build build --target INSTALL --config %CONFIGURATION% -- /nologo /verbosity:minimal /maxcpucount
after_build:
- cd %APPVEYOR_BUILD_FOLDER%
- set BUILD_ARCHIVE=%APPVEYOR_PROJECT_NAME%-%CONFIGURATION%.zip
- cmd: 7z a %BUILD_ARCHIVE% installdir
- appveyor PushArtifact %BUILD_ARCHIVE%
artifacts:
- path: '*.zip'
in my dependent project I try to download the artifact the following way:
version: 4.0.0-{branch}-ci-{build}
install:
- appveyor DownloadFile https://ci.appveyor.com/api/projects/<accountname>/<projectname>/artifacts/<projectname>-Debug.zip?branch=AppVeyorCI&job=Configuration%3A+Debug
- appveyor DownloadFile https://ci.appveyor.com/api/projects/<accountname>/<projectname>/artifacts/<projectname>-Release.zip?branch=AppVeyorCI&job=Configuration%3A+Release
- 7z x <projectname>-Debug.zip -oc:\projects
- 7z x <projectname>-Release.zip -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
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
1 Posted by Ilya Finkelshte... on 24 Apr, 2018 02:04 AM
You need to wrap URL in double quotes.
2 Posted by Volker Enderlei... on 25 Apr, 2018 08:21 AM
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 Posted by Volker Enderlei... on 25 Apr, 2018 08:38 AM
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 Posted by Ilya Finkelshte... on 25 Apr, 2018 03:46 PM
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 Posted by Volker Enderlei... on 26 Apr, 2018 10:30 PM
As the job name can be arbitrarily complex for build matrices I came up with the following solution:
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 Posted by Ilya Finkelshte... on 04 May, 2018 05:33 PM
@Volker thanks a lot for sharing!
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:28 AM.