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: 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
build1: .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
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