Skip to content

Commit e4a5568

Browse files
author
Maksym Kostromin
committed
Add spring-boot-kotlin-config-props
1 parent 921c643 commit e4a5568

35 files changed

+1891
-11
lines changed

.travis.yml

+33-11
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,51 @@
11
env:
22
global:
33
TERM=dumb
4-
group: trusty_lts
5-
language: java
6-
jdk:
7-
- openjdk8
8-
- oraclejdk8
4+
5+
jdk: oraclejdk8
6+
#jdk:
7+
#- openjdk8
8+
#- oraclejdk8
9+
910
install: true
1011
before_install:
12+
- sudo apt update -y >/dev/null 2>&1 || true
13+
- sudo apt install -y --no-istall-recommends python-pip
14+
- suod pip install httpie >/dev/null 2>&1
1115
- source <(curl -fsSL https://raw.github.com/daggerok/bash-functions/master/main.bash)
12-
- stop_any 27017
16+
- stop_any 27017 8080 80
17+
1318
script:
14-
- export ROOT=$PWD
19+
- export root=$(pwd)
20+
21+
- cd $root/spring-boot-kotlin-config-props
22+
- bash ./gradlew >/dev/null 2>&1
23+
- bash ./build/libs/*.jar &
24+
- wait_for 8080
25+
- http :8080/
26+
- http :8080/api
27+
- stop_any 8080 80
28+
- bash ./mvnw >/dev/null 2>&1
29+
- bash ./target/*.jar &
30+
- wait_for 8080
31+
- http :8080/
32+
- http :8080/api
33+
- stop_any 8080 80
34+
1535
- >
1636
for path in \
37+
spring-boot-kotlin-config-props \
1738
reactive-secured-sse \
1839
reactive-kotlin-see \
1940
spring-kotlin-example \
2041
; do
21-
cd "$ROOT/$path"
22-
bash gradlew clean build
42+
cd "$root/$path"
43+
bash gradlew clean build >/dev/null 2>&1
2344
done;
45+
2446
# 01 e2e
25-
- cd $ROOT/spring-kotlin-example
26-
- bash gradlew clean build
47+
- cd $root/spring-kotlin-example
48+
- bash gradlew clean build >/dev/null 2>&1
2749
- sudo mkdir -p /var/app
2850
- sudo mv -f ./app/build/libs/*.jar /var/app/01.jar
2951
- sudo ln -s /var/app/01.jar /etc/init.d/01

README.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
This repository contains some my kotlin examples and links to other my repos with kotlin projects:
44

5+
. link:spring-boot-kotlin-config-props/[Kotlin @ConfigurationProperties using custom Object, Map and List]
56
. link:spring-kotlin-example/[Kotlin Example]
67
. link:reactive-kotlin-sse/[Reactive Kotlin SSE service and client]
78
. link:reactive-secured-sse/[Spring Boot reactive security and Kotlin SSE]
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.hg
2+
.gradle
3+
build
4+
target
5+
out
6+
.idea
7+
*.iml
8+
*.ipr
9+
*.iws
10+
*.log*
11+
.DS_Store
12+
Thumbs.db
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
syntax: glob
2+
^.gradle/*
3+
.gradle
4+
^.git/*
5+
.git
6+
*/build/*
7+
*/target/*
8+
.DS_Store
9+
Thumbs.db
10+
*/out/*
11+
^.idea/*
12+
.idea
13+
*.iml
14+
*.ipr
15+
*.iws
16+
*.log*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM openjdk:8u151-jre-alpine3.7
2+
MAINTAINER Maksim Kostromin https://github.com/daggerok
3+
RUN apk --no-cache --update add busybox-suid bash curl unzip sudo openssh-client shadow wget \
4+
&& adduser -h /home/appuser -s /bin/bash -D -u 1025 appuser wheel \
5+
&& echo "appuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
6+
&& sed -i "s/.*requiretty$/Defaults !requiretty/" /etc/sudoers \
7+
&& wget --no-cookies \
8+
--no-check-certificate \
9+
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
10+
"http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip" \
11+
-O /tmp/jce_policy-8.zip \
12+
&& unzip -o /tmp/jce_policy-8.zip -d /tmp \
13+
&& mv -f ${JAVA_HOME}/lib/security ${JAVA_HOME}/lib/backup-security \
14+
&& mv -f /tmp/UnlimitedJCEPolicyJDK8 ${JAVA_HOME}/lib/security \
15+
&& apk del busybox-suid unzip openssh-client shadow wget \
16+
&& rm -rf /var/cache/apk/* /tmp/*
17+
USER appuser
18+
WORKDIR /home/appuser
19+
VOLUME /home/appuser
20+
ARG JAVA_OPTS_ARGS="\
21+
-Djava.net.preferIPv4Stack=true \
22+
-XX:+UnlockExperimentalVMOptions \
23+
-XX:+UseCGroupMemoryLimitForHeap \
24+
-XshowSettings:vm "
25+
ENV JAVA_OPTS="${JAVA_OPTS} ${JAVA_OPTS_ARGS}"
26+
ENTRYPOINT java ${JAVA_OPTS} -jar ./app.jar
27+
CMD /bin/bash
28+
EXPOSE 8080
29+
#ENTRYPOINT java -XX:+UnlockExperimentalVMOptions \
30+
# -XX:+UseCGroupMemoryLimitForHeap \
31+
# -XshowSettings:vm \
32+
# -Djava.net.preferIPv4Stack=true \
33+
# -jar ./app.jar
34+
#CMD /bin/bash
35+
HEALTHCHECK --timeout=2s \
36+
--retries=22 \
37+
CMD curl -f http://127.0.0.1:8080/actuator/health || exit 1
38+
COPY --chown=appuser ./target/*.jar ./app.jar
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
service:
2+
- docker
3+
4+
env:
5+
global:
6+
- TERM=dumb
7+
- secure: rs34wHwsLTKMWTxLhfyWe7lbaYadcSAo0lyTxBdHinhH82ohWGVYpV7Zm3pbBH15BZv65pvqspgm2oNOExHBonZ1yhn3VUreso+4h+nf8mAwCjH+71MNTeuQo+d8Jky3SIeLvf4LqYZ6Zbf8yXksPF3DFG49M1S1KByIPmF+LT08pbZEptrsb+T6tuAIyWqMosx4Y4mKub9IgFjudtw42yd+sE4kihpVhW9ebw3wrZYtREXuZxIDfIvvjC+n5cEs0plm41725CVTv893WU6P3Kl0Gtkl6mER6HDLYPIKnSBrDFKvnmMSD7Sc3w/wPFaxfRayC4LB2til324+IcmFq8EeQ7mKRsEwQiIqWra8702/5v9+JH4JntO5lS8cs5osMEv7bf1+bI4+AFTb4S2PqjWFwuvts2yLOZ3tmpFMjHK666+Jaa63JBSVA4+Bhjn2+9hAeIVxhQuiT5oZ3fenHFC8cZV/ywDqjSWfzgoEWJNfiBAfl/ZQRgt1JBFSJrCVjaYIoqscj64L89KMzBu0wrkuepU3n4gJMGPX+7cv4CHcrzCXX3f3mpfiP58swfCh2bNNhuR1xCu7Yyus2UsFcrI5ell4b84Hl1nkY6pOZhr9cwiylSHkBM2TEZQlCRLqbATaFK8/4GpDcCjFey6tyrg6tqhflND+oiiR3WZQYo0=
8+
9+
language: java
10+
jdk: oraclejdk8
11+
12+
install: true
13+
before_script:
14+
- sudo apt update -y >/dev/null 2>&1 || true
15+
- sudo apt install -y --no-install-recommends bash unzip curl jq libxml2-utils docker-ce python-pip >/dev/null 2>&1
16+
- sudo pip install docker-compose httpie >/dev/null 2>&1
17+
- source <(curl -s https://raw.githubusercontent.com/daggerok/bash-functions/master/main.bash)
18+
- stop_any 8080 80
19+
20+
script:
21+
- bash gradlew >/dev/null 2>&1
22+
- java -jar ./build/libs/*.jar &
23+
- wait_for 8080
24+
- http :8080
25+
- stop_any 8080 80
26+
#
27+
- bash ./build/libs/*.jar &
28+
- wait_for 8080
29+
- http :8080
30+
- stop_any 8080 80
31+
#
32+
- bash gradlew composeUp
33+
- http :8080
34+
- bash gradlew composeDown
35+
#
36+
- bash mvnw >/dev/null 2>&1
37+
- java -jar ./target/*.jar &
38+
- wait_for 8080
39+
- http :8080
40+
- stop_any 8080 80
41+
#
42+
- bash ./target/*.jar &
43+
- wait_for 8080
44+
- http :8080
45+
- stop_any 8080 80
46+
#
47+
- bash mvnw com.dkanejs.maven.plugins:docker-compose-maven-plugin:1.0.1:up
48+
- sleep 20
49+
- http :8080
50+
- bash mvnw com.dkanejs.maven.plugins:docker-compose-maven-plugin:1.0.1:down
51+
52+
cache:
53+
directories:
54+
- $HOME/.m2
55+
- $HOME/.gradle
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
= spring-boot-kotlin-config-props
2+
3+
//tag::content[]
4+
5+
.gradle
6+
----
7+
./gradlew
8+
java -jar build/libs/*.jar
9+
bash build/libs/*.jar
10+
11+
./gradlew build composeUp
12+
./gradlew composeDown
13+
----
14+
15+
.maven
16+
----
17+
./mvnw
18+
java -jar target/*.jar
19+
bash target/*.jar
20+
21+
./mvnw; ./mvnw com.dkanejs.maven.plugins:docker-compose-maven-plugin:1.0.1:up
22+
./mvnw com.dkanejs.maven.plugins:docker-compose-maven-plugin:1.0.1:down
23+
----
24+
25+
generated by link:https://github.com/daggerok/generator-jvm/[jvm] yeoman generator
26+
27+
==== what's inside?
28+
29+
. java 8 based project
30+
. spring-boot 2 / spring framework 5
31+
. support fatjar
32+
. support executable bash jar
33+
. support kotlin
34+
. support maven
35+
. support gradle
36+
. vavr (javaslang)
37+
. lombok (slf4j + logback logging)
38+
. support testing with junit 4 / 5
39+
. docker / docker-compose support
40+
41+
//end::content[]

0 commit comments

Comments
 (0)