-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathwercker.yml
60 lines (51 loc) · 1.69 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
# Use node.js base docker image from DockerHub
box: node
# Build the nodeJS application
build:
steps:
- npm-install
# Push new release to DockerHub
push-to-registry:
steps:
- internal/docker-push:
username: $DOCKER_USERNAME
password: $DOCKER_PASSWORD
tag: $WERCKER_GIT_BRANCH-$WERCKER_GIT_COMMIT
repository: $DOCKER_USERNAME/microcities
ports: "8080"
working-dir: /pipeline/source
cmd: node app.js
# Deploy containerized application to kubernetes cluster
deploy-to-k8s:
box:
id: alpine
cmd: /bin/sh
steps:
- bash-template
- kubectl:
name: create namespace
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: apply -f $WERCKER_ROOT/kubernetes-namespace.yml
- script:
name: wait to create namespace
code: sleep 10
- kubectl:
name: create deplyoment
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: apply -f $WERCKER_ROOT/kubernetes-deployment.yml --namespace=$WERCKER_APPLICATION_OWNER_NAME
- kubectl:
name: create Ingress configuration
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: apply -f $WERCKER_ROOT/ingress.yml --namespace=$WERCKER_APPLICATION_OWNER_NAME
- kubectl:
name: get LoadBalancer public IP address
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: get svc -o jsonpath='{.items[*].status.loadBalancer.ingress[*].ip}' --all-namespaces