forked from oliver006/drone-gcf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
113 lines (98 loc) · 2.22 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
kind: pipeline
name: default
workspace:
base: /go
path: src/github.com/oliver006/drone-gcf
steps:
- name: test
image: "golang:1.16"
environment:
COVERALLS_TOKEN:
from_secret: coveralls-token
commands:
- "make drone-tests"
- name: lint
image: golangci/golangci-lint:latest-alpine
pull: always
commands:
- apk add --update make
- make lint
when:
event:
- pull_request
- push
- tag
- name: build-and-publish-master
image: plugins/docker
settings:
tags: master
dockerfile: ./Dockerfile
repo: oliver006/drone-gcf
target: release
debug: true
build_args:
- 'TAG=master'
- 'SHA1=${DRONE_COMMIT_SHA}'
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
branch:
- master
event:
- push
- name: sleep-10s
image: "golang:1.16"
commands:
- sleep 10
when:
branch:
- master
event:
- push
- name: deploy-cloud-function-master
image: "oliver006/drone-gcf:master"
pull: true
settings:
env_secret_api_key:
from_secret: env_secret_api_key
action: deploy
verbose: true
token:
from_secret: token
functions:
- TestDeployment:
- trigger: http
memory: 128MB
runtime: go113
source: ./test-function/
environment:
- REGULAR_ENV_VAR: env_var_123
BUILD_HASH: "${DRONE_COMMIT_SHA}"
ENV_VAR_WITH_SPACE: "oh noes"
ENV_VAR_WITH_QUOTES: 'oh " my'
ENV_VAR_WITH_COMMA: 'oh , well'
when:
branch:
- master
event:
- push
- name: build-and-publish-tagged
image: plugins/docker
settings:
tags: "latest,${DRONE_TAG}"
dockerfile: ./Dockerfile
repo: oliver006/drone-gcf
target: release
debug: true
build_args:
- 'TAG=${DRONE_TAG}'
- 'SHA1=${DRONE_COMMIT_SHA}'
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event:
- tag