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: cache:
key: ${CI_COMMIT_SHA}_node_modules key: ${CI_COMMIT_REF_SLUG}
untracked: true
paths: paths:
- node_modules/ - vendor/
policy: pull-push
stages: before_script:
- prepare - echo "Before script section"
- build
- deploy
install_dependencies: after_script:
stage: prepare - echo "After script section"
script:
- yarn install
.build_job: build1:
stage: build stage: build
tags:
- k8s
script: script:
- echo "build" - echo "将内容写入缓存"
- yarn build - echo "build" > vendor/hello.txt
build_1:
extends: .build_job
build_2: test1:
extends: .build_job 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