test
This commit is contained in:
36
.drone.yml
36
.drone.yml
@ -20,33 +20,18 @@ steps: # 定义管道的执行步骤
|
||||
tags:
|
||||
- latest
|
||||
|
||||
- name: loading cache # 加载缓存
|
||||
pull: if-not-exists # 如果镜像不存在则拉取,免去每次都要重新下载
|
||||
- name: cache # 加载缓存
|
||||
image: drillster/drone-volume-cache
|
||||
restore: true
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /cache
|
||||
settings:
|
||||
restore: true
|
||||
mount:
|
||||
- ./nugetpackages
|
||||
|
||||
- name: loading npm cache
|
||||
image: node
|
||||
volumes:
|
||||
- name: npm-cache
|
||||
path: /drone/src/node_modules
|
||||
commands:
|
||||
- mkdir -p ./node_modules
|
||||
- export NODE_MODULES_PATH=`pwd`/node_modules
|
||||
- npm config set registry https://registry.npm.taobao.org
|
||||
- npm i
|
||||
- echo $NODE_MODULES_PATH
|
||||
- /tmp/npm/cache:/cache
|
||||
mount:
|
||||
- ./node_modules
|
||||
|
||||
- name: build-image
|
||||
pull: if-not-exists # 如果镜像不存在则拉取,免去每次都要重新下载
|
||||
image: plugins/docker
|
||||
depends_on: [loading npm cache]
|
||||
depends_on: [cache]
|
||||
settings:
|
||||
username:
|
||||
from_secret: docker_username
|
||||
@ -91,12 +76,3 @@ steps:
|
||||
- docker run -d -p 16808:8080 --name=mol-robot_${DRONE_BUILD_NUMBER} --env-file /mnt/data/opt/mol-robot/.env git.liliyamol.cn:8081/mol/mol-robot:latest
|
||||
- docker rmi $(docker images | grep "none" | awk '{print $3}')
|
||||
- echo ==-----==部署成功==-----==
|
||||
|
||||
# 挂载本地磁盘路径
|
||||
volumes:
|
||||
- name: cache
|
||||
host:
|
||||
path: /tmp/drone-docker-cache
|
||||
- name: npm-cache
|
||||
host:
|
||||
path: /var/lib/npm/cache
|
Reference in New Issue
Block a user