Commit 2f9c63ef authored by zhaoxuanchao's avatar zhaoxuanchao
Browse files

Update .gitlab-ci.yml

parent 7767d210
Pipeline #2972 failed with stages
in 2 minutes and 18 seconds
# 设置执行镜像
image: node 12
# 整个pipeline有两个stage
stages:
- build
- test
- prepare
- test
- build
# 定义全局缓存,缓存的key来自分支信息,缓存位置是vendor文件夹
cache:
key: ${CI_COMMIT_REF_SLUG}
key: ${CI_COMMIT_SHA}_node_modules
untracked: true
paths:
- vendor/
before_script:
- echo "Before script section"
- node_modules/
policy: pull-push
after_script:
- echo "After script section"
install_dependences:
image: node:12
stage: prepare
script: yarn install
build1:
.build_job:
stage: build
image: node:12
script:
- echo "将内容写入缓存"
- echo "build" > vendor/hello.txt
test1:
stage: test
script:
- echo "从缓存读取内容"
- cat vendor/hello.txt
- echo "build"
- yarn build
artifacts:
paths:
- build/
untracked: false
expire_in: 30 days
build_1:
extends: .build_job
build_2:
extends: .build_job
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment