-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,479 additions
and
3 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
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
35 changes: 35 additions & 0 deletions
35
generators/app/templates/java-wildfly-swarm/.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,35 @@ | ||
FROM openjdk:8u171-jre-alpine3.8 | ||
MAINTAINER Maksim Kostromin https://github.com/daggerok | ||
RUN apk --no-cache --update add busybox-suid bash curl unzip sudo openssh-client shadow wget \ | ||
&& 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 \ | ||
&& wget --no-cookies \ | ||
--no-check-certificate \ | ||
--header 'Cookie: oraclelicense=accept-securebackup-cookie' \ | ||
'http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip' \ | ||
-O /tmp/jce_policy-8.zip \ | ||
&& unzip -o /tmp/jce_policy-8.zip -d /tmp \ | ||
&& mv -f ${JAVA_HOME}/lib/security ${JAVA_HOME}/lib/backup-security || echo 'nothing to backup' \ | ||
&& mv -f /tmp/UnlimitedJCEPolicyJDK8 ${JAVA_HOME}/lib/security \ | ||
&& apk del busybox-suid unzip openssh-client shadow wget \ | ||
&& rm -rf /var/cache/apk/* /tmp/* | ||
USER appuser | ||
WORKDIR /home/appuser | ||
VOLUME /home/appuser | ||
ARG JAVA_OPTS_ARGS='\ | ||
-Djavax.net.debug=ssl \ | ||
-Djboss.bind.address=0.0.0.0 \ | ||
-Djboss.bind.address.management=0.0.0.0 \ | ||
-Djava.net.preferIPv4Stack=true \ | ||
-XX:+UnlockExperimentalVMOptions \ | ||
-XX:+UseCGroupMemoryLimitForHeap \ | ||
-XshowSettings:vm ' | ||
ENV JAVA_OPTS="${JAVA_OPTS} ${JAVA_OPTS_ARGS}" | ||
ENTRYPOINT java ${JAVA_OPTS} -jar ./app.jar | ||
CMD /bin/bash | ||
EXPOSE 8080 | ||
HEALTHCHECK --timeout=1s \ | ||
--retries=66 \ | ||
CMD curl -f http://127.0.0.1:8080/api/v1/hello || exit 1 | ||
COPY --chown=appuser ./target/*-swarm.jar ./app.jar |
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,89 @@ | ||
notifications: | ||
email: false | ||
|
||
env: | ||
global: | ||
- TERM=dumb | ||
|
||
language: java | ||
jdk: oraclejdk8 | ||
|
||
service: | ||
- docker | ||
|
||
addons: | ||
apt: | ||
sources: | ||
- google-chrome | ||
packages: | ||
- google-chrome-stable | ||
- libappindicator1 | ||
- fonts-liberation | ||
- bash | ||
- curl | ||
- libxml2-utils | ||
- docker-ce | ||
|
||
install: true | ||
before_install: | ||
- export CHROME_BIN=/usr/bin/google-chrome | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
# | ||
- sudo add-apt-repository universe -y >/dev/null | ||
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list >/dev/null | ||
- sudo apt-get update -yqq >/dev/null | ||
- sudo apt-get install -yqq --no-install-suggests --no-install-recommends | ||
tree jq python-pip curl bash sudo >/dev/null | ||
# | ||
- sudo pip install docker-compose httpie >/dev/null 2>&1 | ||
# | ||
- source <(curl -s https://raw.githubusercontent.com/daggerok/bash-functions/master/main.bash) | ||
- stop_any 8080 3000 80 >/dev/null | ||
# | ||
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - >/dev/null | ||
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list >/dev/null | ||
- sudo apt-get update -yqq >/dev/null | ||
- sudo apt-get install -yqq --no-install-suggests --no-install-recommends yarn >/dev/null | ||
|
||
script: | ||
- export root=$(pwd) | ||
# | ||
- ./mvnw >/dev/null | ||
- java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 ./target/*-swarm.jar -Djava.net.preferIPv4Stack=true & | ||
- wait_for 8080 | ||
- sleep 10 | ||
- http :8080/api/v1/hello/00000000-0000-0000-0000-000000000000 | ||
- http :8080/api/v1/hello | ||
- stop_any 80 8080 | ||
# | ||
- ./gradlew >/dev/null | ||
- ./build/libs/*-swarm.jar -Djava.net.preferIPv4Stack=true & | ||
- wait_for 8080 | ||
- sleep 10 | ||
- http :8080/api/v1/hello/00000000-0000-0000-0000-000000000000 | ||
- http :8080/api/v1/hello | ||
- stop_any 80 8080 | ||
|
||
before_deploy: | ||
- cd ${root} | ||
- ./mvnw -Pdocs | ||
- mkdir -p ./target/generated-docs | ||
- cp -Rf ./target/generated-docs/index.html ./target/generated-docs/404.html | ||
|
||
deploy: | ||
provider: pages | ||
skip-cleanup: true | ||
# travis encrypt GITHUB_TOKEN=<your github repo token> --add | ||
github-token: "$GITHUB_TOKEN" | ||
keep-history: true | ||
on: | ||
branch: master | ||
local-dir: target/generated-docs | ||
target_branch: gh-pages | ||
|
||
before_cache: | ||
- for item in $(find ~/.gradle -name "*.lock"); | ||
do sudo rm -rf $item ; | ||
done | ||
|
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,27 @@ | ||
= <%= projectDirectory %> image:https://travis-ci.org/daggerok/<%= projectDirectory %>.svg?branch=master["Build Status", link="https://travis-ci.org/daggerok/<%= projectDirectory %>"] | ||
|
||
//// | ||
image:https://travis-ci.org/daggerok/<%= projectDirectory %>.svg?branch=master["Build Status", link="https://travis-ci.org/daggerok/<%= projectDirectory %>"] | ||
image:https://gitlab.com/daggerok/<%= projectDirectory %>/badges/master/build.svg["Build Status", link="https://gitlab.com/daggerok/<%= projectDirectory %>/-/jobs"] | ||
image:https://img.shields.io/bitbucket/pipelines/daggerok/<%= projectDirectory %>.svg["Build Status", link="https://bitbucket.com/daggerok/<%= projectDirectory %>"] | ||
//// | ||
|
||
//tag::content[] | ||
|
||
//Read link:https://daggerok.github.io/<%= projectDirectory %>[project reference documentation] | ||
|
||
.gradle | ||
[source,bash] | ||
---- | ||
./gradlew ; java -Djava.net.preferIPv4Stack=true -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 target/*-swarm.jar | ||
---- | ||
|
||
.maven | ||
[source,bash] | ||
---- | ||
./mvnw ; java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 target/*-swarm.jar -Djava.net.preferIPv4Stack=true | ||
---- | ||
|
||
//end::content[] | ||
|
||
Initially generated by using link:https://github.com/daggerok/generator-jvm/[generator-jvm] yeoman generator (kotlin-wildfly-swarm) |
134 changes: 134 additions & 0 deletions
134
generators/app/templates/java-wildfly-swarm/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,134 @@ | ||
buildscript { | ||
ext { | ||
javaVersion = '1.8' | ||
javaeeVersion = '8.0' | ||
jgivenVersion = '0.15.3' | ||
logbackVersion = '1.2.3' | ||
junitJupiterVersion = '5.3.1' | ||
junitPlatformVersion = '1.3.0' | ||
wildflySwarmVersion = '2018.5.0' | ||
materialDesignIconsVersion = '3.0.1' | ||
materializecssVersion = '1.0.0' | ||
} | ||
|
||
dependencies { | ||
classpath "org.wildfly.swarm:wildfly-swarm-gradle-plugin:$wildflySwarmVersion" | ||
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16' | ||
classpath 'org.jruby:jruby-complete:9.1.13.0' | ||
} | ||
} | ||
|
||
plugins { | ||
//id 'com.gradle.build-scan' version '1.16' | ||
//id 'ear' | ||
id 'war' | ||
id 'idea' | ||
id 'maven' | ||
id 'eclipse' | ||
|
||
id 'cn.bestwu.propdeps-eclipse' version '0.0.10' apply false | ||
id 'cn.bestwu.propdeps-maven' version '0.0.10' apply false | ||
id 'cn.bestwu.propdeps-idea' version '0.0.10' apply false | ||
id 'cn.bestwu.propdeps' version '0.0.10' apply false | ||
|
||
id 'com.jfrog.artifactory' version '4.8.1' apply false | ||
id 'org.asciidoctor.convert' version '1.5.8.1' apply false | ||
id 'org.ajoberstar.git-publish' version '2.0.0-rc.2' apply false | ||
id 'io.spring.dependency-management' version '1.0.6.RELEASE' | ||
id 'com.avast.gradle.docker-compose' version '0.7.1' | ||
id 'io.franzbecker.gradle-lombok' version '1.14' | ||
} | ||
|
||
apply from: "$projectDir/gradle/ide.gradle" | ||
apply from: "$projectDir/gradle/clean.gradle" | ||
|
||
final String gradleDir = "$rootDir/gradle" | ||
allprojects { | ||
buildscript { | ||
apply from: "$gradleDir/repositories-config.gradle" | ||
} | ||
apply from: "$gradleDir/repositories-config.gradle" | ||
} | ||
|
||
version = '0.0.1' | ||
group = 'com.github.daggerok' | ||
sourceCompatibility = targetCompatibility = "$javaVersion" | ||
lombok.version = '1.18.2' | ||
|
||
// ear { archiveName = "${project.name}.ear" } | ||
war { | ||
archiveName = "${project.name}.war" | ||
} | ||
|
||
defaultTasks 'clean', 'build' | ||
|
||
apply plugin: 'wildfly-swarm' | ||
|
||
swarm { | ||
executable = true | ||
} | ||
|
||
compileJava.dependsOn(processResources) | ||
|
||
dependencies { | ||
|
||
//implementation "org.webjars:materializecss:$materializecssVersion" | ||
//implementation "org.webjars:material-design-icons:$materialDesignIconsVersion" | ||
|
||
providedCompile "javax:javaee-api:$javaeeVersion" | ||
compileOnly "javax:javaee-api:$javaeeVersion" | ||
implementation 'org.wildfly.swarm:ejb' | ||
implementation 'org.wildfly.swarm:cdi' | ||
|
||
implementation 'org.wildfly.swarm:logging' | ||
implementation 'org.slf4j:slf4j-api:1.7.25' | ||
implementation "ch.qos.logback:logback-classic:$logbackVersion" | ||
|
||
implementation 'org.wildfly.swarm:jaxrs-jsonp' | ||
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.7' | ||
|
||
implementation 'org.wildfly.swarm:jpa' | ||
implementation 'org.wildfly.swarm:flyway' | ||
implementation 'com.h2database:h2:1.4.196' | ||
|
||
implementation 'io.vavr:vavr:0.9.2' | ||
|
||
testImplementation 'junit:junit:4.12' | ||
testImplementation 'org.assertj:assertj-core:3.11.1' | ||
testImplementation 'org.hamcrest:hamcrest-core:1.3' | ||
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion" | ||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion" | ||
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:4.12.3', { | ||
because 'allows JUnit 3 and JUnit 4 tests to run' | ||
} | ||
testRuntime "org.junit.platform:junit-platform-launcher:$junitPlatformVersion", { | ||
because 'allows tests to run from IDEs that bundle older version of launcher' | ||
} | ||
testCompileOnly 'org.apiguardian:apiguardian-api:1.0.0' | ||
} | ||
|
||
dependencyManagement { | ||
imports { | ||
mavenBom "javax:javaee-api:$javaeeVersion" | ||
mavenBom "org.junit:junit-bom:$junitJupiterVersion" | ||
mavenBom "org.wildfly.swarm:bom:$wildflySwarmVersion" | ||
mavenBom "org.wildfly.swarm:bom-all:$wildflySwarmVersion" | ||
} | ||
} | ||
|
||
test { | ||
useJUnitPlatform { | ||
includeEngines 'junit-jupiter', 'junit-vintage' | ||
} | ||
} | ||
|
||
apply from: "$project.rootDir/gradle/jgiven.gradle" | ||
apply from: "$projectDir/gradle/findbugs.gradle" | ||
apply from: "$projectDir/gradle/docker-compose.gradle" | ||
apply from: "$projectDir/gradle/docs.gradle" | ||
//apply from: "$projectDir/gradle/build-scan.gradle" | ||
|
||
wrapper { | ||
gradleVersion = '4.10.2' | ||
distributionType = 'BIN' | ||
} |
16 changes: 16 additions & 0 deletions
16
generators/app/templates/java-wildfly-swarm/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,16 @@ | ||
version: '2.2' | ||
|
||
services: | ||
|
||
gradle-<%= projectDirectory %>-app: | ||
build: | ||
context: . | ||
dockerfile: gradle/Dockerfile | ||
ports: | ||
- '5005:5005' | ||
- '8080:8080' | ||
networks: [backing-services] | ||
|
||
networks: | ||
backing-services: | ||
driver: bridge |
14 changes: 14 additions & 0 deletions
14
generators/app/templates/java-wildfly-swarm/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,14 @@ | ||
version: '2.2' | ||
|
||
services: | ||
|
||
maven-<%= projectDirectory %>-app: | ||
build: | ||
context: . | ||
dockerfile: .mvn/Dockerfile | ||
ports: ['8080:8080'] | ||
networks: [backing-services] | ||
|
||
networks: | ||
backing-services: | ||
driver: bridge |
Oops, something went wrong.