-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwercker.yml
More file actions
77 lines (65 loc) · 2.26 KB
/
wercker.yml
File metadata and controls
77 lines (65 loc) · 2.26 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
box: node
build:
steps:
- npm-install
# Test application using Mocha.
test:
steps:
- npm-test
# Push to Docker Hub
push:
steps:
- internal/docker-push:
username: $DOCKER_USERNAME
password: $DOCKER_PASSWORD
tag: $WERCKER_GIT_BRANCH-$WERCKER_GIT_COMMIT
repository: $DOCKER_USERNAME/nodecities
ports: "8080"
working-dir: /pipeline/source
cmd: node app.js
# registry: https://hub.docker.com
deploy-to-k8s:
box:
id: alpine
cmd: /bin/sh
steps:
- bash-template
- script:
name: "Visualise Kubernetes config"
code: cat kubernetes-namespace.yml
- 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 OCR 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=${WERCKER_APPLICATION_OWNER_NAME}@mail.com --namespace=$WERCKER_APPLICATION_OWNER_NAME; echo 'secret step'
- 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
- script:
name: "Visualise Ingress config"
code: cat ingress.yml
- 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