【问题标题】: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'
结果搜索 发布!