How to upload .zip files into Azure artifacts using maven? - azure

I have an artifacts which has .pom and .zip file. What is the command to upload it into Azure artifacts?
mvn org.apache.maven.plugins:maven-deploy-plugin:2.4:deploy-file
-Dpackaging=jar
-DrepositoryId=feedName
-Durl= https://pkgs.dev.azure.com/organizationName/projectName/_packaging/feedName/maven/v1
-DgroupId=groupId
-DartifactId=artifactId
-Dversion=versionNumber
-DpomFile=pathToPomFile
-**WhatHere...?**=pathtoZipFolder

Related

Where to save a reusable static jar to be used from an Azure DevOps pipeline?

I have an Azure DevOps pipeline
The pipeline has a "command line" task that runs a java command on a jar file
The jar file is a static one that represents a tool to be used in the build process.
The jar file is not created as part of the build pipeline. It's just a jar with one version and it doesn't change with each build
Where is the best place to save this jar file and how to download it to the agent during the build pipeline execution ?
Since the jar file is static one and not created as part of the build pipeline, you can save the jar file to Azure Artifacts Feed -> Universal Package.
To upload the jar file to Azure Artifacts Universal Package, you can use Universal Packages Task - Publish command in Pipeline or Azure CLI command: az artifacts universal publish (work in pipeline or local machine).
Then you can use the task: Universal Packages Task - Download command to download the Universal Package during the build pipeline execution.

Azure Devops - Build project, delete some files and zip a folder

I'm starting on Azure Devops.
With Azure Devops, how can I delete some files after the solution build and before generate a zip file, but all this in the same step?
In the image step, do the solution build and generate a zip with the package, ready to deploy, but I need delete some files inside this zip file.
MSBuild process print screen with arguments:
Zip file with all files to be deployed in the server and the zip that I need delete some files:
Maybe I will need unzip the package, delete the files and zip the package?
This MSBuild task will build project with MSBuild. And reviewing this doc: MSBuild Properties we find that currently there is no such argument implementing this feature.
In the meanwhile, we find this doc guides how to exclude Files and Folders from a Web Package.

Azure CI pipeline ignored my botdetect.xml file

I am using Azure CI pipeline and using the .NetCore build tasks template, today I noticed that the file botdetect.xml in my source control, and after project passes from CI/CD pipeline, specific .xml
dotnet publish command publish the output of your .NET build, you need to make sure the botdetect.xml file exists in your build output, then it can be published to $(Build.ArtifactStagingDirectory) by running dotnet publish --output $(Build.ArtifactStagingDirectory), and publish the artifact by using Publish artifact task.
You could check your .csproj file to see whether the .xml file has been set to "Always Copy To Output Directory", it seems like:
<Compile Include="botdetect.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>

Where does gitlab-runner download job artifacts zip file?

I have build, test and deploy jobs in gitlab-ci file. The artifact created at the test job and should be passed to deploy job. I see that the artifacts downloading in the console (See the image) but I can't find it at the specified path. So where does the gitlab-runner save the artifacts. How to use them in subsequent jobs?
The deploy job is dependent upon test job via dependencies tag.image showing artifacts downloading
Artifacts are downloaded to your build main directory, the same directory that your code is being cloned to

Azure deployment from Azure DevOps failing to find zip package

I am setting up a build and release pipeline for our Azure mobile app using Azure DevOps. I have completed the build and all works fine. I have a build task defined that creates the required zip file for deploying to Azure and this succeeds and the zip file is created at the root of the folder. But the deployment fails stating that the zip file cannot be found.
Here is my build task that creates the zip file.
And here is the output from the build step showing that it has successfully created the zip file.
But the deployment fails as it can't find the zip file.
You need to publish the .zip file from your build using the Publish Build Artifacts task. That will make it available as an artifact to be linked into a release definition to be deployed.

Resources