-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.5.x: add parent java multi project
- Loading branch information
Showing
28 changed files
with
926 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
generators/app/templates/java-parent-multi-project/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.hg | ||
.gradle | ||
out | ||
build | ||
target | ||
.idea | ||
*.iml | ||
*.ipr | ||
*.iws | ||
*.log | ||
.DS_Store |
12 changes: 12 additions & 0 deletions
12
generators/app/templates/java-parent-multi-project/.hgignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
syntax: glob | ||
^.gradle/* | ||
.idea/* | ||
.git/* | ||
*/out/* | ||
*/build/* | ||
*/target/* | ||
.DS_Store | ||
*.iml | ||
*.ipr | ||
*.iws | ||
*.log |
21 changes: 21 additions & 0 deletions
21
generators/app/templates/java-parent-multi-project/.mvn/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM openjdk:8u151-jre-alpine3.7 | ||
MAINTAINER Maksim Kostromin https://github.com/daggerok | ||
RUN apk --no-cache add busybox-suid bash curl sudo \ | ||
&& adduser -h /home/appuser -s /bin/bash -D -u 1025 appuser wheel \ | ||
&& echo "appuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ | ||
&& sed -i "s/.*requiretty$/Defaults !requiretty/" /etc/sudoers \ | ||
&& apk del busybox-suid \ | ||
&& rm -rf /tmp/* /var/cache/apk/* | ||
USER appuser | ||
WORKDIR /home/appuser | ||
VOLUME /home/appuser | ||
ENTRYPOINT java -XX:+UnlockExperimentalVMOptions \ | ||
-XX:+UseCGroupMemoryLimitForHeap \ | ||
-XshowSettings:vm \ | ||
-jar ./app.jar | ||
CMD /bin/bash | ||
#EXPOSE 8080 | ||
#HEALTHCHECK --timeout=1s \ | ||
# --retries=35 \ | ||
# CMD curl -f http://127.0.0.1:8080/actuator/health || exit 1 | ||
COPY --chown=appuser ./target/*.jar ./app.jar |
Binary file added
BIN
+46.7 KB
generators/app/templates/java-parent-multi-project/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
1 change: 1 addition & 0 deletions
1
generators/app/templates/java-parent-multi-project/.mvn/wrapper/maven-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip |
24 changes: 24 additions & 0 deletions
24
generators/app/templates/java-parent-multi-project/.travis.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#service: | ||
#- docker | ||
#sudo: required | ||
group: travis_lts | ||
env: | ||
global: | ||
TERM=dumb | ||
language: java | ||
jdk: | ||
- oraclejdk8 | ||
- openjdk8 | ||
install: true | ||
#before_script: | ||
#- sudo apt udate -y || true | ||
#- sudo apt install -y --no-install-recommends curl jq libxml2-utils docker-ce python-pip | ||
#- sudo pip install docker-compose httpie | ||
#- source <(curl -s https://raw.githubusercontent.com/daggerok/bash-functions/master/main.bash) | ||
script: | ||
- bash mvnw | ||
- bash gradlew | ||
cache: | ||
directories: | ||
- $HOME/.m2 | ||
- $HOME/.gradle |
19 changes: 19 additions & 0 deletions
19
generators/app/templates/java-parent-multi-project/README.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
= <%= projectDirectory %> | ||
|
||
generated using link:https://github.com/daggerok/generator-daggerok-fatjar/[daggerok-fatjar] yeoman generator | ||
|
||
inside: | ||
|
||
. java 8 based parent multi project | ||
. support maven | ||
. support gradle | ||
. docker / docker-compose support | ||
|
||
.build | ||
---- | ||
./mvnw clean package com.dkanejs.maven.plugins:docker-compose-maven-plugin:1.0.1:up | ||
./mvnw com.dkanejs.maven.plugins:docker-compose-maven-plugin:1.0.1:down | ||
./gradlew clean build composeUp | ||
./gradlew composeDown | ||
---- |
52 changes: 52 additions & 0 deletions
52
generators/app/templates/java-parent-multi-project/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
buildscript { | ||
ext { | ||
javaVersion = "1.8" | ||
} | ||
} | ||
|
||
plugins { | ||
id "idea" | ||
id "eclipse" | ||
id "com.avast.gradle.docker-compose" version "0.6.12" | ||
} | ||
|
||
allprojects { | ||
|
||
apply plugin: "base" | ||
apply plugin: "maven" | ||
|
||
group = "daggerok" | ||
version = "0.0.1" | ||
|
||
defaultTasks "clean", "build" | ||
|
||
task wrapper(type: Wrapper) { | ||
gradleVersion = "4.5" | ||
distributionType = "ALL" | ||
} | ||
} | ||
|
||
subprojects { | ||
|
||
apply plugin: "base" | ||
|
||
sourceCompatibility = targetCompatibility = "$javaVersion" | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
dockerCompose { | ||
useComposeFiles = [project.file("docker-compose-gradle.yaml")] | ||
captureContainersOutput = true | ||
stopContainers = true | ||
removeContainers = true | ||
removeImages = "Local" | ||
removeVolumes = true | ||
removeOrphans = true | ||
projectName = project.name | ||
} | ||
|
||
composeUp.dependsOn assemble |
20 changes: 20 additions & 0 deletions
20
generators/app/templates/java-parent-multi-project/docker-compose-gradle.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: "2.1" | ||
|
||
services: | ||
|
||
gradle-<%= projectDirectory %>-app: | ||
build: | ||
context: . | ||
dockerfile: gradle/Dockerfile | ||
volumes: ["gradle-app-data:/home/appuser"] | ||
networks: [backing-services] | ||
# ports: ["8080:8080"] | ||
# restart: unless-stopped | ||
# mem_limit: 209715200 # container limit: 200Mb (200 * 1024 * 1024) | ||
|
||
volumes: | ||
gradle-app-data: {} | ||
|
||
networks: | ||
backing-services: | ||
driver: bridge |
20 changes: 20 additions & 0 deletions
20
generators/app/templates/java-parent-multi-project/docker-compose-maven.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: "2.1" | ||
|
||
services: | ||
|
||
maven-<%= projectDirectory %>-app: | ||
build: | ||
context: . | ||
dockerfile: .mvn/Dockerfile | ||
volumes: ["maven-app-data:/home/appuser"] | ||
networks: [backing-services] | ||
# ports: ["8080:8080"] | ||
# restart: unless-stopped | ||
# mem_limit: 209715200 # container limit: 200Mb (200 * 1024 * 1024) | ||
|
||
volumes: | ||
maven-app-data: {} | ||
|
||
networks: | ||
backing-services: | ||
driver: bridge |
21 changes: 21 additions & 0 deletions
21
generators/app/templates/java-parent-multi-project/gradle/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM openjdk:8u151-jre-alpine3.7 | ||
MAINTAINER Maksim Kostromin https://github.com/daggerok | ||
RUN apk --no-cache add busybox-suid bash curl sudo \ | ||
&& adduser -h /home/appuser -s /bin/bash -D -u 1025 appuser wheel \ | ||
&& echo "appuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ | ||
&& sed -i "s/.*requiretty$/Defaults !requiretty/" /etc/sudoers \ | ||
&& apk del busybox-suid \ | ||
&& rm -rf /tmp/* /var/cache/apk/* | ||
USER appuser | ||
WORKDIR /home/appuser | ||
VOLUME /home/appuser | ||
ENTRYPOINT java -XX:+UnlockExperimentalVMOptions \ | ||
-XX:+UseCGroupMemoryLimitForHeap \ | ||
-XshowSettings:vm \ | ||
-jar ./app.jar | ||
CMD /bin/bash | ||
#EXPOSE 8080 | ||
#HEALTHCHECK --timeout=1s \ | ||
# --retries=35 \ | ||
# CMD curl -f http://127.0.0.1:8080/actuator/health || exit 1 | ||
COPY --chown=appuser ./build/libs/*.jar ./app.jar |
Binary file added
BIN
+53.1 KB
generators/app/templates/java-parent-multi-project/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions
5
generators/app/templates/java-parent-multi-project/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip |
Oops, something went wrong.