Executing mysql scripts tasks on (on-premise linux agent) mysql server using Azure DevOps Release pipeline? - mysql

I have configured Azure Release pipeline for my deployment. But I want to run Mysql scripts on Mysql Sever using azure devops tasks, can someone help me if there is a best way to run the scripts ?
0- what task should I use from azure marketplace ?
1- should I run all scripts in one task or each script as a separate task ?
2- how to wait while script is running ?

MySQL Toolkit for Windows is a VSTS / TFS extension and contains helpful tasks for build and release definition for MySQL servers. You can run ad-hoc MySQL command, script or scripts collection on Windows Agents including Windows Hosted Agents (Linux Agents not supported).
In addition, you can add a step to run a PowerShell/batch script to execute the SQL script, and you can also create a custom build task and publish it to VSTS.
BTW, you could add PowerShell Sleep function to wait while script is running.
Update>>You could use Copy Files task to copy files from a source folder to a target folder using match patterns.

Related

Dynatrace Invoke shell script from Linux server

Is there a way to create a problem metric in Dynatrace using a shell script that can be executed from the Linux server?
Here, Problem metric means,
Let's assume that we are using a shell script to check the status of deployed services on the Linux Server.
Then,
That Shell Script should be able to be called by Dynatrace
And, based on Shell Script's response, should be able to create Problem.
What do you mean by 'problem metric'?
You can create metrics via the Metric API and Problems via the Events API
You can call either endpoint from a shell script on linux. If there is a OneAgent on the system you could also use an extension.

Azure DevOps - How to download a file from repo using SSIS

I am looking to create a SSIS package which downloads a file from an Azure DevOps GIT repository.
The file is a excel spread sheet.
The SSIS package should download this file in a local directory which can then be used for further processing.
Is this possible to achieve using SSIS?
Is this possible to achieve using SSIS?
I'm afraid, no, this could not be achieved via SSIS until now. Because what is available in Azure devops is build and deploy SSIS package. We haven't support to run SSIS package in Azure devops pipeline at this time.
At present, you can make use Azure Data Factory, which is the one service of Azure. See this doc.
But also, as far as I know, it does not support activity of copy file via SSIS. And if you want the excel file can be further processing with SSIS, you may consider to use Azure file copy task to copy the excel file to Azure blob:
You can do just about anything you want in Azure Devops using either the Powershell release template or the Run Powershell on Remote Machines release template. The only catch here is setting up WinRM on the remote servers, opening ports/firewall settings, using X509 self-signed certs if you want to do this over SSL, WinRM listeners, setting up trusted hosts, etc. etc. It took me two months to finally get WinRM setup and working correctly from Azure Devops (in my case that included setting up a special security group policy to allow the WinRM services to run unimpeded on the remote machines joined to the domain). Once you have WinRM working though, you can have Azure Devops drive anything that you could script with Powershell so the effort was worth it for me. If you embark on this adventure, take the time to write some powershell test scripts that call Invoke-command to test all of the WinRM security features I mention above, this will save you a lot of time with troubleshooting a remote connection over WinRM.

Can i add publish setting file from VSTS to deploy project on Microsoft azure

i am trying to deploy the project from VSTS to azure i have publish setting file i need to know how to use publish setting file in pipeline to deploy the project on azure. or any other solution to deploy on azure.
Yes, you can store the plain password in the secret variable of build/release, then specify the password through MSBuild argument (/p:Password={variable}).
After that you can specify the public profile (.pubxml file instead of .publishsettings file) in Visual Studio Build task (e.g. /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:PublishProfile="{profile name}")
Alternately you can write a script and add a Batch Script task to run the script to deploy on Azure. Please refer to Deploying to Azure from VSTS using publish profiles and msdeploy for details.
You can also use the Azure App Service Deploy task to deploy the Azure Web App. Please refer to How to deploy to Azure using Team Services Release Management for details.

Why wouldn't SSIS package running in SQL Server Agent job transfer files to a network folder?

I've run into this twice now where I can run my SSIS package in BIDS and Integration Services but it fails when it's run through SQL Server Agent. Both of these packages transfer a file as a final step to a folder on our network.
The error I receive is Could not find a part of the path then the path and file name. When I schedule them in Windows Task Scheduler they execute fine but I'd rather have them run through sql server agent.
Has anyone run into this issue and found a work around? Is there a setting that I'm missing in sql server?
Any help would be appreciated.
You need to run the SQL Server job using a proxy account that is configured to run jobs of type SQL Server Integration Services Packages. The jobs usually run under SQL Server Agent Service account, which does not have access to network folders. To access network folders, you need to set up a proxy with a domain account credentials (preferably) so you can access network path.
Below answer in SO question has the detailed steps on how to set up a proxy account
How do I create a step in my SQL Server Agent Job which will run my SSIS package?

Using JUnit, Maven and Hudson/Jenkins for integration tests

We are going to use Hudson/Jenkins build server to both build our server applications (just calling maven) and run integration tests against it. We are going to prepare 3 Hudson/Jenkins jobs: for build, deploy and run integration tests, which call each other in this order. All these jobs (build, deploy, integration tests) will be running nightly.
The integration tests are written with JUnit and are invoked by mvn test, (which will be invoked by the "test" Hudson/Jenkins job in turn). Since they require the server to be up and running we have to run that "deploy" job.
Does it make sense? Is there are any special server to deploy application and run tests or Hudson/Jenkins is ok for that?
It definitely makes sense, basically you are referring to a build pipeline. There is a Jenkins-plugin to help visualize the upstream/downstream projects (you create a new pipeline view in jenkins).
As for the deployment of the server component, this depends on what technology/stack you are running on. For instance you could write a script that deploys the application to a test environment using a post-build step in jenkins.
Another option is to use a maven plugin to deploy the application. You can separate the deployment step in profile, and run only the deploy goal on the deploy step etc.
Basically there are a lot of options, but the idea of a build pipeline makes a lot of sense. To read up on build pipelines and related topics I would suggest taking a look at Continuous Deployment.
For more information related to Jenkins, have a look at this video.
Does it make sense? Is there are any special server to deploy
application and run tests or Hudson/Jenkins is ok for that?
You can run the application on the same server as jenkins, but wether that makes sense depends on the application. If it depends heavily on a specific server setup, a better choice may be to run the server in a vm, and but the configuration in source control. There are plenty of tools to help automate this, of the top of my head you have Puppet, Chef and Vagrant
Depending on the technology of your server, you could do all of this in a single Hudson project, executing your integration tests using Maven's Failsafe plugin instead of Surefire.
This allows you to start and deploy prior to executing the integration tests, and shutdown your server after they have completed. It also allows you to separate your integration tests from your unit tests.
For Java EE applications, you can perform the start/deploy/stop steps using Cargo, or use an embedded Jetty containing and the Jetty Maven plugin.