-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
82 lines (80 loc) · 2.57 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
kind: pipeline
type: docker
name: E4E
globals:
- &docker_creds
username:
from_secret: docker_username
password:
from_secret: docker_password
- &env
AUTH0_SECRET: secret
AUTH0_ISSUER_BASE_URL: url
AUTH0_CLIENT_ID: client_id
AUTH0_CLIENT_SECRET: client_secret
AUTH0_AUDIENCE: https://api.polyglot-edu.com
AUTH0_SCOPE: 'openid profile email read:products'
DEPLOY_URL: ${DRONE_BRANCH}-e4e.polyglot-edu.com
CONCEPT_URL: https://concept.polyglot-edu.com
POLYGLOT_URL: https://polyglot-api.polyglot-edu.com
BACK_URL: http://localhost:5000
- &condition
event:
- push
steps:
- name: Build and push image to Docker # building the encore docker image
image: plugins/docker
settings:
repo: docker.polyglot-edu.com/encore-oer/e4e # must be lowercase
registry: docker.polyglot-edu.com
dockerfile: ./Dockerfile
tags: ['${DRONE_BRANCH}']
build_args:
- 'CONCEPT_URL=https://concept.polyglot-edu.com'
- 'POLYGLOT_URL=https://polyglot-api.polyglot-edu.com'
- 'POLYGLOT_DASHBOARD=https://staging.polyglot-edu.com/'
- 'DEPLOY_URL=${DRONE_BRANCH}-e4e.polyglot-edu.com'
<<: *docker_creds
when:
<<: *condition
- name: Deploy # deploy to kubernetes using a Helm chart
image: pelotech/drone-helm3
environment:
CFORIGIN:
from_secret: cf_origin
DOCKERCONFIG:
from_secret: dockerconfigjson
<<: *env
settings:
mode: upgrade
chart: ./charts
release: e4e-${DRONE_BRANCH}
namespace: e4e-${DRONE_BRANCH}
debug: true
kube_service_account: admin-user
kube_api_server: 'https://131.114.23.149:6443'
kube_token:
from_secret: kube_token
values:
- 'url=${DRONE_BRANCH}-e4e.polyglot-edu.com'
- 'cfOriginKey=$CFORIGIN'
- 'dockerconfigjson=$DOCKERCONFIG'
- 'image.repository=docker.polyglot-edu.com/encore-oer/e4e'
- 'image.tag=${DRONE_BRANCH}'
- 'env.authSecret=$AUTH0_SECRET'
- 'env.authIssuerUrl=$AUTH0_ISSUER_BASE_URL'
- 'env.authClientId=$AUTH0_CLIENT_ID'
- 'env.authClientSecret=$AUTH0_CLIENT_SECRET'
- 'env.authAudience=$AUTH0_AUDIENCE'
- 'env.authScope=$AUTH0_SCOPE'
- 'env.backUrl=$BACK_URL'
- 'env.polyglotUrl=$POLYGLOT_URL'
- 'env.polyglotDashboard=https://polyglot-edu.com'
cleanup_failed_upgrade: true
force_upgrade: true
skip_tls_verify: true
create_namespace: true
depends_on:
- Build and push image to Docker
when:
<<: *condition