-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
225 lines (225 loc) · 8.36 KB
/
.travis.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
env:
global:
- TERM=dumb
notifications:
email: false
git:
quiet: true
depth: false
jdk: openjdk11
node_js: lts/*
python: 3.7
services:
- docker
os: linux
arch: amd64
addons:
apt:
update: true
packages:
- python3-pip
install: true
before_install:
- |
if [ ! -f ${HOME}/.local/daggerok/bash-functions/master/main.bash ] ; then
mkdir -p ${HOME}/.local/daggerok/bash-functions/master ;
curl -s https://raw.githubusercontent.com/daggerok/bash-functions/master/main.bash > ${HOME}/.local/daggerok/bash-functions/master/main.bash ;
fi
source ${HOME}/.local/daggerok/bash-functions/master/main.bash ;
- stop_any 80 5432 8080 8001 8002 8003 8004
#
- export PATH=$HOME/.local/bin:$PATH
- pip3 install --user --upgrade pip setuptools
- pip install --user --upgrade docker-compose httpie
jobs:
include:
- stage: test
name: k8s ingress using k3d k3s traefik PathPrefixStrip
script:
- cd $TRAVIS_BUILD_DIR
#- wget -q -O - https://raw.githubusercontent.com/rancher/k3d/master/install.sh | bash
- curl -s https://raw.githubusercontent.com/rancher/k3d/master/install.sh | bash
- k3d create --name k3s --api-port 6551 --publish 80:80 --workers 1
- sleep 16s
#
- export KUBECONFIG="$(k3d get-kubeconfig --name='k3s')"
- curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
- chmod +x ./kubectl
- mv ./kubectl ~/.local/bin/
- kubectl get pods --all-namespaces -o wide --watch &
#
- kubectl apply -f k8s/ -f k8s/ingress/ingress-traefik-path-prefix-strip.yaml
- sleep 126s
- kubectl get all -o wide
- sleep 166s
#
- kubectl get all
- http :/find-all-greetings
- http :/find-all-greetings/ololo
- http :/actuator/health
- http :/actuator/info
- http :/greeting/actuator/health
- http :/greeting/actuator/info
- http :/hello/actuator/health
- http :/hello/actuator/info
#
- kubectl delete -f k8s/ -f k8s/ingress/ || echo 'cannot kubectl...'
- k3d stop --name=k3s -a || echo 'cannot k3d...'
- docker rm -f -v `docker ps -q` || echo 'cannot docker...'
- cat ~/.config/k3d/k3s/kubeconfig.yaml || echo 'cannot cat...'
- rm -rf ~/.config/k3d/k3s
- stage: test
name: k8s ingress using k3d k3s traefik default backend
script:
- cd $TRAVIS_BUILD_DIR
#- wget -q -O - https://raw.githubusercontent.com/rancher/k3d/master/install.sh | bash
- curl -s https://raw.githubusercontent.com/rancher/k3d/master/install.sh | bash
- k3d create --name k3s --api-port 6551 --publish 80:80 --workers 3
- sleep 25s
#
- export KUBECONFIG="$(k3d get-kubeconfig --name='k3s')"
- curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
- chmod +x ./kubectl
- mv ./kubectl ~/.local/bin/
- kubectl cluster-info
- kubectl get pods --all-namespaces -o wide --watch &
#
- echo 'https://kubernetes.github.io/ingress-nginx/deploy/#prerequisite-generic-deployment-command'
- kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
- echo 'https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal'
- kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/baremetal/service-nodeport.yaml
- kubectl apply -f k8s/ -f k8s/ingress/ingress-traefik-default-backend.yaml
- sleep 125s
- kubectl get all -o wide
- sleep 165s
#
- kubectl get all
- http :/actuator/health
- http :/find-all-greetings
- http :/find-all-hello
- http :/info
#
- kubectl delete -f k8s/ -f k8s/ingress/ || echo 'cannot kubectl...'
- k3d stop --name=k3s -a || echo 'cannot k3d...'
- docker rm -f -v `docker ps -q` || echo 'cannot docker...'
- cat ~/.config/k3d/k3s/kubeconfig.yaml || echo 'cannot cat...'
- rm -rf ~/.config/k3d/k3s
- stage: test
name: jib + k8s, k3s, k3d...
script:
- cd $TRAVIS_BUILD_DIR
#- wget -q -O - https://raw.githubusercontent.com/rancher/k3d/master/install.sh | bash
- curl -s https://raw.githubusercontent.com/rancher/k3d/master/install.sh | bash
- k3d create --name k3s --api-port 6551 --publish 30004:30004 --workers 2
- sleep 14s
- export KUBECONFIG="$(k3d get-kubeconfig --name='k3s')"
#
- curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
- chmod +x ./kubectl
- mv ./kubectl ~/.local/bin/
- kubectl cluster-info
- kubectl get pods --all-namespaces -o wide --watch &
#
#- curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
#- chmod +x skaffold
#- mv skaffold ~/.local/bin/
#- ./mvnw clean compile jib:dockerBuild
#- skaffold --images daggerok/boot-skaffold
#- skaffold dev &
#
- kubectl apply -f k8s/
- sleep 144s
- kubectl get all -o wide
- sleep 144s
#
- kubectl get all
- http :30004/actuator/health
- http :30004/actuator/info
- http :30004/info
- http :30004/find-all-hello
- http :30004/find-all-greetings
- http :30004/
#
- kubectl delete -f k8s/ || echo 'cannot kubectl...'
- k3d stop --name=k3s || echo oops
- docker rm -f -v `docker ps -q` || echo oops
- cat ~/.config/k3d/k3s/kubeconfig.yaml || echo oops
- rm -rf ~/.config/k3d/k3s/kubeconfig.yaml
- stage: test
name: jib + dkanejs
before_script:
- ./mvnw clean package jib:dockerBuild
- ./mvnw -f docker-compose -Pup
- wait_for 8001 8002 8003 8004
- sleep 33s
script:
- http :8001/actuator/info
- http :8001/info
- http :8001/find-all-hello
#
- http :8003/actuator/info
- http :8003/info
- http :8003/find-all-greetings
- http :8003/find-all-greetings/max
#
- http :8004/actuator/info
- http :8004/info
- http :8004/find-all-hello
- http :8004/find-all-greetings
- http :8004/find-all-greetings/maksimko
after_script:
- ./mvnw -f docker-compose -Pdown
- stage: test
name: jib + fabric8
before_script:
- ./mvnw clean package jib:dockerBuild
- ./mvnw -f docker-compose -Pstart
script:
- http :8001/actuator/info
- http :8001/info
- http :8001/find-all-hello
#
- http :8003/actuator/info
- http :8003/info
- http :8003/find-all-greetings
- http :8003/find-all-greetings/max
#
- http :8004/actuator/info
- http :8004/info
- http :8004/find-all-hello
- http :8004/find-all-greetings
- http :8004/find-all-greetings/maksimko
after_script:
- ./mvnw -f docker-compose -Pstop
- stage: test
name: local
before_script:
- ./mvnw
- bash frontend/target/*.jar &
- bash greeting-service/target/*.jar &
- bash hello-variants-service/target/*.jar &
- wait_for 8001 8002 8003 8004
script:
- http :8001/actuator/info
- http :8001/info
- http :8001/find-all-hello
#
- http :8003/actuator/info
- http :8003/info
- http :8003/find-all-greetings
- http :8003/find-all-greetings/max
#
- http :8004/actuator/info
- http :8004/info
- http :8004/find-all-hello
- http :8004/find-all-greetings
- http :8004/find-all-greetings/maksimko
after_script:
- for n in 1 3 4 ; do http post :800$n/actuator/shutdown ; done
cache:
pip: true
packages: true
directories:
- ~/.m2
- ~/.docker
- ~/.local