forked from nagypeter/angularjs-springboot-CreditScoreApp
-
Notifications
You must be signed in to change notification settings - Fork 3
/
wercker.yml
55 lines (49 loc) · 1.58 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
box: combient/java-mvn
build:
steps:
# Build Inventory REST application
- script:
name: Maven install
code: mvn install
push:
steps:
# Push to public docker repo Container Registry (CR)
- internal/docker-push:
tag: latest
repository: $CR_REPOSITORY
cmd: java -jar /pipeline/source/target/loan-0.1.0.war
deploy-to-cluster:
steps:
- kubectl:
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: delete deployment rest-creditscore
- kubectl:
server: $KUBERNETES_MASTER
token: $KUBERNETES_TOKEN
insecure-skip-tls-verify: true
command: create -f $WERCKER_ROOT/creditscore-deployment.yaml
testapp:
steps:
- script:
name: Run and Test microservice
code: |
java -jar /pipeline/source/target/loan-0.1.0.war &
sleep 10
CREDITSCORE_URL=http://localhost:8080/creditscore
echo 'Microservice URL=' $CREDITSCORE_URL
if curl -X POST -H "Content-Type: application/json" -X POST -d '{"firstname":"John","lastname":"Doe","dateofbirth":"01/01/2015","ssn":"111223333"}' $CREDITSCORE_URL | grep "firstname"
then
# if the keyword is in the conent
echo "Test passed"
else
echo "Test failed"
exit -1
fi
restart:
steps:
# Restart Docker on OCCS using webhook
- script:
name: curl POST
code: curl -k -X POST $DEPLOYMENT_WEBHOOK