Adding Tasks to Build Pipeline (iFoundry builds in Azure Blob storage)

  • Click on the + icon as appearing against Agent job1 and add the following tasks.

  1. Azure CLI

  2. Extract files

  3. Delete Zip file

  4. PowerShell Script

  5. Publish Pipeline Artifact

Task 1 : Azure CLI - Download Service Build from Azure Blob

  • Click on Azure CLI and input details into the required fields :

    • Select Azure Resource Manager connection

    • Select Script Type as PowerShell Core

    • Select Script Location as Inline script

    • Provide below script in Inline script tab

    az storage blob download-batch --destination $(Build.SourcesDirectory) --source $(BuildContainerName) --account-name $(BuildStorageName) --account-key $(BuildStorageKey) --pattern $(BuildBlobName)

  • Navigate to the Variables Tab and add the Azure Blob storage variables.

Task 2 : Extract files

  • Click on Extract files and input details into the required fields:

  • Archive file patterns: $(Build.SourcesDirectory)/$(BuildBlobName)

  • Destination folder: $(Build.SourcesDirectory)

Task 3 : Delete zip file

  • Click on Delete zip file and input details into the required fields :

  • Source Folder: $(Build.SourcesDirectory)/$(BuildBlobName)

  • Contents: $(BuildBlobName)

  • Check Remove SourceFolder option

 

Task 4 : Azure CLI - Download Published zip file from Azure Blob

  • Click on Azure CLI and input details into the required fields:

    • Select Azure Resource Manager connection

    • Select Script Type as PowerShell Core

    • Select Script Location as Inline script

    • Provide below script in Inline script tab

      azcopy copy 'https://iffilebasedpublish.blob.core.windows.net/glcontainer/CPRules.zip' '$(Build.artifactstagingdirectory)/'

Task 5: Powershell script task

  • Click on the Powershell task and input the declared variables (refer section 3.6.1) as Arguments.

    For Script Path, add the following value.

    ./psscripts/CreateIFBuild-args.ps1

    For Arguments, add the following if packages are in Azure Blob storage.

    -PackageLocation "$(PackageLocation)" -StorageType "$(StorageType)" -Profile "$(Profile)" -BlobEndPoint "$(BlobEndPoint)" -SASKey "$(SASKey)" -ContainerName "$(ContainerName)" -BuildOnlyUpdate "$(BuildOnlyUpdate)"

Task 6 : Copy Files - Copy Log Files

  • Click on Copy Log Files and input details into the required fields :

    • Source Folder: $(Build.SourcesDirectory)/publish/logs

    • Contents: **

    • Target Folder: $(build.artifactstagingdirectory)

Task 7 : Azure CLI - Upload Published zip file to Azure Blob

  • Click on Azure CLI and input details into the required fields :

    • Select Azure Resource Manager connection

    • Select Script Type as PowerShell Core

    • Select Script Location as Inline script

    • Provide below script in Inline script tab

      azcopy copy "$(build.artifactstagingdirectory)/CPRules.zip" "https://iffilebasedpublish.blob.core.windows.net/glcontainer?sv=2021-06-08&ss=bfqt&srt=sco&sp=rwdlacupiytfx&se=2023-11-08T22:49:36Z&st=2022-11-08T14:49:36Z&spr=https&sig=iPBcI8xlVYMen3PqGsh7p6FSG%2B%2FXpEkPt%2FsIythk0yY%3D" --recursive=true

Task 8: Publish Pipeline Artifact

  • Click on the Publish Pipeline Artifact task and provide the details as mentioned below:

    • File or directory path: $(build.artifactstagingdirectory)

    • Artifact name: drop

    • Artifact publish location: Azure Pipelines

  • After inputting all the mandatory details to the tasks, click Save & Queue.

  • Upon clicking Save & Queue, the Build is queued with an identification number.

  • Add Save comments and click Save and run.