-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy
executable file
·27 lines (19 loc) · 912 Bytes
/
deploy
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
#!/bin/bash
source $(dirname "$0")/common
APP_NAME=${GITHUB_REPOSITORY#*/}
log "Configuring kubectl to target deployment server and namespace..."
kubectl config set-cluster deploy-cluster --server $SERVER
kubectl config set clusters.deploy-cluster.certificate-authority-data $CA_DATA
kubectl config set-credentials deploy-user --token $SERVICE_ACCOUNT_TOKEN
kubectl config set-context deploy-context --cluster=deploy-cluster --user=deploy-user --namespace=$APP_NAME
kubectl config use-context deploy-context
cp -rn $(dirname "$0")/templates chart
log "Running helm lint..."
helm lint --strict chart \
--set image.repoDigest=$REPO_DIGEST
log "Deploying $APP_NAME..."
helm upgrade $APP_NAME chart --install --cleanup-on-fail \
--set image.repoDigest=$REPO_DIGEST
log "Waiting for deployment rollout..."
kubectl rollout status deployment/$APP_NAME --timeout=3m
log "Successfully deployed $APP_NAME."