-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
75 lines (67 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
66
67
68
69
70
71
72
73
74
75
kind: pipeline
type: docker
name: npm-publish
trigger:
event:
- tag
volumes:
- name: docker
host:
path: /var/run/docker.sock
- name: npm-cache
host:
path: /root/.npm
- name: cache-build
host:
path: /drone/src/build
npm-env: &npm-env
image: node:16.13.2
volumes:
- name: npm-cache
path: /root/.npm
- name: cache-build
path: /drone/src/build
# Добавить из vault креды на nexus из http://vault.um.internal:8200/ui/vault/secrets/infra/show/devops/nexus
steps:
- name: install
<<: *npm-env
environment:
NPM_USER_KE:
from_secret: nexus_npm_ke_reader_username
NPM_PASS_KE:
from_secret: nexus_npm_ke_reader_password
NPM_NEXUS_ENDPOINT_KE:
from_secret: nexus_npm_ke_reader_endpoint
NPM_EMAIL_KE:
from_secret: nexus_npm_ke_reader_email
commands:
- npx npm-cli-login -u $NPM_USER_KE -p $NPM_PASS_KE -e $NPM_EMAIL_KE -r $NPM_NEXUS_ENDPOINT_KE
- npm install
- name: build
<<: *npm-env
commands:
- npm ci
- npm run build-bundle
- name: publish
<<: *npm-env
environment:
NPM_USER:
from_secret: nexus_npm_ke_writer_username
NPM_PASS:
from_secret: nexus_npm_ke_writer_password
NPM_EMAIL:
from_secret: nexus_npm_ke_writer_email
NPM_NEXUS_ENDPOINT:
from_secret: nexus_npm_ke_writer_endpoint
commands:
- npx npm-cli-login -u $NPM_USER -p $NPM_PASS -e $NPM_EMAIL -r $NPM_NEXUS_ENDPOINT
- echo "$DRONE_TAG"
- |
if echo "$DRONE_TAG" | grep -vq "develop"; then
npm publish --@market-tech:registry=$NPM_NEXUS_ENDPOINT/
else
npm publish --@market-tech:registry=$NPM_NEXUS_ENDPOINT/ --tag beta
fi
when:
event:
- tag