Path inside artifact name. Is there a way to remove it?

Hi!

I'm using the artifacts feature to package my windows service (console app using TopShelf) as a zip file. Later, using the environment functionality I'm uploading this package to an S3 account. However, when it uploads it to S3 it prepends the file name with it's path creating an unnecessary long path inside S3.

Is there a way to push just the zip file to S3 without it's entire source path?

The relevant part of my yml file looks like this:

configuration: Debug
artifacts:
- path: 'src\BSP\bin\$(CONFIGURATION)'
  name: '$(APPVEYOR_PROJECT_NAME)_$(APPVEYOR_BUILD_VERSION)'

In S3 the resulting path is my-bucket-name\BSP\src\BSP\bin\BSP_1.0.0.26.zip when I wanted it to be my-bucket-name\BSP_1.0.0.26.zip

BSP being my project's name.

Thanks!

  1. You can use either PowerShell or appveyor command-line utility to push artifact with a custom path in artifacts storage:
    http://www.appveyor.com/docs/packaging-artifacts#pushing-artifacts-...
    http://www.appveyor.com/docs/build-worker-api#push-artifact

  2. I think I understood, but is this the expected behavior? Meaning that when the artifact is generated by using the artifacts feature the path will include the whole directory structure?

  3. Yeah, this is correct behavior - it puts path relative to build folder.

  4. Got it!

    If you don't mind the question, why is this the implemented behavior?

    It would be much more natural do me to have a property (at first I thought it was name) where you can specify the filename and if one really wanted, he could put the path in it?

    Thanks

  5. It was made like that "historically". Changing this bahavior now could break a lot of builds :)

    - Feodor

  6. I would second a need for this. It seems like an extra field or checkbox on the Artifacts page could be added to specify a destination path for artifact(s) or a simple check box that says "destination path begins at first found artifact (for wildcard situations). Default of course would be current behavior.

  7. Hi,
    I'm with Mike on this one.
    Graham

  8. My quick get-around to this was to put a copy in the 'After build script' on the build tab:

    copy xyz.Installer\bin\release\xyz.Installer.msi xyz.msi

    That pops it in the root directory, and hence no path.

    then trap xyz.msi as the artefact, and everything works without the paths and no need for other scripts.

    Hope this helps.

    Graham

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