【问题标题】:Gitlab CI/CD: Publishing the result of build stage onto another stageGitlab CI/CD:将构建阶段的结果发布到另一个阶段
【发布时间】:2022-11-14 16:54:11
【问题描述】:

我正在使用 Gitlab CI/CD 构建一个 CI/CD 管道。

.gitlab-ci.yml -

build:
    image: node:16-alpine
    stage: build
    script:
        - yarn install
        - yarn build
    artifacts:
      paths:
        - //something here

我有一个构建应用程序的build 工作。在部署应用程序的下一个工作中,我需要上一个工作的构建目录build

如何将其发布为工件?

【问题讨论】:

    标签: continuous-integration devops gitlab-ci cicd


    【解决方案1】:

    我愿意

      needs:
        - job: "build"
          artifacts: true
      stage: release
      image: registry.gitlab.com/gitlab-org/release-cli:latest #docker image
      script:
        - echo "release job"
      release:
        name: 'Release Executables $CI_COMMIT_SHORT_SHA'
        description: 'Created using the release-cli'
        tag_name: '$CI_COMMIT_SHORT_SHA'
        assets:
          links:
            - name: 'comment one'
              url: 'https://my.gitlab.my/you/project/-/jobs/${GE_JOB_ID}/artifacts/path to file'
    

    结果搜索 发布!

    【讨论】:

      猜你喜欢
      • 2020-12-13
      • 2022-01-11
      • 2016-01-29
      • 2020-11-06
      • 2021-10-29
      • 2021-11-30
      • 2016-12-16
      • 2021-11-02
      • 2019-09-21
      相关资源
      最近更新 更多