forked from MaciejGruszka/jscreditscore
-
Notifications
You must be signed in to change notification settings - Fork 21
/
wercker.yml
85 lines (76 loc) · 2.87 KB
/
wercker.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
box: node:6.10
build:
steps:
# Run 'npm install'
- script:
name: A step that executes `npm install` command
code: npm install
push-image-to-wcr:
steps:
# Push docker image to your docker container registry repo i.e. wercker container releases (wcr or just CR)
- internal/docker-push:
repository: wcr.io/$WERCKER_APPLICATION_OWNER_NAME/$WERCKER_APPLICATION_NAME
tag: $WERCKER_GIT_BRANCH-$WERCKER_GIT_COMMIT
cmd: node /pipeline/source/app.js
deploy-app-to-oce:
steps:
- bash-template
- script:
name: Install istioctl
code: |
pwd
echo "Installing istioctl"
curl -L --compressed https://github.com/istio/istio/releases/download/0.2.7/istio-0.2.7-linux.tar.gz | tar -xz -C $PWD && export PATH=${PWD}/istio-0.2.7/bin:$PATH
pwd
- script:
name: Check istioctl version
code: |
echo "Checking istioctl version"
istioctl version
# Wercker kubectl step currently doesn't support embedded istioctl commands like manual side car injection
# Hence as a *workaround*, in this step we generate and save your kubeconfig for embedded istioctl to work
- script:
name: generate and save kubeconfig
code: |
mkdir -p /root/.kube
echo "
apiVersion: v1
clusters:
- cluster:
insecure-skip-tls-verify: true
server: ${KUBERNETES_MASTER}
name: cluster-${KUBERNETES_CLUSTER_ID}
contexts:
- context:
cluster: cluster-${KUBERNETES_CLUSTER_ID}
user: user-${KUBERNETES_CLUSTER_ID}
name: context-${KUBERNETES_CLUSTER_ID}
current-context: context-${KUBERNETES_CLUSTER_ID}
kind: ""
users:
- name: user-${KUBERNETES_CLUSTER_ID}
user:
token: ${KUBERNETES_TOKEN}
" > /root/.kube/config
- script:
name: "Visualise Kubernetes deployment"
code: cat kubernetes-deployment.yml
- kubectl:
name: delete wcr secret
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: delete secret wrelease --ignore-not-found
- kubectl:
name: create wcr secret
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: create secret docker-registry wrelease --docker-server=wcr.io --docker-username=$WERCKER_APPLICATION_OWNER_NAME --docker-password=$KUBERNETES_TOKEN --docker-email=$DOCKER_EMAIL
# Deploy the app with istio side car injection (manual)
- kubectl:
name: create deplyoment
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: apply -f <(istioctl kube-inject -f kubernetes-deployment.yml)