We're starting to use Azure DevOps to build and deploy my application. Currently, we do not upload the application images to our repo. I Would like to know if I could download all the images to the artifact that is going to be generated during the build pipeline.
My yml pipeline :
trigger:
– develop
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
– task: NuGetToolInstaller@0
-
task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)' -
task: Npm@1
inputs:
command: 'install'
workingDir: 'applicationFolder/app' -
task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)' -
task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
Best Answer
The short answer is yes.
There is no out of box task to download the file from FTP server. Only FTP Upload task to upload file to the FTP server not download.
So, to resolve it, we could use powershell scripts to connect to FTP server and download files:
Scripts like:
Certificate comes from: PowerShell Connect to FTP server and get files.
Then publish those download files to the Artifacts by the task
PublishBuildArtifacts
.Hope this helps.