Home > Back-end >  Download a secure file to repo code in Azure Devops Pipelines
Download a secure file to repo code in Azure Devops Pipelines

Time:02-24

I am creating a Pipeline to automatically build and release a flutter app. On my machine the flutter build appbundle --release works just fine and also signs the app correctly. I reference a key and a properties file, which I both don't want to upload into the repo, but instead use the Library > Secure Files.

How can I either download these files onto my Agent to a specific position, or use the downloaded file path in my build.gradle?

CodePudding user response:

You can utilize "Download Secure File task" to download from the library on to your agent.

reference: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-secure-file?view=azure-devops

https://docs.microsoft.com/en-us/azure/devops/pipelines/library/secure-files?view=azure-devops

- task: DownloadSecureFile@1
  inputs:
    secureFile: 'secureFile'

- task: CopyFiles@2
  inputs:
    SourceFolder: '$(Agent.TempDirectory)'
    Contents: secureFile
    TargetFolder: '$(Build.ArtifactStagingDirectory)'
  • Related