




















动态名称
yaml
script:
# 动态生成时间戳
- export TIMESTAMP=$(date +'%Y%m%d%H%M%S')
# 动态生成文件名
- export ARTIFACT_NAME="${CI_JOB_NAME}-${TIMESTAMP}"
artifacts:
# 使用动态生成的制品名称
# 不生效,实际是 default.zip
name: $ARTIFACT_NAME
paths:
- "/target"参考:https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1664
By default, protected and non-protected branches do not share the cache. However, you can change this behavior.
so we run pipeline on cmss-web2321 branch, the cache url will be like http://minio.minio:9000/gitlab-runner/gitlab-cache/runner/-z_CiEf6/project/441/cmss-web-non_protected but on feature branch, the cache url will become to http://minio.minio:9000/gitlab-runner/gitlab-cache/runner/-z_CiEf6/project/441/cmss-web-non_protected

you can have all branches (protected and unprotected) use the same cache.
Clear the Use separate caches for protected branches checkbox.

yaml
stages:
- demo
.setup:
script:
- echo creating environment
.teardown:
after_script:
- echo deleting environment
demo-reference:
stage: demo
script:
- !reference [.setup, script]
- echo running my own command
after_script:
- !reference [.teardown, after_script]output result:
creating environment
echo running my own command
deleting environment
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。