-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
65 lines (60 loc) · 1.79 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
pipeline:
install:
image: node:9.9.0
commands:
- eval "$(ssh-agent -s)"
- mkdir -p /root/.ssh
- echo "$${SSH_KEY}\n" > /root/.ssh/id_rsa
- echo "$${SSH_PUBLIC_KEY}\n" > /root/.ssh/id_rsa.pub
- ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
- chmod 600 /root/.ssh/id_rsa*
- ssh-add -k /root/.ssh/id_rsa
- npm install npm-login-cmd -g
- npm config set registry https://npm-proxy.fury.io/$${NPM_TOKEN}/buildlyio/
- npm config set always-auth
- npx npm-login-cmd
- npm install
secrets: [NPM_USER, NPM_PASS, NPM_EMAIL, NPM_TOKEN, SSH_KEY, SSH_PUBLIC_KEY]
when:
event: [push, tag]
build:
image: node:9.9.0
commands:
- npm run build --prod
when:
event: [push, tag]
status: [success]
test:
image: index.docker.io/buildly/docker-nodejs-and-chrome:0.0.1-8.12.0-latest
commands:
- npm run test
when:
event: [push, tag]
status: [success]
publish:
image: node:9.9.0
commands:
- eval "$(ssh-agent -s)"
- mkdir -p /root/.ssh
- echo "$${SSH_KEY}\n" > /root/.ssh/id_rsa
- echo "$${SSH_PUBLIC_KEY}\n" > /root/.ssh/id_rsa.pub
- ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
- chmod 600 /root/.ssh/id_rsa*
- ssh-add -k /root/.ssh/id_rsa
- npm install npm-login-cmd -g
- npm config set registry https://npm-proxy.fury.io/$${NPM_TOKEN}/buildlyio/
- npm config set always-auth
- npx npm-login-cmd
- npm run build
- npm publish
secrets: [NPM_USER, NPM_PASS, NPM_EMAIL, NPM_TOKEN, SSH_KEY, SSH_PUBLIC_KEY]
when:
event: [tag]
notify:
image: plugins/slack
channel: drone-ci
username: Drone-CI
secrets: [SLACK_WEBHOOK]
when:
status: [failure]