In my Copy Files
task, I am copying the required files to the file share location from which I will be doing the deployment. What is the use of publishing artifact step? Or it is obsolete in my case. I am confused about the what values should be put in the boxes.
Artifact publish location. required. Choose whether to store the artifact in Azure Pipelines ( Container ), or to copy it to a file share ( FilePath ) that must be accessible from the build agent. To learn more, see Artifacts in Azure Pipelines. Default value: Container.
You can publish your Artifacts at any stage of your pipeline using YAML or the classic editor. If you want to publish your Artifacts manually, you can use the Azure CLI to run the az pipelines runs artifact command. You will not be billed for storing your Pipeline Artifacts or Pipeline caching.
You could download the artifact and use the git command in command line task to push it to the repo, refer to the sample as below, it works for me.
Artifacts can be published at any stage of your pipeline. You can use YAML or the classic Azure DevOps editor to publish your packages. pathToPublish: the path of your artifact. This can be an absolute or a relative path.
And for your situation, you can use any of the tasks (Publish Artifacts task and Copy Files task). Since you only need to copy the contents under $(build.artifactstagingdirectory)
to the share path \\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)
, both the tasks can also achieve it.
If you use the Publish Artifacts task, settings as you specified in the picture is ok. It will copy the contents under $(build.artifactstagingdirectory)
to \\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)\drop
.
If you use the Copy Files task, settings as be set as below. It will also the same result as the Publish Artifacts task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With