@@ -2,14 +2,11 @@ service:
22- docker
33
44language : java
5- jdk :
6- - oraclejdk8
7- # - oraclejdk10
5+ jdk : oraclejdk8
86node_js : lts/*
97
108addons :
119 apt :
12- update : true
1310 packages :
1411 - sudo
1512 - lsof
@@ -33,19 +30,19 @@ before_install:
3330#
3431- sudo pip install docker-compose httpie >/dev/null 2>&1
3532- source <(curl -s https://raw.githubusercontent.com/daggerok/bash-functions/master/main.bash)
36- - stop_any 5432 5672 27017 8082 8082 8081 8081 8080 8080 80 80
33+ - stop_any 80 5432 8002 8001
3734
3835script :
3936# jgiven tests and docs
40- # - bash gradlew -S -Pdebug clean test jgiven build documentation >/dev/null || true
41- - bash gradlew -S -Pdebug clean check build >/dev/null
37+ - ./ gradlew -S -Pdebug clean test jgiven build documentation >/dev/null
38+ - ./ gradlew -S -Pdebug clean check build >/dev/null
4239
4340- export APP_UPLOAD_PATH="/tmp/file-storage"
4441- mkdir -p ${APP_UPLOAD_PATH}
4542- cp -Rf ./modules/apps/file-server/build/libs "${APP_UPLOAD_PATH}/"
4643
4744# postgres
48- - bash gradlew clean assemble postgresUp >/dev/null
45+ - ./ gradlew clean assemble postgresUp >/dev/null
4946- bash ./modules/apps/file-items-service/build/libs/*.jar --spring.profiles.active=db-pg >/dev/null &
5047- wait_for 8001
5148- bash ./modules/apps/file-server/build/libs/*.jar >/dev/null &
@@ -55,11 +52,11 @@ script:
5552- http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" file@settings.gradle
5653- http --auth user:password :8002/api/v1/files
5754- http --auth user:password :8002/
58- - stop_any 8002 8002 8001 8001 80 80
59- - bash gradlew postgresDown >/dev/null
55+ - stop_any 80 8002 8001 5432
56+ - ./ gradlew postgresDown >/dev/null
6057
6158# h2
62- - bash gradlew clean assemble >/dev/null
59+ - ./ gradlew clean assemble >/dev/null
6360# - bash ./modules/apps/file-items-service/build/libs/*jar --spring.profiles.active=db-h2 >/dev/null &
6461- bash ./modules/apps/file-items-service/build/libs/*jar >/dev/null &
6562- wait_for 8001
@@ -70,10 +67,10 @@ script:
7067- http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" file@settings.gradle
7168- http --auth user:password :8002/api/v1/files
7269- http --auth user:password :8002/
73- - stop_any 8002 8002 8001 8001 80 80
70+ - stop_any 80 8002 8001 5432
7471
7572# install as linux service
76- - bash gradlew clean assemble postgresUp >/dev/null
73+ - ./ gradlew clean assemble postgresUp >/dev/null
7774- cp -Rf ./modules/apps/file-server/build/libs "${APP_UPLOAD_PATH}/"
7875- mv -f ./modules/apps/file-items-service/build/libs/*.jar /tmp/file-items-service.jar
7976- # export SPRING_PROFILES_ACTIVE=db-pg
@@ -92,30 +89,18 @@ script:
9289- http --auth user:password :8002/
9390- sudo service file-server stop
9491- sudo service file-items-service stop
95- - bash gradlew postgresDown >/dev/null 2>&1
92+ - ./ gradlew postgresDown >/dev/null 2>&1
9693- unset SPRING_PROFILES_ACTIVE
94+ - stop_any 80 8002 8001 5432
9795
98- # scripts/application.bash
99- - bash ./scripts/application.bash start build
100- - bash ./scripts/application.bash stop build
101- - bash ./scripts/application.bash start build
102- - http --auth user:password -f post :8002/upload filename="$(date)-build.gradle" file@build.gradle
103- - http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" file@settings.gradle
104- - http --auth user:password -f post :8002/upload filename="$(date)-README.md" file@README.md
105- - http --auth user:password :8001/api/v1/file-items
106- - http --auth user:password :8002/api/v1/files
107- - yes | bash ./scripts/application.bash clean build
108-
109- # scripts/application-h2.bash
110- - bash ./scripts/application-h2.bash start build
111- - bash ./scripts/application-h2.bash stop build
112- - bash ./scripts/application-h2.bash start build
113- - http --auth user:password :8001/actuator/health
114- - http --auth user:password -f post :8002/upload filename="$(date)-build.gradle" file@build.gradle
115- - http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" file@settings.gradle
116- - http --auth user:password :8002/api/v1/files
117- - http --auth user:password :8002/
118- - yes | bash ./scripts/application-h2.bash clean build
96+ # services behind reverse-proxy
97+ - ./gradlew clean
98+ - ./gradlew
99+ - ./gradlew allUp
100+ - wait_for 80
101+ - http -a user:password :80
102+ - ./gradlew allDown
103+ - stop_any 80 8002 8001 5432
119104
120105env :
121106 global :
124109 - secure : D04FeSPymLevdF11Ej1dUAxxHV9rKHHj/0sld/KPNh/mr876dm1l9AMo6VcBC5Kr1a6AwDJiOG9d8XgUEFRNvhBb3nMjIJa/99psykPL1N4WWZojULkeUtfhbVC+4d5qoLjNM2svT8IFJ9hO1kfgBGKk1Cd5KA+PtjceEIAJ29gaBvnbYo3MspXZsd3RA87kgY/poxQX2j7JeyKqQQKTLN8FTLqu7vgmdZWRYrUrSXiZvoJc9yJ+7PW6u4N4nVlReYb6+GGOM6BAtyB0dDxxG50sL8VcrYnzRlWyEXMaqNlqu2FBI+sBEuzkVkGulZMIsHDfKQhMPH/g2bN79FiPJVEiS7aOBiSMjS2f7vAq9JS3xOnNmMPjHOkAfzpktXbYHydeQIW6vcUue58qUkaj+zn7kyocg83hDlR/j3ATfXJvOGF4vqhkRwPtz7WeZ+Lra7nMrlhaLkFpALco7+ZOB9BwDa3lV1oic6Xv4pRNHgdIx+KcBOI6n4BND22ckzwa0p2+kfDHakIyojX2nNiWg7jzl1oDokI/3nnx/L2piUjKHspjvq7wiJjZefbYRgfLqML+TJ/osZ4P4rin8RLb6my/J3ApMlDH9PyiLNkafnhYKGsTP43XCYMBwVGxv++f/+6JeXsS35Hs4YXbCc1ANt7sTck6FzKgrELgTTOViGk=
125110
126111before_deploy :
112+ # publish tag release
127113- mkdir -p ${HOME}/.m2
128114- echo '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" ' > ${HOME}/.m2/settings.xml
129115- echo ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' >> ${HOME}/.m2/settings.xml
@@ -138,7 +124,30 @@ before_deploy:
138124- echo ' </servers> ' >> ${HOME}/.m2/settings.xml
139125- echo '</settings> ' >> ${HOME}/.m2/settings.xml
140126- ./mvnw
141- #
127+
128+ # test published release by using scripts/application.bash
129+ - bash ./scripts/application.bash start build
130+ - bash ./scripts/application.bash stop build
131+ - bash ./scripts/application.bash start build
132+ - http --auth user:password -f post :8002/upload filename="$(date)-build.gradle" file@build.gradle
133+ - http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" file@settings.gradle
134+ - http --auth user:password -f post :8002/upload filename="$(date)-README.md" file@README.md
135+ - http --auth user:password :8001/api/v1/file-items
136+ - http --auth user:password :8002/api/v1/files
137+ - yes | bash ./scripts/application.bash clean build
138+
139+ # test published release by using scripts/application-h2.bash
140+ - bash ./scripts/application-h2.bash start build
141+ - bash ./scripts/application-h2.bash stop build
142+ - bash ./scripts/application-h2.bash start build
143+ - http --auth user:password :8001/actuator/health
144+ - http --auth user:password -f post :8002/upload filename="$(date)-build.gradle" file@build.gradle
145+ - http --auth user:password -f post :8002/upload filename="$(date)-settings.gradle" file@settings.gradle
146+ - http --auth user:password :8002/api/v1/files
147+ - http --auth user:password :8002/
148+ - yes | bash ./scripts/application-h2.bash clean build
149+
150+ # documentation
142151- ./mvnw -Pdocs >/dev/null
143152- mkdir -p target/generated-docs
144153- cp -Rf target/generated-docs/index.html target/generated-docs/404.html
0 commit comments