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

443 Views Asked by At

I'm having a path issue.

  • Is there a way for me to access the remote command line for my build instance? It sure would help me debug this scenario.
  • I can't repro the The system cannot find the path specified message locally. Does VSTS validate paths specified as arguments in a build task?
  • Is there a better approach for running a build artifact with a command line argument that is the path to a file it will use?

-----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.

1

There are 1 best solutions below

0
On

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)).