-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
109 lines (109 loc) · 3.91 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
notifications:
email: false
git:
quiet: true
depth: false
jdk: openjdk11
node_js: lts/*
language: python
python: 3.8
os: linux
arch: amd64
addons:
apt:
update: false
packages:
- jq
- curl
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
#
- |
python -m pip install --upgrade pip setuptools pyopenssl
python -m pip install --upgrade httpie
jobs:
include:
- stage: test
name: test layer
jdk: openjdk11
before_script:
- cd $TRAVIS_BUILD_DIR && ./mvnw -f layer
- bash $TRAVIS_BUILD_DIR/layer/target/*.jar &
- wait_for 8080
script:
- http :8080
#
- http post :8080/elections name=Test
- electionId=`http get :8080/elections | jq -r ".[].id"`
#
- http post :8080/elections/$electionId/candidates name="New Asshole"
- http post :8080/elections/$electionId/candidates name="Old Asshole"
- firstCandidate=`http get :8080/candidates | jq -r ".[0].id"`
- secondCandidate=`http get :8080/candidates | jq -r ".[1].id"`
#
- http post :8080/elections/$electionId/voters name="New Asshole"
- http post :8080/elections/$electionId/voters name="Old Asshole"
- http post :8080/elections/$electionId/voters name="Poor believer"
- firstVoter=`http get :8080/voters | jq -r ".[0].id"`
- secondVoter=`http get :8080/voters | jq -r ".[1].id"`
- thirdVoter=`http get :8080/voters | jq -r ".[2].id"`
#
- http put :8080/elections/$electionId/candidates/$firstCandidate/voters/$firstVoter
- http put :8080/elections/$electionId/candidates/$secondCandidate/voters/$secondVoter
- http put :8080/elections/$electionId/candidates/$firstCandidate/voters/$thirdVoter
#
- http get :8080/elections/$electionId
after_script:
- stop_any 80
- stage: test
name: test feature
jdk: openjdk11
before_script:
- cd $TRAVIS_BUILD_DIR && ./mvnw -f feature
- bash $TRAVIS_BUILD_DIR/feature/target/*.jar &
- wait_for 8080
script:
- http :8080
#
- http post :8080/elections name=Test
- electionId=`http get :8080/elections | jq -r ".[].id"`
#
- http post :8080/elections/$electionId/candidates name="Asshole 1"
- http post :8080/elections/$electionId/candidates name="Asshole 2"
- firstCandidate=`http get :8080/candidates | jq -r ".[0].id"`
- secondCandidate=`http get :8080/candidates | jq -r ".[1].id"`
#
- http post :8080/elections/$electionId/voters name="Asshole 1"
- http post :8080/elections/$electionId/voters name="Asshole 2"
- http post :8080/elections/$electionId/voters name="Poor young newbie..."
- firstVoter=`http get :8080/voters | jq -r ".[0].id"`
- secondVoter=`http get :8080/voters | jq -r ".[1].id"`
- thirdVoter=`http get :8080/voters | jq -r ".[2].id"`
#
- http put :8080/elections/$electionId/candidates/$firstCandidate/voters/$firstVoter
- http put :8080/elections/$electionId/candidates/$secondCandidate/voters/$secondVoter
- http put :8080/elections/$electionId/candidates/$secondCandidate/voters/$thirdVoter
#
- http :8080/elections/$electionId
after_script:
- stop_any 80
- stage: test
name: test
jdk: openjdk11
script: cd $TRAVIS_BUILD_DIR && ./mvnw
cache:
npm: true
pip: true
packages: true
directories:
- ~/.m2
- ~/.docker
- ~/.local/daggerok
- .vuepress/node_modules