forked from riceo/workshop-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wercker.yml
94 lines (82 loc) · 2.48 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
86
87
88
89
90
91
92
93
94
box: golang:1.11
build:
base-path: /go/src/github.com/mies/workshop-web
steps:
- script:
name: install govendor
code: go get -u github.com/kardianos/govendor
- script:
name: install dependencies
code: govendor sync
- script:
name: go vet
code: govendor vet +local
# - golint:
# exclude: vendor
- script:
name: go test
code: govendor test -v +local
- script:
name: go build
code: |
ls -la
go build
ls -la
push-release:
steps:
- script:
name: prepare
code: |
ls -la /
ls -la
#mv workshop-web /workshop-web
ls -la /
- internal/docker-push:
ports: "8080"
working-dir: /pipeline/source
cmd: ./workshop-web
env: "CI=true"
username: $DOCKER_USERNAME
password: $DOCKER_PASSWORD
repository: $DOCKER_REPO
registry: https://iad.ocir.io/v2
tag: $WERCKER_GIT_BRANCH
# Deploy to a Kubernetes cluster
deploy-to-kubernetes:
# We only need a minimal shell environment to run Kubectl.
box:
id: alpine
cmd: /bin/sh
steps:
# https://github.com/wercker/step-bash-template
# This Wercker step will look for files in our repo with a .template extension.
# It will expand any environment variables in those files, then remove the
# template extension.
- bash-template
# The step above should leave us with a Kubernetes service and deployment yml files.
# We'll create a directory to move them to.
- script:
name: Prepare Kubernetes files
code: |
ls -lth
cat kubernetes_*.yml
mkdir $WERCKER_OUTPUT_DIR/kubernetes
mv kubernetes_*.yml $WERCKER_OUTPUT_DIR/kubernetes
- kubectl:
name: deploy to kubernetes
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: apply -f $WERCKER_OUTPUT_DIR/kubernetes/
- kubectl:
name: set deployment timeout
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: patch deployment/ws-web -p '{"spec":{"progressDeadlineSeconds":60}}'
- kubectl:
name: check deployment status
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: rollout status deployment/ws-web