Rani
Rani

Reputation: 111

Release Pipeline unpack the zip in linux server

i need to unpack the zip file in build agent and then copy to linux server. how can do it.

trigger: none resources: pipelines: - pipeline: MainBuild source: 'Main - Test and Build' trigger: branches: include: - fix/SetFTAPipeline variables: NODE_TLS_REJECT_UNAUTHORIZED: 0 stages: - stage: FTA displayName: FTA_Deploy variables: - group: FTA_Variables pool: name: 'EX_AgentPools' demands: - Agent.Name -equals vmprdbldb999

  jobs:
    - deployment: FTA
      environment:
        name:  FTA_AR
      strategy:
        runOnce:
          deploy:
            steps:
            - download: MainBuild
              artifact: main
            - task: CopyFilesOverSSH@0
              inputs:
                sshEndpoint: CentOS FTA VM APP1 CBVR 
                sourceFolder: $(Pipeline.Workspace)/MainBuild/main/
                contents: '*.zip' 
                targetFolder: /opt/cbvr
                cleanTargetFolder: false 
                overwrite: true 
                failOnEmptySource: false 
                flattenFolders: false

Upvotes: 0

Views: 1432

Answers (1)

Leo Liu
Leo Liu

Reputation: 76910

Release Pipeline unpack the zip in linux server

To unpack the zip file in build agent, you could try to use the Extract Files task:

- task: ExtractFiles@1
  inputs:
    #archiveFilePatterns: '**/*.zip' 
    destinationFolder: 
    #cleanDestinationFolder: true 
    #overwriteExistingFiles: false
    #pathToSevenZipTool: 

And copy to linux server, uou could try to use Copy Files Over SSH task to copy the Artifacts to a Linux Server.

Use this task in a build or release pipeline to copy files from a source folder to a target folder on a remote machine over SSH.

This task allows you to connect to a remote machine using SSH and copy files matching a set of minimatch patterns from specified source folder to target folder on the remote machine. Supported protocols for file transfer are SFTP and SCP via SFTP. In addition to Linux, macOS is partially supported.

Please check the developer forum Copy Files Over SSH during Continuous Integration and Deployment for some more details.

Upvotes: 0

Related Questions