This repository has been archived by the owner on Jun 27, 2024. It is now read-only.
forked from doitintl/gtoken
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone.yml
97 lines (92 loc) · 2.34 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
kind: pipeline
name: test
workspace:
base: /go
path: src/github.com/shipt/${DRONE_REPO_NAME}
trigger:
event:
- push
- tag
steps:
- name: lint gtoken
image: golang:1.16
commands:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCI_LINT_VERSION
- cd cmd/gtoken
- go build ./...
- golangci-lint run
- name: lint gtoken-webhook
image: golang:1.16
commands:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCI_LINT_VERSION
- cd cmd/gtoken-webhook
- go build ./...
- golangci-lint run
- name: test gtoken
image: golang:1.16
commands:
- cd cmd/gtoken
- go test --race -v ./...
- name: test gtoken-webhook
image: golang:1.16
commands:
- cd cmd/gtoken-webhook
- go test --race -v ./...
- name: docker-beta-push gtoken
image: plugins/docker
environment:
GITHUB_TOKEN:
from_secret: github_token
settings:
context: cmd/gtoken
dockerfile: cmd/gtoken/Dockerfile
repo: harbor.shipttech.com/production/${DRONE_REPO_NAME}
tags:
- beta
- ${DRONE_COMMIT_SHA}
build_args_from_env:
- GITHUB_TOKEN
when:
branch:
- master
event:
include:
- push
- name: docker-prod-push gtoken
image: plugins/docker
environment:
GITHUB_TOKEN:
from_secret: github_token
settings:
context: cmd/gtoken
dockerfile: cmd/gtoken/Dockerfile
repo: harbor.shipttech.com/production/${DRONE_REPO_NAME}
tags:
- latest
- ${DRONE_TAG}
- ${DRONE_COMMIT_SHA}
build_args_from_env:
- GITHUB_TOKEN
when:
event:
include:
- tag
- name: docker-prod-push gtoken-webhook
image: plugins/docker
environment:
GITHUB_TOKEN:
from_secret: github_token
settings:
context: cmd/gtoken-webhook
dockerfile: cmd/gtoken-webhook/Dockerfile
repo: harbor.shipttech.com/production/${DRONE_REPO_NAME}-webhook
tags:
- latest
- ${DRONE_TAG}
- ${DRONE_COMMIT_SHA}
build_args_from_env:
- GITHUB_TOKEN
when:
event:
include:
- tag