forked from src-d/gitbase-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
86 lines (71 loc) · 1.84 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
workspace:
base: /go
path: src/github.com/src-d/gitbase-web
branches: [master]
# ANCHORS
build: &build
image: golang:1.10-stretch
commands:
- curl -sL https://deb.nodesource.com/setup_8.x | bash
- apt-get update
- apt-get install -y --no-install-recommends --no-install-suggests nodejs libxml2-dev
- npm install -g yarn
- make dependencies
- PKG_OS=linux DOCKER_OS=linux DOCKER_ARCH=amd64 make packages
debug: true
docker_image: &docker_image
group: docker
image: plugins/docker
registry: docker.io
repo: srcd/gitbase-web
secrets: [ docker_username, docker_password ]
dockerfile: Dockerfile
debug: true
helm_deploy: &helm_deploy
image: quay.io/ipedrazas/drone-helm:master-9b37211
skip_tls_verify: true
helm_repos: srcd-charts=https://src-d.github.io/charts/
chart: srcd-charts/gitbase-web
chart-version: 0.5.0
release: gp
tiller_ns: kube-system
wait: true
# PIPELINE STEPS
pipeline:
clone:
image: plugins/git
debug: true
# deployment to staging environment when master is pushed
build_stg:
<<: *build
when:
branch: [master]
event: [push]
docker_image_stg:
<<: *docker_image
# workaround for bug https://github.com/kubernetes/helm/issues/1707
tag: 'commit-${DRONE_COMMIT_SHA:0:7}'
when:
branch: [master]
event: [push]
helm_deploy_stg:
<<: *helm_deploy
prefix: STG
secrets: [ STG_API_SERVER, STG_KUBERNETES_TOKEN ]
values: gitbaseWeb.image.tag=commit-${DRONE_COMMIT_SHA:0:7}
values_files: [ .helm-defaults.yml, .helm-staging.yml]
when:
branch: [master]
event: [push]
# Push to DockerHub when a new tag is created
build_release:
<<: *build
when:
event: [tag]
docker_image_release:
<<: *docker_image
tags:
- '${DRONE_TAG}'
- 'latest'
when:
event: [tag]