This repository was archived by the owner on Nov 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcircle.yml
More file actions
55 lines (51 loc) · 2.79 KB
/
Copy pathcircle.yml
File metadata and controls
55 lines (51 loc) · 2.79 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
49
50
51
52
53
54
55
machine:
environment:
PATH: $PATH:/home/bin
python:
version: 2.7.3
services:
- docker
node:
version: 9.0
dependencies:
pre:
- mkdir -p ~/docker
- ./scripts/circle_install_dependencies.sh
- if [[ -e ~/docker/image.tar ]]; then docker load -i ~/docker/image.tar; fi
- docker build -t $EXTERNAL_REGISTRY_ENDPOINT/bitunnel-jobq-handler:build-$CIRCLE_BUILD_NUM .
- docker save $EXTERNAL_REGISTRY_ENDPOINT/bitunnel-jobq-handler:build-$CIRCLE_BUILD_NUM > ~/docker/image.tar
test:
override:
- echo "Todo be added "
deployment:
develop:
branch: develop
commands:
# Using docker hub...
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push $EXTERNAL_REGISTRY_ENDPOINT/bitunnel-jobq-handler > /dev/null
# KUBERNETES INIT begins
- kubectl config set-credentials aws_kubernetes --username=$BITUNNEL_KUBERNETES_API_USER --password=$BITUNNEL_KUBERNETES_API_PASS
- kubectl config set-cluster aws_kubernetes --insecure-skip-tls-verify=true --server=https://$BITUNNEL_KUBERNETES_API_HOST
- kubectl config set-context aws_kubernetes --user=aws_kubernetes --namespace=default --cluster=aws_kubernetes
- kubectl config use-context aws_kubernetes
# KUBERNETES INIT ends
- awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",ENVIRON[var])}}1' < deploy/bitunnel-jobq-handler-rc.yaml > deploy/bitunnel-jobq-handler-rc.local.yaml
- cat deploy/bitunnel-jobq-handler-rc.local.yaml
# kubectl rolling-update $(kubectl get rc | grep bitunnel-jobq-handler | awk '{print $1}') -f deploy/bitunnel-jobq-handler-rc.local.yaml
- kubectl deploy -f deploy/bitunnel-jobq-handler-rc.local.yaml
prod:
branch: master
commands:
# Using docker hub...
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push $EXTERNAL_REGISTRY_ENDPOINT/bitunnel-jobq-handler > /dev/null
# KUBERNETES INIT begins
- kubectl config set-credentials aws_kubernetes-prod --username=$BITUNNEL_KUBERNETES_PROD_API_USER --password=$BITUNNEL_KUBERNETES_PROD_API_PASS
- kubectl config set-cluster aws_kubernetes-prod --insecure-skip-tls-verify=true --server=https://$BITUNNEL_KUBERNETES_PROD_API_HOST
- kubectl config set-context aws_kubernetes-prod --user=aws_kubernetes-prod --namespace=default --cluster=aws_kubernetes-prod
- kubectl config use-context aws_kubernetes-prod
# KUBERNETES INIT ends
- awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",ENVIRON[var])}}1' < deploy/bitunnel-jobq-handler-rc-prod.yaml > deploy/bitunnel-jobq-handler-rc.local.yaml
- cat deploy/bitunnel-jobq-handler-rc.local.yaml
- kubectl rolling-update $(kubectl get rc | grep bitunnel-jobq-handler | awk '{print $1}') -f deploy/bitunnel-jobq-handler-rc.local.yaml