2019-11-10 09:25:01 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
|
|
|
clone:
|
|
|
|
depth: 1
|
|
|
|
|
|
|
|
steps:
|
2019-11-10 10:41:35 +00:00
|
|
|
- name: restore-cache
|
|
|
|
image: drillster/drone-volume-cache
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
path: /cache
|
|
|
|
settings:
|
|
|
|
restore: true
|
|
|
|
mount:
|
|
|
|
- ./node_modules
|
|
|
|
|
2019-11-10 09:25:01 +00:00
|
|
|
- name: installDependencies
|
|
|
|
image: node:lts
|
|
|
|
commands:
|
2019-11-10 10:41:35 +00:00
|
|
|
- npm config set registry http://registry.npm.taobao.org --global
|
2019-11-10 09:25:01 +00:00
|
|
|
- npm install
|
|
|
|
|
|
|
|
- name: build
|
|
|
|
image: node:lts
|
|
|
|
commands:
|
|
|
|
- npm run build
|
|
|
|
- tar -czf dist.tar.gz ./dist/*
|
|
|
|
|
|
|
|
- name: release
|
|
|
|
image: plugins/gitea-release
|
|
|
|
settings:
|
|
|
|
base_url: https://git.ixarea.com
|
|
|
|
files:
|
|
|
|
- dist.tar.gz
|
|
|
|
api_key:
|
|
|
|
from_secret: gitea_token
|
|
|
|
checksum:
|
|
|
|
- sha256
|
|
|
|
when:
|
|
|
|
event: [tag]
|
2019-11-10 10:41:35 +00:00
|
|
|
|
|
|
|
- name: deploy
|
|
|
|
image: plugins/s3
|
|
|
|
settings:
|
|
|
|
bucket: unlock-music
|
|
|
|
access_key:
|
|
|
|
from_secret: aws_access_key_id
|
|
|
|
secret_key:
|
|
|
|
from_secret: aws_secret_access_key
|
|
|
|
source: dist/**/*
|
|
|
|
target: /
|
|
|
|
path_style: true
|
|
|
|
endpoint: https://fs.sz2.ixarea.com
|
|
|
|
|
|
|
|
- name: rebuild-cache
|
|
|
|
image: drillster/drone-volume-cache
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
path: /cache
|
|
|
|
settings:
|
|
|
|
rebuild: true
|
|
|
|
mount:
|
|
|
|
- ./node_modules
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
host:
|
|
|
|
path: /tmp/cache
|