I have built an automation framework using Java, Selenium Webdriver, Maven, TestNG. Currently, I am using Jenkins for pipeline and CI.
Now new requirement assigned to me is using Azure DevOps as CI tool and execute all test from there instead of Jenkins.
After some research, I am getting the following :
Upload code to Github or other azure supported repo. and create a pipeline.
Write your Java code using Visual studio code and then it will be far easy to execute from Azure DevOps.
Is there any better way to do this?
You need to follow steps below. Main effort is of tools integration if those are not present in azure devops portal :
I am not sure which code repository you are using however if you are not using one which is supported by Azure devops, then you need integrate it with azure devops portal.
Create agentpool in azure devops with same configuration as your jenkins agent.
Create build pipeline in azure devops. It will ask your repository name . Give the same.
4.While Creating pipeline it will ask you whether to create azure pipline yaml or not . Say "Yes" and it will create sample yaml file in code repository.
Open Yaml file.
give your agentpool name where they have mentioned it.
under section " steps "
mention all steps which you want to do run test cases. you would mentioned same
thing is jenkins pipeline under stages --> steps like shell ''' '''
save yaml and run it. you are done
NOTE : Main thing is configuration of agentpool. you need to make it should have all software tools ( except jenkin agent jar :) ).
Related
I'm looking for an automated way for adding & deploying SPFX solution package (*.sppkg) into the SharePoint 2019 (NOT online) app catalog. This is cause and doing the deploying using azure devops (CI/CD) release pipeline.
I found those two below tasks for adding this package:
The first one worked fine in just adding the file to the app catalog but not deploying it, so I had to do it manually.
The second task has the option to write PnP script against SharePoint, but the problem with me is that most of the scripts i found are for SharePoint Online not on premise.
Appreciate your support if you had such situation and got it solved using PnP or something else.
Microsoft's official documentation describes an approach to continuous deployment using Azure DevOps. You can click Implement Continuous Integration and Continuous deployment using Azure DevOps for detailed information. There is no need to write PNP scripts using this method.
Setting up Azure DevOps for Continuous Deployments with a SharePoint
Framework solution requires the following steps:
Creating the Release Definition
Linking the Build Artifact
Creating the Environment
Installing NodeJS
Installing the CLI for Microsoft 365
Connecting to the App Catalog
Adding the Solution Package to the App Catalog
Deploying the Application
Setting the Variables for the Environment
If you just want to use Azure DevOps CD and don't want to use CI, you can skip the second step and upload your build artifacts directly to the repository, and then use them in the release pipeline.
There are some basic scenarion for using pipelines:
You use cloud pipeline (azure, github, etc) with their abilities and their purpuse.
You create own environment with self-hosted pipelines
You add own runner (pipeline agent) to your cloud (azure) environment
So, azure allows you to add own pipeline agent to environment. For example, self-hosting windows agent.
So, I think solution in your case will be:
Install self-hosted agent
Configure agent environment - installing SharePointPnPPowerShell2019
Add agent to your azure environment
Add step to deploy your solution into pipline with using self-hosted agent
This scenario allows you to deploy sppkg solutions without publish your app catalog to internet, because your self-hosted agent will be in the save network as your sharepoint farm.
Azure pipeline deploy steps allow to run powershell on target machines
Prerequisites This task uses Windows Remote Management (WinRM) to
access on-premises physical computers or virtual computers that are
domain-joined or workgroup-joined.
New to Karate & Azure. Just created few API tests using Karate and easy simple. Want to take it further adding it Azure pipeline.
Found few links that just points to add pom.xml and maven from Microsoft. Also found Jekins integration but none for Azure.
Unknown / How to.
What file needs to be moved to the pipeline, eg, jar, war, xml etc.
How to create them i use intelliJ.
Any step by step tutorials available? any help appreciated.
To run Karate tests on azure devops pipeline, you can follow below general steps for building/testing java project.
1, First create your Karate tests projact with Maven. Add the related dependencies and plugins in the pom.xml. See example here.
2, Push your local source code(eg. .feature/.java/pom.xml etc) to github, or azure devop git repository. No need to push .jar dependencies, for the dependencies can be downloaded by the Maven task in the pipeline.
3, Create a azure pipeline, Follow this example to create a Yaml format pipeline. If you want to create a classic UI view pipeline, follow the example here.
4, Add Maven task in your pipeline to run the Karate test: See below example in Yaml.
steps:
- task: Maven#3
displayName: 'Maven Test'
inputs:
mavenPomFile: 'pom.xml'
goals: test
publishJUnitResults: false
If You use Microsoft cloud hosted agents to run your pipeline, you need to make sure the API tested by Karate can be accessed from the cloud hosted agents.(ie. API can be accessed publicly)
If the API server is hosted locally, you need to create self-hosted agent, and run your azure pipeline on your self-hosted agent.
#Devanathan
Better way is go for Publishing artifacts for both
a) your Cucumber Report
b) Your Karate HTML report.
Anyone can download both the artifacts (i.e reports from pipeline) and see the Report.
I tried to publish cucumber-html-reports (this is the exact name of folder that Karate generates) and was successful.
I intentionally kept report output directory in src/test/java for some reason [by using .reportDir("src/test/java/reports") in testParallel() method], you can try same by keeping reports in 'target' folder only.
I was not able to Publish Karate HTML report as somehow its not being picked in azure
I am trying to deploy my flask application on Linux web apps.
I want to set a azure pipeline for my code which is pushed on an azure repository.
I have made all the configuration changes in my python code and created a web app with runtime stack of Python 3.7
As soon as I go to deployment center to deploy my code, after selecting the azure repository as the source of my code, I am redirected to an option of azure pipelines where we have to configure our build settings.
But the build does not gives any option for Python. It just gives me four build options such as Node, Ruby, Asp.Net and php.
I cannot use :
- Docker
- Git
With such limitations I have found no suitable tutorial to do the same.
Can someone tell me some way to set the pipeline for my python project ?
Azure DevOps CI/CD works with any language, platform and cloud. Just for Python application, you may need add additional steps to achieve the deployment from Azure Devops CI/CD.
CI
Since the python is an interpreted language, do not need the compilation. If none of other step, like test, just need use 2 tasks in CI pipeline: Archive Files task and Publish Build Artifacts task.
The Archive Files task used to pack the python application source folder into a zip package to use it in CD. And Publish Build Artifacts task will publish this zip package to Release pipeline.
BUT,
If your project contains and needs test, please add another Command line task to run the test by using pytest.
But, in azure devops, you need configure the python environment with some tasks if you want to use python component like pytest.
Here please refer to this blog.
Note: Since the stack you are using is Python 3.7, please specify the python version as 3.x in the Using Python task.
CD
Since you have create the app service in Azure portal, just skip step 4(Add Azure CLI task) in Exercise 3: Configure Release pipeline which shown in this blog, because Step 4 just used to create a new Azure Resources.
1. To deploy the python application, you need add the Azure App Service manage task first to install the corresponding python version site extension in release pipeline:
It would install set of corresponding tools to support to manage your app service.
2. Next you could use Azure App Service deploy to deploy the zip package which created in the Build pipeline, to the app service you configured in Azure portal.
After specified the subscription in this task, the app service will automatically display in the drop list of App Service name:
Then specified the path which you configured in the publish task of the build pipeline. Replace $(Build.ArtifactStagingDirectory) as $(System.DefaultWorkingDirectory), and replace $(Build.BuildId) as * to search the zip package by using the fuzzy search.
Azure DevOps Pipeline : How to release Project binary file into Azure.
How can I deploy project binary files into server using Azure Pipeline, don't want to release project full source code?
You would do something like this.
create a deployment group
create a build, configure it
create a release, configure it (get artifacts from build, deploy to deployment group)
These are the steps you need to perform. link has more information on this matter
I want to do continuous integration and deployment in Azure Data factory. I'm not able to find any specific document explaining this.
How can I do it or where can I read about it?
To build your project, you can use msbuild - just like it's done in Visual Studio. It will validate syntax, check references between json configurations and check all dependencies. If you are using Visual Studio Team Services as CI server you can use Visual Studio Build step in build configuration to do it. However, it requires to install ADF tools for VS on build agent machine.
To deploy, you can try:
Powershell. For example, you can use Set-AzureRmDataFactoryV2Dataset to deploy datasets. There are similar commands for all other configurations and for version 1 of Azure Data Factory as well.
If you are using VSTS, you can try this 3rd party extension. It allows to deploy json configurations and start/pause pipelines. I'm not sure if it works with ADF v2.
You can use the VSTS GIT integration with ADF v2 UX to do continous deployment and continuous integration. VSTS GIT integration allows you to choose a feature/development branch or create a new one in your VSTS GIT repo. You can work in your feature/development branch and create PR in VSTS GIT to merge your changes to the master branch. You can then publish to your data factory using ADF v2 UX. Please try this and let us know if this doesn't work for you or you face any issues.