Commit c420e815 authored by zhaoxuanchao's avatar zhaoxuanchao
Browse files

Update .gitlab-ci.yml

parent 17cb0d47
Pipeline #2968 canceled with stages
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:
build1:
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
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