部署Bitbucket工件进行下载

Seeu1

我尝试过将测试覆盖率结果从管道上传到下载。
我将结果作为工件文件夹(dir / **)。
我遵循了该指南:https : //confluence.atlassian.com/bitbucket/publish-and-link-your-build-artifacts-872137736.html

所以我的bitbucket-pipelines.yml代码是:

pipelines:

default:
  - step:
      name: unit tests cover report
      image: aztec2docker/polymer-testing-docker
      artifacts:
        - unit-test-cover-report**
      script:
        - npm i
        - npm run test-cover
  - step:
      name: upload
      script:
        - curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"unit-test-cover-report"

它适用于单个文件,但不适用于文件夹。
所以我的问题是:如何将完整的工件文件夹上传到bitbucket下载?

亚历山大·朱可夫

有两种方法可以上传多个文件。

选项1在您的文件夹中创建ziptar.gz存档,然后将此存档上传到下载内容中。有一个可用于上传文件的Bitbucket管道:bitbucket-upload-file

- step:
    name: upload
    script:
      - zip report.zip unit-test-cover-report-folder
      - pipe: atlassian/bitbucket-upload-file:0.1.2
          variables:
            BITBUCKET_USERNAME: $BITBUCKET_USERNAME
            BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
            FILENAME: 'report.zip'

选项2:您可以在一个API调用中上传多个文件,如Bitbucket API文档中所述

- curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"file-1" --form files=@"file-2"

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章