-
Notifications
You must be signed in to change notification settings - Fork 3
/
helmfile.yaml
35 lines (31 loc) · 1.76 KB
/
helmfile.yaml
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
# This file uses some env variables used by CircleCI, to use it locally, look at the misc/localEnvForDeployement.sh file
# When master is deployed, it will be exposed on this domain:
{{ $masterHost := "api.YOUR_DOMAIN.com" }}
# When another branch is deployed, its domain will be host will be this prepended by the branch name:
# If you want subdomain, you can use something like ".dev.your-project.com" and it will generate "develop.dev.your-project.com" for the develop branch
# you can also use something like "-dev.your-project.com" and it will be "develop-dev.your-project.com"
{{ $branchesHost := ".dev.YOUR_DOMAIN.com" }}
{{ $masterReplicaCount := 3 }}
{{ $otherBranchesReplicaCount := 1 }}
# Using CircleCI env variable, change this with the variable you use
{{ $reponame := env "CIRCLE_PROJECT_REPONAME" | default "api-kickstarter" }}
{{ $branch := env "CIRCLE_BRANCH" | default "master" }}
releases:
- name: {{ $reponame }}-{{ $branch }}
namespace: {{ $reponame }}-{{ $branch }}
chart: ./helm
set:
- name: exposing.hosts[0]
value: {{ if eq $branch "master" }} {{ $masterHost }} {{ else }} {{ $branch }}{{ $branchesHost }} {{ end }}
- name: image.repository
value: {{ requiredEnv "CIRCLE_PROJECT_USERNAME" }}/{{ requiredEnv "CIRCLE_PROJECT_REPONAME" }}
- name: image.tag
value: {{ requiredEnv "CIRCLE_SHA1" }}
- name: imageCredentials.registry
value: {{ requiredEnv "DOCKER_REGISTRY" }}
- name: imageCredentials.username
value: {{ requiredEnv "DOCKER_USER" }}
- name: imageCredentials.password
value: {{ requiredEnv "DOCKER_PASSWORD" }}
- name: replicaCount
value: {{ if eq $branch "master" }} {{ $masterReplicaCount }} {{ else }} {{ $otherBranchesReplicaCount }} {{ end }}