-
Notifications
You must be signed in to change notification settings - Fork 11
/
.drone.yml
107 lines (102 loc) · 2.62 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
kind: pipeline
name: default
image_pull_secrets:
- image-registry-secret
platform:
os: linux
arch: amd64
steps:
- name: build
image: golang:1.21.6-bullseye
environment:
SSH_KEY:
from_secret: ssh_key_github
commands:
- apt update
- apt install -y git openssh-client build-essential
- mkdir /root/.ssh
- echo -n "$SSH_KEY" > /root/.ssh/id_rsa
- chmod 600 /root/.ssh/id_rsa
- touch /root/.ssh/known_hosts
- chmod 600 /root/.ssh/known_hosts
- ssh-keyscan -H github.com >> /root/.ssh/known_hosts 2> /dev/null
- touch /root/.gitconfig
- echo '[url "ssh://git@github.com/"]' >> /root/.gitconfig
- echo ' insteadOf = https://github.com/' >> /root/.gitconfig
- go env -w CGO_ENABLED=0 GOPRIVATE=github.com/everFinance/*
- go env
- go mod tidy
- cd cmd
- go build -o arseeding
depends_on:
- clone
- name: publish-dev-arseeding
image: plugins/docker
daemon_off: true
privileged: true
settings:
username:
from_secret: docker_dev_username
password:
from_secret: docker_dev_password
registry:
from_secret: docker_dev_registry
repo:
from_secret: docker_dev_repo
build_args:
- MILLET_BUILD_ARG=dev
tags:
- ${DRONE_COMMIT_SHA}
- ${DRONE_COMMIT_BRANCH/\//-}
- dev
dockerfile: Dockerfile
depends_on:
- build
when:
branch: [ feature/*,fix/*,develop ]
- name: deploy-dev-arseeding
image: quay.io/honestbee/drone-kubernetes
daemon_off: true
privileged: true
settings:
kubernetes_server:
from_secret: kube_dev_api
kubernetes_token:
from_secret: kube_dev_token
kubernetes_cert:
from_secret: kube_dev_cert
repo:
from_secret: docker_dev_repo
namespace: biz
deployment: arseeding-dev
container: server
tag: ${DRONE_COMMIT_SHA}
depends_on:
- publish-dev-arseeding
when:
branch: [ feature/*,fix/*,develop ]
- name: publish-prod-arseeding
image: plugins/docker
daemon_off: true
privileged: true
settings:
username:
from_secret: docker_production_username
password:
from_secret: docker_production_password
registry:
from_secret: docker_production_registry
repo:
from_secret: docker_production_repo
build_args:
- MILLET_BUILD_ARG=prod
tags:
- main
- ${DRONE_TAG=latest}
- ${DRONE_COMMIT_SHA}
dockerfile: Dockerfile
depends_on:
- build
when:
event:
- tag