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
2f9c63ef
Commit
2f9c63ef
authored
Aug 31, 2021
by
zhaoxuanchao
Browse files
Update .gitlab-ci.yml
parent
7767d210
Pipeline
#2972
failed with stages
in 2 minutes and 18 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
23 deletions
+25
-23
.gitlab-ci.yml
.gitlab-ci.yml
+25
-23
No files found.
.gitlab-ci.yml
View file @
2f9c63ef
# 设置执行镜像
image
:
node
12
# 整个pipeline有两个stage
stages
:
stages
:
-
build
-
prepare
-
test
-
test
-
build
# 定义全局缓存,缓存的key来自分支信息,缓存位置是vendor文件夹
cache
:
cache
:
key
:
${CI_COMMIT_REF_SLUG}
key
:
${CI_COMMIT_SHA}_node_modules
untracked
:
true
paths
:
paths
:
-
vendor/
-
node_modules/
policy
:
pull-push
before_script
:
-
echo "Before script section"
after_script
:
install_dependences
:
-
echo "After script section"
image
:
node:12
stage
:
prepare
script
:
yarn install
build
1
:
.
build
_job
:
stage
:
build
stage
:
build
image
:
node:12
script
:
script
:
-
echo "将内容写入缓存"
-
echo "build"
-
echo "build" > vendor/hello.txt
-
yarn build
artifacts
:
test1
:
paths
:
stage
:
test
-
build/
script
:
untracked
:
false
-
echo "从缓存读取内容"
expire_in
:
30 days
-
cat vendor/hello.txt
build_1
:
extends
:
.build_job
build_2
:
extends
:
.build_job
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