-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone-1.0.yml
96 lines (94 loc) · 2.56 KB
/
.drone-1.0.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
kind: pipeline
name: default
type: kubernetes
steps:
- name: install
image: node:18
environment:
ART_AUTH_TOKEN:
from_secret: art_auth_token
GITHUB_AUTH_TOKEN:
from_secret: github_token
commands:
- npm ci
- name: test
image: node:18
environment:
ART_AUTH_TOKEN:
from_secret: art_auth_token
GITHUB_AUTH_TOKEN:
from_secret: github_token
commands:
- npm test
- name: audit
image: node:18
environment:
ART_AUTH_TOKEN:
from_secret: art_auth_token
GITHUB_AUTH_TOKEN:
from_secret: github_token
commands:
- npm run test:audit
- name: docker build
image: docker:dind
environment:
DOCKER_HOST: tcp://docker:2375
DOCKER_BUILDKIT: 1
ART_AUTH_TOKEN:
from_secret: art_auth_token
GITHUB_AUTH_TOKEN:
from_secret: github_token
commands:
- docker build --secret id=github_token,env=GITHUB_AUTH_TOKEN --secret id=token,env=ART_AUTH_TOKEN -t asl-attachments .
- name: scan-image
pull: Always
image: 340268328991.dkr.ecr.eu-west-2.amazonaws.com/acp/trivy/client:latest
resources:
limits:
cpu: 1000
memory: 1024Mi
environment:
IMAGE_NAME: asl-attachments
ALLOW_CVE_LIST_FILE: cve-exceptions.txt
- name: docker push
image: docker:dind
environment:
DOCKER_HOST: tcp://docker:2375
ART_AUTH_TOKEN:
from_secret: art_auth_token
GITHUB_AUTH_TOKEN:
from_secret: github_token
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- docker login -u="ukhomeofficedigital+asl" -p=$${DOCKER_PASSWORD} quay.io
- docker tag asl-attachments quay.io/ukhomeofficedigital/asl-attachments:$${DRONE_COMMIT_SHA}
- docker push quay.io/ukhomeofficedigital/asl-attachments:$${DRONE_COMMIT_SHA}
when:
event: push
branch: main
- name: update manifest
image: quay.io/ukhomeofficedigital/asl-deploy-bot:latest
environment:
GITHUB_ACCESS_TOKEN:
from_secret: github_access_token
commands:
- update
--repo ukhomeoffice/asl-deployments
--token $${GITHUB_ACCESS_TOKEN}
--file versions.yml
--service asl-attachments
--version $${DRONE_COMMIT_SHA}
when:
event: push
branch: main
services:
- name: docker
image: docker:dind
environment:
DOCKER_TLS_CERTDIR: ""
- name: anchore-submission-server
image: 340268328991.dkr.ecr.eu-west-2.amazonaws.com/acp/anchore-submission:latest
pull: always
commands:
- /run.sh server