Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
664 views
in Technique[技术] by (71.8m points)

webpack - Azure Devops - Publish Pipelines Artifacts: Build Id is not valid

I'm having problems with the 'Publish Pipeline Artifact' task when running a release pipeline in Azure DevOps.

The error I get is Build Id is not valid

The value in the output matches the BUILD_BUILDID in 'Initialize job', which is also the latest commit id of the repo.

I'm a bit confused as 'buildid' is a system variable which is not modifiable by the user.

I'm not sure if the rest of the job is relevant, but runs as follows:

1. Node.js tool installer (10.x)
2. npm (install)
3. Command line (webpack)
4. Copy files (to build.artifactstagingdirectory)
5. Archive files (to $(Build.ArtifactStagingDirectory)/client.zip)
6. Publish Pipeline Artifacts ($(Build.ArtifactStagingDirectory)/client.zip) - error

Publish Pipeline Artifact log:

2021-01-08T08:40:21.7105147Z ##[debug]Evaluating: succeeded()
2021-01-08T08:40:21.7105624Z ##[debug]Evaluating succeeded:
2021-01-08T08:40:21.7106468Z ##[debug]=> True
2021-01-08T08:40:21.7107158Z ##[debug]Result: True
2021-01-08T08:40:21.7108186Z ##[section]Starting: Publish Pipeline Artifact
2021-01-08T08:40:21.7116705Z ==============================================================================
2021-01-08T08:40:21.7117060Z Task         : Publish Pipeline Artifacts
2021-01-08T08:40:21.7117393Z Description  : Publish (upload) a file or directory as a named artifact for the current run
2021-01-08T08:40:21.7117701Z Version      : 1.2.3
2021-01-08T08:40:21.7117942Z Author       : Microsoft Corporation
2021-01-08T08:40:21.7118290Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/publish-pipeline-artifact
2021-01-08T08:40:21.7118679Z ==============================================================================
2021-01-08T08:40:22.0764350Z Artifact name was not inserted for publishing.
2021-01-08T08:40:22.1092880Z ##[error]Build Id is not valid: 4ce1b383822c01dd4fbcde57d575bf562dd54e6a
2021-01-08T08:40:22.1103924Z ##[debug]Processed: ##vso[task.logissue type=error;]Build Id is not valid: 4ce1b383822c01dd4fbcde57d575bf562dd54e6a
2021-01-08T08:40:22.1105538Z ##[debug]Processed: ##vso[task.complete result=Failed;]
2021-01-08T08:40:22.1197640Z ##[debug]   at Agent.Plugins.PipelineArtifact.PublishPipelineArtifactTaskV1.ProcessCommandInternalAsync(AgentTaskPluginExecutionContext context, CancellationToken token)
   at Agent.PluginHost.Program.Main(String[] args)
2021-01-08T08:40:22.1258400Z ##[section]Finishing: Publish Pipeline Artifact

Can someone point me in a direction? This error doesn't seem to be very common (as far as online searches go) which makes me think I'm doing something fundamentally wrong. For what it's worth, I'm trying to build a project using webpack to deploy to an on-prem server (which seems like it should have been quite a straightforward task).

question from:https://stackoverflow.com/questions/65626562/azure-devops-publish-pipelines-artifacts-build-id-is-not-valid

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Publishing pipeline and build artifacts is not supported for release piepline. Thus you simply can't do this here. (as it is written in docs)

Use this task in a pipeline to publish your artifacts(note that publishing is NOT supported in release pipelines. It is supported in multi-stage pipelines, build pipelines, and yaml pipelines).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...