Michael Mainer
Michael Mainer

Reputation: 3465

VSO build definition - run build artifact from a command line task - path issue

I'm having a path issue.

-----My scenario-----

I've got a build definition task that successfully publishes an artifact called metadatapreprocessor.exe to the artifacts location. Here's what the publish to artifacts task looks like:

Task 1 - publish executable to artifacts location (success)

Path to Publish:

Task#1: $(Build.SourcesDirectory)/MetadataPreprocessorRunner/bin/Debug/MetadataPreprocessor.exe

Artifact Name: MetadataPreprocessor enter image description here

I've got a command line task to run the artifact named MetadataPreprocessor.exe:

Task 2 - run the executable in artifacts staging area with input file (fail)

Tool: $(Build.ArtifactStagingDirectory)\MetadataPreprocessor\MetadataPreprocessor.exe Arguments: --MetadataRelativePathFromFileSystem=$(Build.SourcesDirectory)\submodules\Graph_Metadata\input_metadata.xml

enter image description here

It appears that I'm properly referencing the executable in the staging area as I'd expect to a see MetadataPreprocessor.exe is not recognized as an internal or external command... if I wasn't finding that executable.

Upvotes: 0

Views: 442

Answers (1)

starian chen-MSFT
starian chen-MSFT

Reputation: 33698

You are publishing the files to the server, so it isn’t in the artifact folder ($(Build.ArtifactStagingDirectory)), that’s why it can’t find the path specified.

You can add Copy Files task to copy the files from sources directory to artifact folder. (Source Folder: $(Build.SourcesDirectory); Contents:**\MetadataPreprocessor.exe; Target Folder: $(Build.ArtifactStagingDirectory)).

Upvotes: 1

Related Questions