Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/current war in dockerbuild #15

Merged
merged 3 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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