Skip to content

Commit

Permalink
Merge pull request #15 from TEIC/hotfix/current-war-in-dockerbuild
Browse files Browse the repository at this point in the history
Hotfix/current war in dockerbuild
  • Loading branch information
anneferger committed May 2, 2022
2 parents e45be73 + 95abeae commit 5f0cc79
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/maven_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Download artifact
uses: actions/download-artifact@v2
with:
name: teigarage.war
path: target

# use the current user to log into the
# GitHub container registry
Expand Down Expand Up @@ -79,3 +85,5 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDTYPE=github
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ARG VERSION_STYLESHEET=latest
ARG VERSION_ODD=latest
ARG WEBSERVICE_ARTIFACT=https://nightly.link/TEIC/TEIGarage/workflows/maven_docker/dev/artifact.zip
ARG WEBCLIENT_ARTIFACT=https://nightly.link/TEIC/ege-webclient/workflows/maven/main/artifact.zip
ARG BUILDTYPE=local

ENV CATALINA_WEBAPPS ${CATALINA_HOME}/webapps
ENV OFFICE_HOME /usr/lib/libreoffice
Expand Down Expand Up @@ -55,16 +56,20 @@ COPY log4j.xml /var/cache/oxgarage/log4j.xml

# download artifacts to /tmp and deploy them at ${CATALINA_WEBAPPS}
# these war-files are zipped so we need to unzip them twice
RUN rm -Rf ${CATALINA_WEBAPPS}/ROOT \
&& curl -Ls ${WEBSERVICE_ARTIFACT} -o /tmp/teigarage.zip \
RUN if [ "$BUILDTYPE" = "github" ] ; then \
cp /target/teigarage.war -d /tmp/; \
else \
curl -Ls ${WEBSERVICE_ARTIFACT} -o /tmp/teigarage.zip \
&& unzip -q /tmp/teigarage.zip -d /tmp/; \
fi \
&& unzip -q /tmp/teigarage.war -d ${CATALINA_WEBAPPS}/ege-webservice/ \
&& rm -Rf ${CATALINA_WEBAPPS}/ROOT \
&& curl -Ls ${WEBCLIENT_ARTIFACT} -o /tmp/webclient.zip \
&& unzip -q /tmp/webclient.zip -d /tmp/ \
&& unzip -q /tmp/teigarage.zip -d /tmp/ \
&& unzip -q /tmp/ege-webclient.war -d ${CATALINA_WEBAPPS}/ROOT/ \
&& unzip -q /tmp/teigarage.war -d ${CATALINA_WEBAPPS}/ege-webservice/ \
&& cp ${CATALINA_WEBAPPS}/ege-webservice/WEB-INF/lib/oxgarage.properties /etc/ \
&& rm /tmp/*.war \
&& rm /tmp/*.zip \
&& rm -f /tmp/*.war \
&& rm -f /tmp/*.zip \
&& chmod 755 /my-docker-entrypoint.sh

#check if the version of stylesheet version is supplied, if not find out latest version
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pl.psnc.dl.ege.webapp</groupId>
<artifactId>teigarage</artifactId>
<version>0.6.0-c602608</version>
<version>0.6.0</version>
<packaging>war</packaging>
<name>TEI Garage</name>
<properties>
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/pl/psnc/dl/ege/webapp/servlet/InfoServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
try {
//create info json object
JSONObject json_info = new JSONObject();
json_info.put("version", getVersion(request));
json_info.put("serverinfo", serverInfo);
json_info.put("webservice-version", getVersion(request));
json_info.put("server-version", serverInfo);
json_info.put("os-info", System.getProperty("os.name") + " " + System.getProperty("os.version"));
json_info.put("java-version", Runtime.version().toString());
//resolve request and catch any errors
RequestResolver rr = new InfoRequestResolver(request,
Method.GET);
//print available validation options
//print available info
printInfo(response, rr, json_info);
}
catch (RequestResolvingException ex) {
Expand Down Expand Up @@ -84,6 +86,8 @@ public synchronized String getVersion(HttpServletRequest request) {
return version;
}



/*
* Print info response
*/
Expand Down

0 comments on commit 5f0cc79

Please sign in to comment.