At the moment I am trying to integrate the npm backstopjs into my VSTS build pipeline. To do this, I have to run it on an npm live server to get a screenshot of the actual build of the app and compare it to the reference screenshot. I tried to start this live server with a PowerShell script. This script cannot find the path to the npm root path so I cannot run the tests.
My question is: Is there a way to run BackstopJS tests with VSTS?
Edit
For the better understanding, here are some screenshots of my project:
Since Hosted VS2017 agent is the build machine provided by VSTS server, you should build VSTS with the privarte agent which located in the same machine of your live-server, so that the the build project can be searched.
And more details about deploying a private agent, you can refer the document Deploy an agent on Windows.
Related
The image above shows my Hello World project structure. I am trying to build the Setup-HelloWorld-x86.vdproj in Azure Pipeline in Self-Hosted Windows Agent (which is nothing but my local machine) by using the command line script task like shown in below image.
But I get the following error.
Kindly help me to build this Setup-HelloWorld-x86.vdproj
If you want to run the project via cmd devenv, you can refer to this doc.
As a workaround, you can install the extension Build VS Installer and use the task DutchWorkz - Build VS Installer(s) to build Visual Studio Installer Project in Azure Pipelines.
You can specify to build .sln or .vdproj to generate .msi file(s) in Task-mode option.
Update1
Thanks Tharunavignesh J for sharing.
The solution was to run the azure agent under proper account. Earlier my azure agent was running under some Network Service account, then I change it to the local account, then this cmd worked properly.
This other stack overflow link helped me get my visual studio installer project compiled with Azure DevOps pipelines. It is using yaml configuration instead of classic, but same steps / commands apply to both:
YAML Script for building Visual Studio Installer Projects using Azure DevOps
Basically the steps are:
Setup your variables to point to the tools
Download Nuget packages for your solution
Disable Out Of Process Builds command executed
Script task with the command line arguments to build your solution
I need assistance in running my test scripts built-in Java platform with selenium webdriver using Eclipse IDE for my repo and used git to push my repo to Azure DevOps. The project is set up in Maven. How do I run my test scripts using pipelines in Azure DevOps?
Not sure get more details from you. So here just share my suggestion on how to run Selenium tests in the release pipeline for Java application.
In my scenario, I deploy my Java application to azure web app service then run it. If you don't want, you can also deploy to local tomcat by using this extension.
1) After the Java application build, copy the project to the artifact of the release during Build pipeline via copy files and publish artifact task.
2) Create release pipeline, then add Azure app service task to deploy my Java application to azure.
3) Add a Maven task to the release pipeline, configure the task to make it point to pom.xml file which located in artifact.
4) Trigger the Selenium tests in pom.xml.
Now you can run browser to view the test.
You can check this lab blog to get more details. Just focus on the design logic of pipeline execution, because the sample in that blog is running with vstest.exe.
I am trying to automate the generation of the following NuGet package using VSO:
NuGet Package
My problem is that all three "runtimes" libraries are built on different platforms. Hence, I have the following build configuration in VSO:
VSO Build
When build is completed, each agent job publish a native artifact for its platform:
Native Artifacts
My question is: Is it possible to add a 4th agent job to the build that would wait for all the other jobs and then aggregate the artifacts and generate the NuGet package with everything?
Currently, I need to manually download the artifacts and run a script to pack and sign the NuGet package. It's annoying because it require to install a certificate on my local machine and install the signing tools etc.
Thanks!
Your looking for the "Run this Job" setting on the 4th agent job. "Only When all previous jobs are complete" sounds like the value you want. You could then use powershell and/or the NuGet task to automate your process.
I am trying to add a build definition for a project that has private nuget packages hosted in VSTS. The local build works just fine but when I try to build it with an on premise build agent I get the following error:
The agent runs behind a proxy and in the build definition i have the following settings:
This is driving me mad please HELP !
The issue should related to your network environment on your build agent, such as firewall, proxy. You could also give a try with using the same Nuget task on an agent which has Visual Studio installed and in the same network environment, this will narrow down the error related to the proxy or not.
Workaround:
1) Copy nuget.exe to c:\nuget folder then added the folder to the PATH environment variable.
2) Copy nuget.exe to C:\B\1_tool\NuGet\4.0.0\x64 folder.
3) Create a dummy file called x64.complete in the {agent work folder}_tool\NuGet\4.0.0 folder and copy the nuget.exe file in the {agent work folder}_tool\NuGet\4.0.0\x64 folder.
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.