Skip to content

Commit

Permalink
Solved problem fir qanary commons version
Browse files Browse the repository at this point in the history
  • Loading branch information
dschiese committed Oct 14, 2023
1 parent 4783cdb commit e13e177
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ RUN git clone https://github.com/WDAqua/Qanary.git

WORKDIR /app/Qanary/qanary_commons
RUN mvn clean install -DskipTests
COPY extract_commons_version.sh /app/extract_commons_version.sh
COPY dockerfile_scripts/extract_commons_version.sh /app/extract_commons_version.sh
RUN chmod +x /app/extract_commons_version.sh
RUN /app/extract_commons_version.sh

WORKDIR /app
COPY Qanary/qa_commons/target/qa.commons.jar .

#Build Stage
FROM maven:latest AS build
WORKDIR /app
Expand All @@ -25,10 +22,9 @@ COPY ./pom.xml ./pom.xml
COPY --from=qanary_commons /app/qa.commons.jar .
COPY --from=qanary_commons /app/jar_version .
# Installing the qa_commons dependency
COPY install_commons_dependency.sh /app/install_commons_dependency.sh
COPY dockerfile_scripts/install_commons_dependency.sh /app/install_commons_dependency.sh
RUN chmod +x /app/install_commons_dependency.sh
RUN /app/install_commons_dependency.sh
RUN mvn install:install-file -Dfile=qa.commons.jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion="$JAR_VERSION" -Dpackaging=jar
# build the app
RUN mvn clean install

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cd target && ls
#JAR_VERSION=$(echo $JAR_FILE | grep -oP 'qa.commons-\K\d+\.\d+\.\d+')
JAR_FILE=$(find . -maxdepth 1 -type f -name "qa.commons-[0-9].[0-9].[0-9].jar")
JAR_VERSION=$(echo $JAR_FILE | grep -oP 'qa.commons-\K\d+\.\d+\.\d+')
mv qa.commons-$JAR_VERSION.jar qa.commons.jar
mv qa.commons-$JAR_VERSION.jar qa.commons.jar # Rename commons jar
cp qa.commons.jar /app
cd /app
echo $JAR_VERSION > jar_version
echo $JAR_VERSION > jar_version # Create file involving jar-file
4 changes: 4 additions & 0 deletions dockerfile_scripts/install_commons_dependency.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
JAR_VERSION=$(cat jar_version | xargs)

# Install commons-dependency
mvn install:install-file -Dfile=qa.commons.jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion=$JAR_VERSION -Dpackaging=jar
3 changes: 0 additions & 3 deletions install_commons_dependency.sh

This file was deleted.

0 comments on commit e13e177

Please sign in to comment.