Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
zhaoxuanchao
zxc-antd-demo
Commits
c420e815
Commit
c420e815
authored
Aug 31, 2021
by
zhaoxuanchao
Browse files
Update .gitlab-ci.yml
parent
17cb0d47
Pipeline
#2968
canceled with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
21 deletions
+24
-21
.gitlab-ci.yml
.gitlab-ci.yml
+24
-21
No files found.
.gitlab-ci.yml
View file @
c420e815
image
:
node:12
# 设置执行镜像
image
:
busybox:latest
# 整个pipeline有两个stage
stages
:
-
build
-
test
# 定义全局缓存,缓存的key来自分支信息,缓存位置是vendor文件夹
cache
:
key
:
${CI_COMMIT_SHA}_node_modules
untracked
:
true
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
node_modules/
policy
:
pull-push
-
vendor/
stages
:
-
prepare
-
build
-
deploy
before_script
:
-
echo "Before script section"
install_dependencies
:
stage
:
prepare
script
:
-
yarn install
after_script
:
-
echo "After script section"
.
build
_job
:
build
1
:
stage
:
build
tags
:
-
k8s
script
:
-
echo "build"
-
yarn build
build_1
:
extends
:
.build_job
-
echo "将内容写入缓存"
-
echo "build" > vendor/hello.txt
build_2
:
extends
:
.build_job
test1
:
stage
:
test
script
:
-
echo "从缓存读取内容"
-
cat vendor/hello.txt
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment