Reputation: 111
I have a GitHub repository, in which I have an executable file that I would like to run with a set of parameters. The file I need to run would follow the below format if run from the command line on a mac.
./p_executable -v test http://192.168.214.251:8000 username passw0rd
I have successfully been able to create a release pipeline that uses an Agent on my local machine and will run this executable as if I am running it straight from my terminal. For this, I just use a local agent and one stage that contains a single bash task.
However, I want to be able to run this file from any machine. So, I have added my p_executable file to my GitHub repo and linked my repo to my ADO account.
I have added GitHub as an artifact at the start of my release pipeline with the main branch that I would like to use.
However, I cannot work out how to make my bash script find the file.
I assume I can add GitHub as an artifact and that will check out my repo and then I can use the files within like I would be able to in Jenkins for example.
Instead, I get a
bash exited with code 127
when I try and add a resource and use one of the generic Azure DevOps agents.
Any help would be greatly appreciated!
Upvotes: 0
Views: 1298
Reputation: 19491
You can specify the path of the executable file through the release predefined variable System.ArtifactsDirectory
.
The directory to which artifacts are downloaded during deployment of a release. The directory is cleared before every deployment if it requires artifacts to be downloaded to the agent. Same as
Agent.ReleaseDirectory
andSystem.DefaultWorkingDirectory
. Example: C:\agent_work\r1\a
Example: $(System.ArtifactsDirectory)\executable file
Upvotes: 1