This repository was archived by the owner on Dec 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathdeploy
More file actions
executable file
·48 lines (42 loc) · 1.39 KB
/
Copy pathdeploy
File metadata and controls
executable file
·48 lines (42 loc) · 1.39 KB
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
#!/usr/bin/env bash
set -eu
KUBE_CONFIG=kubectl.config
# This script updates our kubernetes deploymnet from travis
# Install kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
# Generate our kubectl config
cat << EOF > $KUBE_CONFIG
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: $KUBE_CA_DATA
server: $KUBE_SERVER
name: cluster-operationcode
contexts:
- context:
cluster: cluster-operationcode
namespace: operationcode
user: $KUBE_USER
name: operationcode
- context:
cluster: cluster-operationcode
namespace: operationcode-staging
user: $KUBE_USER
name: staging
current-context: operationcode
kind: Config
preferences: {}
users:
- name: $KUBE_USER
user:
client-certificate-data: $KUBE_CLIENT_CERT
client-key-data: $KUBE_CLIENT_KEY
EOF
# Updates the deployment
#
# Container names come from:
# https://github.com/OperationCode/operationcode_infra/blob/master/kubernetes/operationcode_backend/deployment.yml
#
KUBECONFIG=${KUBE_CONFIG} ./kubectl set image deployment/operationcode-backend app=operationcode/operationcode_backend:${TRAVIS_BUILD_NUMBER}
KUBECONFIG=${KUBE_CONFIG} ./kubectl set image deployment/operationcode-backend operationcode-sidekiq=operationcode/operationcode_backend:${TRAVIS_BUILD_NUMBER}