This repository has been archived by the owner on Jul 16, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
94 lines (84 loc) · 1.85 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
---
kind: pipeline
type: docker
name: default
steps:
- name: wait for docker
image: docker:20.10.17-dind
volumes:
- name: dockersock
path: /var/run
commands:
- while ! docker ps 2>&1 > /dev/null; do sleep 1; done
- name: lint
image: weastur/metalinter
commands:
- hadolint Dockerfile
- shellcheck *.sh
- yamllint .
- markdownlint *.md
- name: build
image: docker:20.10.17-dind
volumes:
- name: dockersock
path: /var/run
commands:
- date +'%Y%m%d' > current_date
- 'docker build
--pull
--rm
-f "Dockerfile"
-t weastur/metalinter:latest
-t weastur/metalinter:$(cat current_date)
"."'
- name: test
image: docker:20.10.17-dind
volumes:
- name: dockersock
path: /var/run
commands:
- docker run --rm -v "$(pwd)":/app -w /app weastur/metalinter:latest ./test.sh
- name: push
image: docker:20.10.17-dind
volumes:
- name: dockersock
path: /var/run
when:
branch:
- main
event:
- push
environment:
DOCKER_TOKEN:
from_secret: docker_token
commands:
- echo $DOCKER_TOKEN | docker login --username weastur --password-stdin
- docker push weastur/metalinter:latest
- docker push weastur/metalinter:$(cat current_date)
- name: slack
image: plugins/slack
when:
status:
- success
- failure
settings:
webhook:
from_secret: slack_webhook
services:
- name: docker
image: docker:20.10.17-dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
trigger:
event:
- pull_request
- push
---
kind: signature
hmac: 3a8d85fa2a3849552461fcaf75884caa3d0e9839f522ecfee9778b1565839e15
...