-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
140 lines (121 loc) · 3.29 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
kind: pipeline
type: docker
name: ci
platform:
os: linux
arch: amd64
common_cache_settings: &common_cache_settings
bucket: dvla-drone1-cache-714782054810
region: eu-west-2
encryption: AES256
endpoint: https://s3.eu-west-2.amazonaws.com
restore_cache: &restore_cache
restore: true
rebuild_cache: &rebuild_cache
rebuild: true
npm_cache_settings: &npm_cache_settings
cache_key: '{{ checksum "package-lock.json" }}'
mount:
- 'node_modules'
steps:
- name: secret scan
pull: if-not-exists
image: ecr.tooling.dvla.gov.uk/utilities-ci-tools/ci-secret-scan
- name: pull npm cache
image: ecr.tooling.dvla.gov.uk/ce/drone-cache
depends_on: ["secret scan"]
settings:
<<: [*common_cache_settings, *npm_cache_settings, *restore_cache]
- name: install
pull: if-not-exists
image: &base--image ecr.tooling.dvla.gov.uk/base-images/serverless:20.0.0-npm10
environment:
NPM_CONFIG_REGISTRY: https://npm.tooling.dvla.gov.uk/npm/npm-group/
commands:
- node -v
- npm ci
- name: push npm cache
image: ecr.tooling.dvla.gov.uk/ce/drone-cache
depends_on: ['install']
settings:
<<: [*common_cache_settings, *npm_cache_settings, *rebuild_cache]
- name: audit
pull: if-not-exists
image: *base--image
failure: ignore
commands:
- npm run audit
depends_on:
- install
- name: build
pull: if-not-exists
image: *base--image
commands:
- npm run build
depends_on:
- install
- name: lint
pull: if-not-exists
image: *base--image
commands:
- npm run lint --workspaces
depends_on:
- build
- name: outdated
pull: if-not-exists
image: *base--image
failure: ignore
commands:
- npm run outdatedRoot
- npm run outdated
depends_on:
- install
- name: test
pull: if-not-exists
image: *base--image
commands:
- npm run test
depends_on:
- build
- name: Cloudformation Analysis
pull: if-not-exists
image: ecr.tooling.dvla.gov.uk/utilities-ci-tools/ci-verify-cloudformation
failure: ignore
depends_on:
- test
settings:
template_dir: ./packages/lab-common-cdk/coverage/templates
- name: sonar scan
depends_on: ['Cloudformation Analysis', 'test']
image: 448934085854.dkr.ecr.eu-west-2.amazonaws.com/utilities-ci-tools/ci-drone-sonar-scanner
- name: publish
image: *base--image
environment: &env-npm-dvla
NPM_CONFIG_REGISTRY: https://npm.tooling.dvla.gov.uk/npm/npm-group
commands:
- aws codeartifact login --tool npm --repository npm-private --domain tooling --domain-owner 448934085854 --region eu-west-2
- npm run release
- npm run publish
depends_on:
- test
when:
branch: [main]
- name: teams notify success
image: ecr.tooling.dvla.gov.uk/utilities-ci-tools/ci-notifier:latest
settings:
webhook:
from_secret: TEAMS_WEBHOOK # pragma: allowlist secret
depends_on: ['publish']
when:
branch: [main]
status:
- success
- name: teams notify failure
image: ecr.tooling.dvla.gov.uk/utilities-ci-tools/ci-notifier:latest
settings:
webhook:
from_secret: TEAMS_WEBHOOK # pragma: allowlist secret
depends_on: ['test']
when:
status:
- failure