-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone.yml
75 lines (68 loc) · 1.36 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: work
platform:
os: linux
arch: amd64
node:
os: linux
class: standard
trigger:
paths:
exclude:
- README.md
- "terraform/**"
- ".github/*"
- .gitignore
- .gitattributes
- LICENSE.txt
event:
- push
branch:
- main
steps:
- name: build
image: golang:1.16-stretch
pull: if-not-present
commands:
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o main ./
when:
event:
- push
branch:
- main
- name: publish
pull: always
image: public.ecr.aws/s7w0t2z5/docker:latest
commands:
- zip latest.zip main
- zip ${DRONE_COMMIT_SHA:0:7}.zip main
- aws s3 cp --acl public-read latest.zip s3://$BUCKET/$PROJECT_KEY/
- aws s3 cp --acl public-read ${DRONE_COMMIT_SHA:0:7}.zip s3://$BUCKET/$PROJECT_KEY/
environment:
AWS_DEFAULT_REGION: us-west-2
BUCKET: aai-oss
PROJECT_KEY: drone-queue-cloudwatch
when:
event:
- push
branch:
- main
- name: deploy
pull: if-not-present
image: public.ecr.aws/s7w0t2z5/docker:latest
commands:
# Better safe than debugging permission denied errors
- chmod +x deploy/lambda.sh
- deploy/lambda.sh
environment:
AWS_DEFAULT_REGION: us-west-2
BUCKET: aai-oss
PROJECT_KEY: drone-queue-cloudwatch
FUNCTION_NAME: drone-queue-cloudwatch
when:
event:
- push
branch:
- main