-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
127 lines (125 loc) · 3.53 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
kind: pipeline
type: kubernetes
name: default
workspace:
path: /drone/src
steps:
- name: build-cache
image: node:lts-alpine
commands:
- "yarn install -W"
when:
branch:
- master
event:
- push
- name: lint-website
image: node:lts-alpine
commands:
- "yarn lint:website"
when:
branch:
- master
event:
- push
depends_on:
- build-cache
- name: lint-server
image: node:lts-alpine
commands:
- "yarn lint:server"
when:
branch:
- master
event:
- push
depends_on:
- build-cache
- name: build-website
image: node:lts-alpine
commands:
- "APPLICATION_NAME=Devpunk API_SERVER_URL=https://www.devpunk.io NODE_ENV=production yarn workspace @devpunk/website build"
when:
branch:
- master
event:
- push
depends_on:
- lint-website
- lint-server
- name: build-server
image: node:lts-alpine
commands:
- "yarn workspace @devpunk/server build"
when:
branch:
- master
event:
- push
depends_on:
- lint-website
- lint-server
- name: build-image
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: reezpatel/devpunk
tags:
- latest
- ${DRONE_COMMIT:0:8}
when:
branch:
- master
event:
- push
depends_on:
- build-server
- build-website
- name: deploy
image: alpine/helm:3.2.1
environment:
KUBECONFIG_FILE:
from_secret: KUBECONFIG
MONGODB_PASSWORD:
from_secret: MONGODB_PASSWORD
MONGODB_USERNAME:
from_secret: MONGODB_USERNAME
MONGODB_HOST:
from_secret: MONGODB_HOST
GITHUB_LOGIN_CLIENT_ID:
from_secret: GITHUB_LOGIN_CLIENT_ID
GITHUB_LOGIN_CLIENT_SECRET:
from_secret: GITHUB_LOGIN_CLIENT_SECRET
REDIS_HOST:
from_secret: REDIS_HOST
ADMIN_USER:
from_secret: ADMIN_USER
INGESTION_KEY:
from_secret: INGESTION_KEY
AWS_ACCESS_KEY_ID:
from_secret: AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: AWS_SECRET_ACCESS_KEY
S3_BUCKET_REGION:
from_secret: S3_BUCKET_REGION
S3_BUCKET_NAME:
from_secret: S3_BUCKET_NAME
commands:
- echo "$KUBECONFIG_FILE" > kubeconfig.b64
- export KUBECONFIG="$PWD/kubeconfig.yml"
- base64 -d kubeconfig.b64 > kubeconfig.yml
- helm repo add mychart https://reezpatel.github.io/helm_charts
- echo "$KUBECONFIG_FILE"
- helm repo update
- helm search repo dev
- helm upgrade --install devpunk mychart/devpunk -n devpunk -f helm.values.yml --set-string image.tag="${DRONE_COMMIT:0:8}" --set-string env.MONGODB_PASSWORD="$MONGODB_PASSWORD" --set-string env.MONGODB_USERNAME="$MONGODB_USERNAME" --set-string env.MONGODB_HOST="$MONGODB_HOST" --set-string env.GITHUB_LOGIN_CLIENT_ID="$GITHUB_LOGIN_CLIENT_ID" --set-string env.GITHUB_LOGIN_CLIENT_SECRET="$GITHUB_LOGIN_CLIENT_SECRET" --set-string env.ADMIN_USER="$ADMIN_USER" --set-string env.REDIS_HOST="$REDIS_HOST" --set-string env.INGESTION_KEY="$INGESTION_KEY" --set-string env.AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" --set-string env.AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" --set-string env.S3_BUCKET_REGION="$S3_BUCKET_REGION" --set-string env.S3_BUCKET_NAME="$S3_BUCKET_NAME"
when:
event:
- promote
target:
- production
depends_on:
- build-image