PNG 图像在我在 Azure DevOps 中发布管道工件时未正确上传。

huangapple go评论114阅读模式
英文:

PNG images are not uploaded correctly when I publish pipeline artifact in Azure DevOps

问题

在Azure DevOps管道中构建Docker镜像时,当我部署应用程序时,PNG图像无法显示。为了交叉检查,我只是发布了管道的artifact以检查PNG图像文件。图像是可用的,但当我下载并打开文件时,它显示“Windows照片查看器无法显示此图片,因为文件似乎已损坏、损坏或太大”。

Azure-devops-pipeline.yaml

trigger:
- none

stages:
- stage: PublishBuildArtifacts
  displayName: PublishBuildArtifacts
  jobs:
  - job: Publish
    displayName: PublishBuildArtifacts
    pool:
      vmimage: 'ubuntu-latest'
    steps:
    - task: PublishBuildArtifacts@1
      inputs:
        PathtoPublish: '$(System.DefaultWorkingDirectory)/test png'
        ArtifactName: 'drop'
        publishLocation: 'Container'

在使用Azure DevOps管道时,如何正确上传PNG图像,因为当我在本地构建Docker镜像时,图像对我的应用程序正常工作。

英文:

Build docker image from azure devops pipeline and when I deploy the application, the PNG images are not displaying. To cross check, I just published pipeline artifact to check the PNG image files. The image is available but it shows windows photo viewer can’t display this picture because the file appears to be damaged, corrupted, or is too large when I download and open the file

Azure-devops-pipeline.yaml

trigger:
- none

stages:
- stage: PublishBuildArtifacts
  displayName: PublishBuildArtifacts
  jobs:
  - job: Publish
    displayName: PublishBuildArtifacts
    pool:
      vmimage: 'ubuntu-latest'
    steps:
    - task: PublishBuildArtifacts@1
      inputs:
        PathtoPublish: '$(System.DefaultWorkingDirectory)/test png'
        ArtifactName: 'drop'
        publishLocation: 'Container'

How to get upload PNG images correctly when I use Azure DevOps pipeline because when I build the Docker image locally, the image works as expected for my application.

答案1

得分: 0

问题与“遇到了1个应该是指针但不是的文件”相关

使用 GUI 更新了图像而不是使用 VS Code。

英文:

The issue is related "Encountered 1 file(s) that should have been pointers, but weren't"

Updated the Image by GUI instead of VS Code.

答案2

得分: 0

也许有个提示:.artifactignore

PathtoPublish 的值中是否缺少了'.'?

英文:

maybe a hint : .artifactignore

is there a missing '.' in PathtoPublish value ?

huangapple
  • 本文由 发表于 2023年6月29日 16:14:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76579211.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定