Forked from subudear/azure-pipeline-artifactory-upload-download.yml
Created
July 18, 2022 13:22
-
-
Save amikha33/5dae91df0d2655cdf0920306997ade54 to your computer and use it in GitHub Desktop.
upload or download files to/from artifactory using azure devops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trigger: | |
| - master | |
| jobs: | |
| - job: BuildAndTest | |
| workspace: | |
| clean: all | |
| pool: | |
| name: Self-Hosted-Agent | |
| steps: | |
| - task: GoTool@0 | |
| inputs: | |
| version: '1.17' | |
| - task: Go@0 | |
| displayName: "Go Get" | |
| inputs: | |
| command: 'get' | |
| arguments: '-d' | |
| workingDirectory: '$(System.DefaultWorkingDirectory)' | |
| - task: Go@0 | |
| displayName: "Go Build" | |
| inputs: | |
| command: 'build' | |
| workingDirectory: '$(System.DefaultWorkingDirectory)' | |
| - task: Go@0 | |
| displayName: "Go Test" | |
| inputs: | |
| command: 'test' | |
| arguments: './...' | |
| - task: CopyFiles@2 | |
| displayName: "Copy files to ArtifactStaging" | |
| inputs: | |
| TargetFolder: '$(Build.ArtifactStagingDirectory)' | |
| - task: PublishBuildArtifacts@1 | |
| displayName: "Publish Artifact" | |
| inputs: | |
| artifactName: drop | |
| - task: ArtifactoryGenericUpload@2 | |
| inputs: | |
| artifactoryService: 'BasicAuth-artifactory' | |
| specSource: 'taskConfiguration' | |
| fileSpec: | | |
| { | |
| "files": [ | |
| { | |
| "pattern": "*.go", | |
| "target": "uploadordownload-generic-local/upload/" | |
| }, | |
| { | |
| "pattern": "*.yaml", | |
| "target": "uploadordownload-generic-local/upload/" | |
| } | |
| ] | |
| } | |
| failNoOp: true | |
| - task: ArtifactoryGenericDownload@3 | |
| inputs: | |
| connection: 'BasicAuth-artifactory' | |
| specSource: 'taskConfiguration' | |
| fileSpec: | | |
| { | |
| "files": [ | |
| { | |
| "pattern": "uploadordownload-generic-local/upload/*.go", | |
| "target": "c:\\download\\" | |
| } | |
| ] | |
| } | |
| failNoOp: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment