microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.42k stars 2.59k forks source link

Copy and Publish Build Artifacts task is not supported within Release #1292

Closed ghostinside closed 8 years ago

ghostinside commented 8 years ago

2016-02-24T14:05:56.9290788Z Agent Name: Hosted Agent

2016-02-24T14:05:56.9300798Z ==============================================================

2016-02-24T14:05:56.9300798Z Entering OnPrepareEnvironment

2016-02-24T14:05:57.9804351Z Agent name: Hosted Agent, version: 1.95.0, OSVersion: Microsoft Windows NT 6.2.9200.0

2016-02-24T14:05:57.9814347Z SkipArtifactsDownload=False, ReleaseId=22, TeamProjectId=9871b294-99e1-48d0-a606-47a86c210f8e

2016-02-24T14:05:57.9869527Z Release folder: 8acfd1d8a

2016-02-24T14:05:57.9946425Z Environment variables available are below. Note that these environment variables can be referred to in the task (in the ReleaseDefinition) by replacing "_" with "." e.g. AGENT_NAME environment variable can be referenced using Agent.Name in the ReleaseDefinition:

2016-02-24T14:05:57.9956047Z [AGENT_NAME] --> [Hosted Agent]

2016-02-24T14:05:57.9958223Z [AGENT_ROOTDIRECTORY] --> [C:\a]

2016-02-24T14:05:57.9958223Z [AGENT_HOMEDIRECTORY] --> [C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default]

2016-02-24T14:05:57.9968459Z [AGENT_SERVEROMDIRECTORY] --> [C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\agent\worker]

2016-02-24T14:05:57.9968459Z [AGENT_ID] --> [1]

2016-02-24T14:05:57.9978392Z [AGENT_MACHINENAME] --> [TASKAGENT5-0048]

2016-02-24T14:05:57.9978392Z [AGENT_JOBNAME] --> [Release]

2016-02-24T14:05:57.9988455Z [AGENT_WORKFOLDER] --> [C:\a]

2016-02-24T14:05:57.9988455Z [SYSTEM] --> [release]

2016-02-24T14:05:57.9998408Z [SYSTEM_DEBUG] --> [true]

2016-02-24T14:05:57.9998408Z [RELEASE_RELEASEID] --> [22]

2016-02-24T14:05:58.0008391Z [RELEASE_RELEASENAME] --> [Release-8]

2016-02-24T14:05:58.0008391Z [RELEASE_RELEASEDESCRIPTION] --> []

2016-02-24T14:05:58.0008391Z [RELEASE_DEFINITIONNAME] --> [acp-gas-live-6.38]

