1
votes

I'd like to execute a command line app that I created as part of my CI builds.

The command line app is not related to the repository on which the build is running. (Basically, its a tool that is supposed to send some project related metadata to a company web application to gather some metrics).

It seems I can execute it using a Command Line task, as explained here:
How to execute exe in VSTS Release pipeline empty process

The question is, however - how do I upload my custom tool into Azure Devops?

I know it's possible to create custom tasks (https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-build-task?view=azure-devops) , but it seems quite a lot of effort to create, especially given that I have a console tool that is doing what I need.

3
Uploading the tool itself in your custom extension is not a recommended practice. Instead, consider creating a "Tool Installer" task that would download and install the tool on the agent as appropriate. One example of this is the Java Tool Installer or the Chocolatey installer (GitHub source included)JoshuaTheMiller

3 Answers

0
votes

I do this by including a seperate deployment folder in the git repo with my source code. This folder contains all the extra stuff (exe's) that I need to call to deploy.

You could if you wanted keep these artifacts in a different repo and/or different artifact if you wish as you can get any number of different artifacts

Then I include the deployment folder when publishing artifacts. In your build step you pull down the artifacts and it includes your EXE.

You're meant to be able to use things like NPM to install helper libraries on the fly but none of my required libraries were ever supported.

You can also use a self hosted agent which is your own host (Often an Azure VM). You install everything you need on there then you install a DevOps self hosted agent which lets build pipelines use it.

0
votes
  1. Create a build of your exe
  2. Upload your exe to blob storage.
  3. Create a SAS token to access your blob.
  4. In your build create a task with a PowerShell script. In the PS script download your exe (unzip), and copy it to Build.StagingDirectory/"yourToolFolder". Then in your PS script run it. You probably want to pass it arguments like the location of the repo on the build agent.
-1
votes

A way to achieve this involve create a deployment group and add a server to the group where you have access and privileges to upload your console. it could be onprem or cloud depends in your requirements.