-
-
Notifications
You must be signed in to change notification settings - Fork 932
/
shipit.yml
46 lines (42 loc) · 1.64 KB
/
shipit.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
machine:
environment:
KUBECONFIG: /home/deploy/.kube/config
dependencies:
override:
- "true"
deploy:
override:
- krane render -f config/deploy/$ENVIRONMENT --bindings=environment=$ENVIRONMENT --current-sha=$REVISION | krane deploy rubygems-$ENVIRONMENT rubygems --stdin -f config/deploy/$ENVIRONMENT/secrets.ejson
rollback:
override:
- krane render -f config/deploy/$ENVIRONMENT --bindings=environment=$ENVIRONMENT --current-sha=$REVISION | krane deploy rubygems-$ENVIRONMENT rubygems --stdin -f config/deploy/$ENVIRONMENT/secrets.ejson
tasks:
restart:
action: Restart application
description: Trigger the restart of both puma and background workers
steps:
- krane restart rubygems-$ENVIRONMENT rubygems
autoscale_web:
action: Autoscale web deployment
description: "Autoscale the web deployment to %{MIN}-%{MAX} replicas"
steps:
- kubectl autoscale -n rubygems-$ENVIRONMENT --context rubygems deployment/web --min="$MIN" --max="$MAX" --cpu-percentage="$CPU_PERCENTAGE"
variables:
- name: MIN
title: The minimum number of web replicas
default: 3
- name: MAX
title: The maximum number of web replicas
default: 10
- name: CPU_PERCENTAGE
title: The threshold of CPU utilization used for autoscaling
default: 75
scale_jobs:
action: Scale jobs deployment
description: "Scale the jobs deployment to %{REPLICAS}"
steps:
- kubectl scale -n rubygems-$ENVIRONMENT --context rubygems deployment/jobs --replicas="$REPLICAS"
variables:
- name: REPLICAS
title: The number of jobs replicas to scale to
default: 5