2016-02-24T14:05:58.0018401Z [RELEASE_RELEASEURI] --> [vstfs:///ReleaseManagement/Release/22]

2016-02-24T14:05:58.0018401Z [RELEASE_ENVIRONMENTURI] --> [vstfs:///ReleaseManagement/Environment/50]

2016-02-24T14:05:58.0028406Z [RELEASE_ENVIRONMENTNAME] --> [QA]

2016-02-24T14:05:58.0028406Z [RELEASE_SKIPARTIFACTSDOWNLOAD] --> [False]

2016-02-24T14:05:58.0038403Z [RELEASE_REQUESTEDFOR] --> [Alexander Kovalev]

2016-02-24T14:05:58.0038403Z [RELEASE_REQUESTEDFORID] --> [7782d29d-d561-4fca-a243-257e88d2c325]

2016-02-24T14:05:58.0038403Z [SYSTEM_HOSTTYPE] --> [release]

2016-02-24T14:05:58.0048398Z [SYSTEM_COLLECTIONID] --> [7ca298fe-0375-43ed-a418-90a0ad2a198a]

2016-02-24T14:05:58.0048398Z [SYSTEM_TEAMPROJECTID] --> [9871b294-99e1-48d0-a606-47a86c210f8e]

2016-02-24T14:05:58.0058393Z [SYSTEM_TEAMPROJECT] --> [Connect 6.X]

2016-02-24T14:05:58.0058393Z [SYSTEM_CULTURE] --> [en-US]

2016-02-24T14:05:58.0058393Z [SYSTEM_TEAMFOUNDATIONCOLLECTIONURI] --> [https://arkadiumarena.visualstudio.com/DefaultCollection/]

2016-02-24T14:05:58.0068411Z [SYSTEM_TASKDEFINITIONSURI] --> [https://arkadiumarena.visualstudio.com/DefaultCollection/]

2016-02-24T14:05:58.0073598Z [BUILD_DEFINITIONNAME] --> [acp-gas-live-6.38-rm]

2016-02-24T14:05:58.0073598Z [BUILD_DEFINITIONID] --> [119]

2016-02-24T14:05:58.0083825Z [BUILD_BUILDNUMBER] --> [20160220.2]

2016-02-24T14:05:58.0083825Z [BUILD_BUILDID] --> [2500]

2016-02-24T14:05:58.0093858Z [BUILD_REPOSITORY_NAME] --> [Connect 6.X]

2016-02-24T14:05:58.0103826Z [BUILD_SOURCEBRANCH] --> [refs/heads/live-v6.38]

2016-02-24T14:05:58.0103826Z [BUILD_SOURCEBRANCHNAME] --> [live-v6.38]

2016-02-24T14:05:58.0103826Z [BUILD_SOURCEVERSION] --> [2b2914a65654bc77ecd3670fcafcb830c50e2b91]

2016-02-24T14:05:58.0114088Z [BUILD_BUILDURI] --> [vstfs:///Build/Build/2500]

2016-02-24T14:05:58.0114088Z [BUILD_REQUESTEDFORID] --> [7782d29d-d561-4fca-a243-257e88d2c325]

2016-02-24T14:05:58.0123823Z [BUILD_REPOSITORY_PROVIDER] --> [TfsGit]

2016-02-24T14:05:58.0133801Z [BUILD_REQUESTEDFOR] --> [Alexander Kovalev]

2016-02-24T14:05:58.0133801Z [BUILD_TYPE] --> [Build]

2016-02-24T14:05:58.0143798Z [SYSTEM_TEAMFOUNDATIONSERVERURI] --> [https://arkadiumarena.vsrm.visualstudio.com/DefaultCollection/]

2016-02-24T14:05:58.0182406Z [SYSTEM_WORKFOLDER] --> [C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default_work]

2016-02-24T14:05:58.0183797Z [AGENT_WORKINGDIRECTORY] --> [C:\a\SourceRootMapping\7ca298fe-0375-43ed-a418-90a0ad2a198a\Job-1dab8c20-19a7-4d4c-9396-6cb9939b355a]

2016-02-24T14:05:58.0466987Z [AGENT_RELEASEDIRECTORY] --> [C:\a\8acfd1d8a]

2016-02-24T14:05:58.0466987Z [SYSTEM_ARTIFACTSDIRECTORY] --> [C:\a\8acfd1d8a]

2016-02-24T14:05:58.0477611Z [SYSTEM_DEFAULTWORKINGDIRECTORY] --> [C:\a\8acfd1d8a]

2016-02-24T14:06:00.0077950Z ##[section]Cleaning artifacts directory: C:\a\8acfd1d8a…

2016-02-24T14:06:00.0227953Z ##[section]Cleaned artifacts directory: C:\a\8acfd1d8a

2016-02-24T14:06:00.0257951Z Number of linked artifacts to download: 1

2016-02-24T14:06:00.0267979Z Starting artifacts download...

2016-02-24T14:06:00.0487945Z Downloading linked artifact: acp-gas-live-6.38-rm...

2016-02-24T14:06:00.0498124Z Downloading artifact of type: Build

2016-02-24T14:06:00.0508452Z Created artifact folder C:\a\8acfd1d8a\acp-gas-live-6.38-rm

2016-02-24T14:06:00.1103645Z Preparing to get the list of available artifacts from build.

2016-02-24T14:06:00.3327954Z Preparing to download artifact: Live

2016-02-24T14:06:00.3629675Z Artifact Type: ServerDrop

2016-02-24T14:06:00.3639698Z The artifact is of older version: False

2016-02-24T14:06:01.1974475Z Caching items under 'Live' in the file container...

2016-02-24T14:06:01.6317794Z Caching complete. (432 ms)

2016-02-24T14:06:02.2541641Z Downloading files.

2016-02-24T14:06:02.2551628Z Proxy server is disabled!. Download speed will be impacted.

2016-02-24T14:06:02.3381638Z Proxy has been disabled.

2016-02-24T14:06:07.3156111Z Downloads complete.

2016-02-24T14:06:07.3949278Z 123 placed file(s): 123 downloaded, 0 empty and new, 0 preserved.

2016-02-24T14:06:07.3959351Z 6 MB downloaded at 1112 KB/sec. Download time: 00:00:05.0567703. Parallel download limit: 8.

2016-02-24T14:06:07.3959351Z Proxy server was unavailable for some or all downloads.

2016-02-24T14:06:07.3969328Z Download breakdown:

2016-02-24T14:06:07.3979278Z 123 file(s) are new.

2016-02-24T14:06:07.3979278Z Preparing to download artifact: Dev

2016-02-24T14:06:07.3989295Z Artifact Type: ServerDrop

2016-02-24T14:06:07.3989295Z The artifact is of older version: False

2016-02-24T14:06:07.3999272Z Caching items under 'Dev' in the file container...

2016-02-24T14:06:07.5270060Z Caching complete. (126 ms)

2016-02-24T14:06:07.5318411Z Downloading files.

2016-02-24T14:06:07.5328411Z Proxy server is disabled!. Download speed will be impacted.

2016-02-24T14:06:07.5517490Z Proxy has been disabled.

2016-02-24T14:06:12.5395889Z Downloads complete.

2016-02-24T14:06:12.5415479Z 123 placed file(s): 123 downloaded, 0 empty and new, 0 preserved.

2016-02-24T14:06:12.5420952Z 6 MB downloaded at 1123 KB/sec. Download time: 00:00:05.0060379. Parallel download limit: 8.

2016-02-24T14:06:12.5420952Z Proxy server was unavailable for some or all downloads.

2016-02-24T14:06:12.5431157Z Download breakdown:

2016-02-24T14:06:12.5431157Z 123 file(s) are new.

2016-02-24T14:06:12.5441159Z Preparing to download artifact: QA

2016-02-24T14:06:12.5441159Z Artifact Type: ServerDrop

2016-02-24T14:06:12.5451232Z The artifact is of older version: False

2016-02-24T14:06:12.5451232Z Caching items under 'QA' in the file container...

2016-02-24T14:06:12.6605159Z Caching complete. (114 ms)

2016-02-24T14:06:12.6665301Z Downloading files.

2016-02-24T14:06:12.6675311Z Proxy server is disabled!. Download speed will be impacted.

2016-02-24T14:06:12.6765318Z Proxy has been disabled.

2016-02-24T14:06:17.6727395Z Downloads complete.

2016-02-24T14:06:17.6744482Z 123 placed file(s): 123 downloaded, 0 empty and new, 0 preserved.

2016-02-24T14:06:17.6750378Z 6 MB downloaded at 1124 KB/sec. Download time: 00:00:05.0039908. Parallel download limit: 8.

2016-02-24T14:06:17.6750378Z Proxy server was unavailable for some or all downloads.

2016-02-24T14:06:17.6760545Z Download breakdown:

2016-02-24T14:06:17.6760545Z 123 file(s) are new.

2016-02-24T14:06:17.6780331Z Downloaded linked artifact acp-gas-live-6.38-rm

2016-02-24T14:06:17.6790508Z Finished artifacts download

2016-02-24T14:06:17.6812276Z Leaving OnPrepareEnvironment

2016-02-24T14:06:17.8467948Z Running tasks

2016-02-24T14:06:17.8837981Z Starting task: Copy Publish Artifact: Service.Api

2016-02-24T14:06:18.0767942Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyPublishBuildArtifacts\1.0.18\CopyPublishBuildArtifacts.ps1

2016-02-24T14:06:18.7836409Z ##[debug]Entering script Publish-BuildArtifacts.ps1

2016-02-24T14:06:18.7866419Z ##[debug]CopyRoot = C:\a\8acfd1d8a\acp-gas-live-6.38-rm

2016-02-24T14:06:18.7876584Z ##[debug]Contents = QA**

2016-02-24T14:06:18.7876584Z ##[debug]ArtifactName = Service.Api

2016-02-24T14:06:18.7886407Z ##[debug]ArtifactType = FilePath

2016-02-24T14:06:18.7896392Z ##[debug]TargetPath = \testserver\live-v6.38-rm

2016-02-24T14:06:18.8026405Z ##[debug]Loading module from path 'C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\agent\worker\Modules\Microsoft.TeamFoundation.DistributedTask.Task.Internal\Microsoft.TeamFoundation.DistributedTask.Task.Internal.dll'.

2016-02-24T14:06:18.8396387Z ##[debug]Importing cmdlet 'Add-BuildAttachment'.

2016-02-24T14:06:18.8396387Z ##[debug]Importing cmdlet 'Convert-String'.

2016-02-24T14:06:18.8406400Z ##[debug]Importing cmdlet 'Get-IndexedSourceFilePaths'.

2016-02-24T14:06:18.8406400Z ##[debug]Importing cmdlet 'Get-JavaDevelopmentKitPath'.

2016-02-24T14:06:18.8416406Z ##[debug]Importing cmdlet 'Get-MSBuildLocation'.

2016-02-24T14:06:18.8416406Z ##[debug]Importing cmdlet 'Get-ServiceEndpoint'.

2016-02-24T14:06:18.8426406Z ##[debug]Importing cmdlet 'Get-TfsClientCredentials'.

2016-02-24T14:06:18.8426406Z ##[debug]Importing cmdlet 'Get-ToolPath'.

2016-02-24T14:06:18.8436407Z ##[debug]Importing cmdlet 'Get-TaskVariable'.

2016-02-24T14:06:18.8436407Z ##[debug]Importing cmdlet 'Get-VisualStudioPath'.

2016-02-24T14:06:18.8446414Z ##[debug]Importing cmdlet 'Get-VssConnection'.

2016-02-24T14:06:18.8446414Z ##[debug]Importing cmdlet 'Invoke-Ant'.

2016-02-24T14:06:18.8456407Z ##[debug]Importing cmdlet 'Invoke-BatchScript'.

2016-02-24T14:06:18.8456407Z ##[debug]Importing cmdlet 'Invoke-Maven'.

2016-02-24T14:06:18.8466404Z ##[debug]Importing cmdlet 'Invoke-MSBuild'.

2016-02-24T14:06:18.8466404Z ##[debug]Importing cmdlet 'Invoke-PublishSymbols'.

2016-02-24T14:06:18.8476402Z ##[debug]Importing cmdlet 'Invoke-Tool'.

2016-02-24T14:06:18.8486392Z ##[debug]Importing cmdlet 'Invoke-VSTest'.

2016-02-24T14:06:18.8486392Z ##[debug]Importing cmdlet 'Publish-BuildArtifact'.

2016-02-24T14:06:18.8496395Z ##[debug]Importing cmdlet 'Copy-BuildArtifact'.

2016-02-24T14:06:18.8496395Z ##[debug]Importing cmdlet 'Add-BuildArtifactLink'.

2016-02-24T14:06:18.8506395Z ##[debug]Importing cmdlet 'Register-XamarinLicense'.

2016-02-24T14:06:18.8506395Z ##[debug]Importing cmdlet 'Unregister-XamarinLicense'.

2016-02-24T14:06:18.8516396Z ##[debug]Importing cmdlet 'Get-X509Certificate'.

2016-02-24T14:06:18.8646377Z ##[debug]Loading module from path 'C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\agent\worker\Modules\Microsoft.TeamFoundation.DistributedTask.Task.Common\Microsoft.TeamFoundation.DistributedTask.Task.Common.dll'.

2016-02-24T14:06:18.8776390Z ##[debug]Importing cmdlet 'Complete-Task'.

2016-02-24T14:06:18.8776390Z ##[debug]Importing cmdlet 'Get-LocalizedString'.

2016-02-24T14:06:18.8786405Z ##[debug]Importing cmdlet 'Set-TaskVariable'.

2016-02-24T14:06:18.8786405Z ##[debug]Importing cmdlet 'Set-TaskProgress'.

2016-02-24T14:06:18.8796406Z ##[debug]Importing cmdlet 'Add-TaskIssue'.

2016-02-24T14:06:18.8796406Z ##[debug]Importing cmdlet 'Write-TaskDetail'.

2016-02-24T14:06:18.8806404Z ##[debug]Importing cmdlet 'Find-Files'.

2016-02-24T14:06:18.9256402Z ##[error]System.Management.Automation.RuntimeException: Copy and Publish Build Artifacts task is not supported within Release ---> System.Management.Automation.RuntimeException: Copy and Publish Build Artifacts task is not supported within Release

2016-02-24T14:06:18.9266455Z ##[error] --- End of inner exception stack trace ---

2016-02-24T14:06:18.9266455Z ##[error] at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)

2016-02-24T14:06:18.9276450Z ##[error] at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)

2016-02-24T14:06:18.9286400Z ##[error] at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)

2016-02-24T14:06:18.9286400Z ##[error] at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)

2016-02-24T14:06:18.9296398Z ##[error] at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)

2016-02-24T14:06:18.9306384Z ##[error] at Microsoft.TeamFoundation.DistributedTask.Handlers.PowerShellHandler.Execute(ITaskContext context, CancellationToken cancellationToken)

2016-02-24T14:06:18.9306384Z ##[error] at Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.RunTask(ITaskContext context, TaskWrapper task, CancellationTokenSource tokenSource)

2016-02-24T14:06:18.9756384Z Finishing task: CopyPublishBuildArtifacts

2016-02-24T14:06:18.9956392Z Skipping task PublishBuildArtifacts as it is disabled in the definition

2016-02-24T14:06:18.9986425Z ##[error]System.Exception: Task CopyPublishBuildArtifacts failed. This caused the job to fail. Look at the logs for the task for more details.

2016-02-24T14:06:18.9996382Z ##[error] at Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.Run(IJobContext jobContext, IJobRequest job, IJobExtension jobExtension, CancellationTokenSource tokenSource)

same output for task Publish Artifact as well

scottdallamura commented 8 years ago

This is by design, as you're not running a Build. See the error message:

2016-02-24T14:06:18.9256402Z ##[error]System.Management.Automation.RuntimeException: Copy and Publish Build Artifacts task is not supported within Release ---> System.Management.Automation.RuntimeException: Copy and Publish Build Artifacts task is not supported within Release

ghostinside commented 8 years ago

Hm, but what is the diff between copy on build and release, what was the matter of this behavior? 25 февр. 2016 г. 19:46 пользователь "scott dallamura" < notifications@github.com> написал:

Closed #1292 https://github.com/Microsoft/vso-agent-tasks/issues/1292.

— Reply to this email directly or view it on GitHub https://github.com/Microsoft/vso-agent-tasks/issues/1292#event-565920360 .

Mystere commented 7 years ago

@scottdallamura - I don't see why publishing artifacts is a build-only task. I have a very specific use case that requires validation of dacpac generated scripts prior to deployment to each environment. After these scripts are generated, I need to allow the user to download them, verify them, and then accept the release step and have it move to the next environment.

I can think of a whole bunch of other use cases where the release engineer needs to download the output of the release process, and the only real way to do that is through artifacts, as there is no way to access the generated files of a release.

Further, if you really aren't going to support this in release, then you should not have it show up in the Release hub.

DoranDouglas commented 7 years ago

Build creates the dacpac's and ispac's and then creates the artifacts that release consumes. Release can then if you want verify the artifacts and then ask (via the approvals) to deploy the artifacts to the environment. You can included the output of the verification in the approval request.

Mystere commented 7 years ago

@DoranDouglas - I don't see how you can do this in TFS, there is nothing in the Approvals dialog that allows you select files for inclusion in the output for verification that I can find. Can you explain this in more detail?