-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
54 lines (51 loc) · 1.82 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
---
kind: pipeline
type: kubernetes
name: default
steps:
- name: build-go
image: golang:1.19.3
commands:
- export CGO_ENABLED="0"
- export GOFLAGS="-mod=vendor -buildvcs=true"
- go build ./...
- wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.50.1
- go test ./...
- ./bin/golangci-lint run ./...
- go build -o observer github.com/fnt-eve/zobserver/cmd/observer
- name: build-docker
image: gcr.io/kaniko-project/executor:debug
environment:
DOCKER_SECRET:
from_secret: kaniko_harbor_secret
commands:
- export SANITIZED_DRONE_COMMIT_BRANCH=$(echo ${DRONE_COMMIT_BRANCH} | sed 's#/#-#g')
- export COMMIT_SHA=${DRONE_COMMIT_SHA:0:7}
- mkdir -p /kaniko/.docker/
- echo "$${DOCKER_SECRET}" > /kaniko/.docker/config.json
- |
container=kube /kaniko/executor \
--context . \
--dockerfile ./Dockerfile \
--destination harbor.greg2010.me/fnt-eve/zobserver:$SANITIZED_DRONE_COMMIT_BRANCH\_$COMMIT_SHA \
--destination harbor.greg2010.me/fnt-eve/zobserver:$SANITIZED_DRONE_COMMIT_BRANCH\_latest \
--destination harbor.greg2010.me/fnt-eve/zobserver:latest
- name: discord notification
image: appleboy/drone-discord
settings:
username: "Drone CI"
avatar_url: https://miro.medium.com/max/256/0*AqO_2lNemh_Fl9Gm.png
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
message: >
{{#success build.status}}
{{repo.namespace}}/{{repo.name}}: build #{{build.number}} {{commit.branch}}_{{truncate commit.sha 7}} succeeded. Build took {{since build.started}}.
{{else}}
{{repo.namespace}}/{{repo.name}}: build {{build.number}} failed.
{{/success}}
---
kind: signature
hmac: 6d6e84c9fd4419251211ae1754e6bb8db562a2577d5cf90390b496fca351c363
...