-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
66 lines (57 loc) · 1.82 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
language: java
jdk: oraclejdk8
install: true
before_install:
- sudo apt -y update >/dev/null 2>&1 || true
- sudo apt install -y --no-install-recommends curl wget unzip bash python-pip >/dev/null 2>&1
- sudo pip install httpie >/dev/null 2>&1
- source <(curl -s https://raw.githubusercontent.com/daggerok/bash-functions/master/main.bash)
- stop_any 80 8080
script:
## working on mac but not on travis linux
#- |
# curl https://start.spring.io/starter.zip \
# -d dependencies=web \
# -d type=gradle-project \
# -d baseDir=my-backend-project | tar -xzvf -
# gradle bash launch script
- |
wget https://start.spring.io/starter.zip -O my-backend-project.zip \
--post-data="dependencies=web&type=gradle-project&baseDir=my-backend-project"
- unzip -q ./my-backend-project.zip
- echo "bootJar { launchScript() }" >> ./my-backend-project/build.gradle
- bash ./my-backend-project/gradlew -b ./my-backend-project/build.gradle build >/dev/null
- bash ./my-backend-project/build/libs/*.jar &
- wait_for 8080
- http :8080
- stop_any 80 8080
- mkdir -p ./my-backend-project/build/libs/public
- echo "<html><body>Hello</body></html>" > ./my-backend-project/build/libs/public/index.html
- bash ./my-backend-project/build/libs/*.jar &
- wait_for 8080
- http :8080
- stop_any 80 8080
# maven java -jar
- mkdir -p /tmp/demo
- wget https://start.spring.io/starter.zip -O /tmp/demo.zip --post-data="dependencies=web"
- unzip -q /tmp/demo.zip -d /tmp/demo
- cd /tmp/demo/
- bash ./mvnw clean package >/dev/null
- cd target/
- java -jar *.jar &
- wait_for 8080
- http :8080
- stop_any 80 8080
- mkdir -p public
- echo "<html><body>Hello</body></html>" > ./public/index.html
- java -jar *.jar &
- wait_for 8080
- http :8080
- stop_any 80 8080
# maven different classpath
- mv ./public ../
- cd ..
- java -jar target/*.jar &
- wait_for 8080
- http :8080
- stop_any 8080