How to execute Octo.exe from VSTS? - powershell

I wish to execute Octo.exe from a powershell script on VSTS. Like this
Octo.exe push --package $_.FullName --replace-existing --server https://deploy.mydomain.com --apiKey API-xxxxxxxx
But I don´t know the correct path for Octo.exe or if it is present on the VSTS? Is it possible install it there? Or will i have to add the octo.exe to my source and call it from there?

You can’t call Octo.exe command if using Hosted build agent and it is impossible to install it on build agent too.
If you can call Octo.exe without install it, you can add octo.exe to the source control and map to build agent (Repository > Mappings), then you can call it via PowerShell. The path could be like $(build.sourcesdirectory)\Tool\octo.exe, according to how do you map it to the source directory)
If Octo.exe requires to install, you need to set up an on premise build agent and install Octo on that build agent.
On the other hand, there is the extension of Octopus Deploy Integration that you can install and use it directly.

Instead of cluttering source code repository with binaries,
the cleanest approach is using the Octopus REST APIs for pushing a package.
An example on how to push a package is provided by the Octopus company itself.

Related

Where is GitLab CI Pipeline looking for nuget?

In my GitLab CI/CD pipeline, I use the nuget command to do a pack, push, etc. The pipeline runner is registered on a local machine. On that machine I downloaded the nuget.exe, set the first entry in the system env variables to be the path to it, and then added the source I am using via nuget source add. Locally, I can see the source has been added via nuget source list, however in the pipeline it is telling me the source does not exist. Doing a nuget source list in the pipeline job confirms the source I added isn't there.
My guess is it is using another nuget.exe, but I'm not sure where or why it would not use the system environment variable path first?
Any ideas how to resolve this?

Does anyone know how to use the Doxygen Tool in Azure DevOps?

Specifically I need the yaml for the build definition. I already have Doxygen and Latex installed on the agent machine. Also, I can create Doxygen documentation for the C# Restful API manually using the tool.
Does anyone know how to use the Doxygen Tool in Azure DevOps?
To use the Doxygen Tool in Azure DevOps, we need to install required softwares on agent machine:
Doxygen tool should be installed on the Build agent machine
(download)
PdfLatex tool should be installed on the Build agent machine.
Then add the task Documentation (Doxygen) in the build pipeline to generate the documentation from source code in your repository. On successful generation, the task uploads the file as Build artifact so that it can be downloaded at later time:
Note: This extension doesn't works with Hosted build agent as of now. So, please use a locally configured build agent.
Besides, if you want to generate YAML documentation, you could try to use the extension YAML Documentation Generator.
Hope this helps.

VSTS CI CD for desktop apps

How can I achieve CD (Continuous Delivery) for winform applications in VSTS (Visual Studio Team Services)? Currently this is what I have in my Visual Studio Solution file
1) A winform project
2) A Windows setup and Deployment project
So every time I build a winform project, I do the following steps (and I need CI / CD for exactly these)
1) Build Setup and Deployment project, which takes Build output of Winform project and creates and EXE / MSI
2) I take this MSI file and use NSIS to embed it inside EXE
3) I run SIGNTOOL from command prompt and digital sign the EXE
4) I upload this signed EXE to my website
Now how can I use CI / CD pipeline to automate the above or is it not possible for my case? I am confused. I can't find any material for winforms, all are for web apps.
Thanks
You will obviously need some sort of desktop deployment strategy. The easiest is to be using xcopy. Other alternatives include frameworks like ClickOnce, Windows Installer or Squirrel to name a few. I have a number of corporate apps that use Clickonce that I have deployed using vsts.
Now I am unable to understand how will VSTS help me with this?
Use VSTS to build the software first and include additional tasks to package your app. In my case, I use devenv.exe to generate ClickOnce packages, but you can include custom tasks by using powershell. The artifact of the build should now be the "packaged app".
Then use the VSTS deployment to copy the "package" to some kind of hosting server from where your users can download the package. That could be either a web server or a fileserver or any location appropriate for your deployment strategy.
In this context, VSTS is an orchestration tool. It helps to trigger actions for you.
See Deploy an agent on Windows to see how to setup an on-premise agent.
To build and deploy the way as you used in VSTS, you can use below steps:
Create a repository (Git or TFVC) and push your solution in the repository.
Add build/release definitions.
With CI build, enable the Continuous Integration in Triggers Tab. With CD deploy, enable Continuous deployment trigger in Pipeline Tab. The process for CI build and CD deploy, you can refer CI/CD.
Add related tasks in your build/release definition.
Build VS Installer task: build setup project with msi file.
Nsis Build Task: embedded msi file in exe.
Command Line task: to execute the signtool command. Since Hosted agent has not signtool.exe, so you should use private agent which has the signtool.exe on the machine.
Copy files task, Copy Files Over SSH task or Windows Machine File copy task: upload the file exe to your web server.

Triggering Octopus deploy when files are available

I am currently doing an Octopus project using which I am trying to automate the below process,
Copy the installation files from the folder (TFS automatically drops the new builds to this place) to the octopus tentacle
Install and configure the application
Run the automated tests created using SOAP UI pro on the installed product
Send mail notifications to the user
Revert back the machine/Uninstalling the application
I have implemented all the above process using power shell in Octopus deploy. Only thing I am missing is the trigger process for project.
Requirement: Trigger the Octopus project containing above processes once a new build is created in TFS or new build is placed in the folder
There are two actions to "Trigger" Octopus Deploy to perform the steps defined in the project process, that can be initialised in a number of ways
Using the UI
1) Create a release
2) Deploy the release.
Using the API
1) Create a release and then instruct that release to be deployed to an environment (the important switch here is --deployto)
octo.exe create-release --server http://xxx --apikey SECRET --project xxx --version x.x.x --packageversion=x.x.x --deployto PRODUCTION
Note: this can also be done in two steps
Using Lifecycles
1) Create a release manually or using the API
2) Allow lifecycles to control what happens in environments when a release is created
Octopus Lifecycles Documentation
Hope this helps
You need to have the TFS build server upload newly built nuget packages to the Octopus Deploy server and create a Release post build.
https://octopus.com/blog/using-octopus-and-tfs-builds

Setting Environment with Puppet and test it with TravisCI

I want to use TravisCI for testing pull requests for my github repo. But i use puppet for setting environment and installing dependencies. Is there any way to build dependencies with puppet in .travis.yml.
You need to customize the build environment by writing a shell script that installs and runs puppet.