Skip to content

Commit

Permalink
Merged in SHIBUI-1716 (pull request #460)
Browse files Browse the repository at this point in the history
SHIBUI-1716 - Unified WAR deployment unit
  • Loading branch information
dima767 committed Feb 4, 2020
2 parents 299f074 + f11b5d5 commit a3ef5fb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pipeline {
steps {
sh '''
docker stop shibui || true && docker rm shibui || true
docker run -d --restart always --name shibui -p 8080:8080 -v /etc/shibui:/conf -v /etc/shibui/application.yml:/application.yml -m 2GB --memory-swap=4GB unicon/shibui:latest /usr/bin/java -Xmx1G -jar app.jar
docker run -d --restart always --name shibui -p 8080:8080 -v /etc/shibui:/conf -v /etc/shibui/application.yml:/application.yml -m 2GB --memory-swap=4GB --entrypoint /usr/bin/java unicon/shibui:latest -Xmx1G -jar app.war
'''
}
}
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# shibui

For more information, see `docs`

## Requirements_

* Java 8 (note that ONLY Java 8 is supported at this time; other later versions might work)
Expand Down Expand Up @@ -39,7 +37,7 @@ For complete information on overriding default configuration, see [https://docs.

### Deploying as a WAR

The application can be deployed as a WAR file in a Java Servlet 3.0 container. Currently, the application must be run in the root context.
The application can be deployed as a WAR file in a Java Servlet 3.0 container.

To override default configuration, see [https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html].
The easiest way to do this in a servlet container is through the use of system properties
Expand Down
4 changes: 2 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM gcr.io/distroless/java
ARG JAR_FILE

COPY loader.properties loader.properties
COPY ${JAR_FILE} app.jar
COPY ${JAR_FILE} app.war

EXPOSE 8080

ENTRYPOINT ["/usr/bin/java", "-jar", "app.jar"]
ENTRYPOINT ["/usr/bin/java", "-jar", "app.war"]
27 changes: 4 additions & 23 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,32 +89,13 @@ bootWar {
"Implementation-Version" : "${project.version}"
)
}
from(tasks.findByPath(':ui:npm_run_buildProd').outputs) {
//Copying into this particular classpath location due too
//deployment to external Tomcat would not work with /public location
//This way, it works with both embedded and extarnal Tomcat
into 'WEB-INF/classes/resources'
}
archiveName = "${baseName}-${version}.war"
}

bootJar.dependsOn ':ui:npm_run_buildProd'
bootJar.baseName = 'shibui'
bootJar {
manifest {
attributes(
"Manifest-Version" : "1.0",
"Implementation-Version" : "${project.version}",
'Main-Class': 'org.springframework.boot.loader.PropertiesLauncher'
)
}
from(tasks.findByPath(':ui:npm_run_buildProd').outputs) {
//Copying into this particular classpath location due too
//deployment to external Tomcat would not work with /public location
//This way, it works with both embedded and external Tomcat
into 'WEB-INF/classes/resources'
}
archiveName = "${baseName}-${version}.jar"
archiveName = "${baseName}-${version}.war"
}

springBoot {
Expand Down Expand Up @@ -366,15 +347,15 @@ jacocoTestReport {
}
}

tasks.docker.dependsOn tasks.bootJar
tasks.docker.dependsOn tasks.bootWar
docker {
name 'unicon/shibui'
tags 'latest'
pull true
noCache true
files tasks.bootJar.outputs
files tasks.bootWar.outputs
files 'src/main/docker-files/loader.properties'
buildArgs(['JAR_FILE': "shibui-${version}.jar"])
buildArgs(['JAR_FILE': "shibui-${version}.war"])
}

tasks.dockerRun.dependsOn tasks.docker
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ githubRelease {
token project.'i2.github.token'
owner project.'i2.github.owner'
repo project.'i2.github.repo'
releaseAssets project('backend').getTasksByName('bootWar', false).outputs, project('backend').getTasksByName('bootJar', false).outputs
releaseAssets project('backend').getTasksByName('bootWar', false).outputs
overwrite true
apiEndpoint project.'i2.github.apiEndpoint'
}
Expand Down

0 comments on commit a3ef5fb

Please sign in to comment.