From 6457d82fbff3d213338399ebe4431237d06ca112 Mon Sep 17 00:00:00 2001 From: Adrien Nguyen Date: Thu, 29 Apr 2021 01:44:45 +0200 Subject: [PATCH] Setup docker config --- .github/workflows/maven-publish-snapshot.yml | 2 +- KinanCity-core/Dockerfile | 7 +++++-- KinanCity-core/scripts/run.sh | 2 ++ .../src/main/java/com/kinancity/core/KinanCityCli.java | 3 +++ 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 KinanCity-core/scripts/run.sh diff --git a/.github/workflows/maven-publish-snapshot.yml b/.github/workflows/maven-publish-snapshot.yml index 776812e..5b5fc5f 100644 --- a/.github/workflows/maven-publish-snapshot.yml +++ b/.github/workflows/maven-publish-snapshot.yml @@ -25,6 +25,6 @@ jobs: run: mvn -B package --file pom.xml - name: Publish to GitHub Packages Apache Maven - run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml -fae env: GITHUB_TOKEN: ${{ github.token }} diff --git a/KinanCity-core/Dockerfile b/KinanCity-core/Dockerfile index 3a092e6..e82b6b9 100644 --- a/KinanCity-core/Dockerfile +++ b/KinanCity-core/Dockerfile @@ -6,6 +6,9 @@ VOLUME ["/opt/data"] RUN apt-get update && apt-get install -y --no-install-recommends curl wget && rm -rf /var/lib/apt/lists/* # Download last KinanCity core jar -RUN curl -s https://api.github.com/repos/drallieiv/KinanCity/releases | grep "browser_download_url" | grep "KinanCity-core" | grep "jar" | head -n 1 | cut -d '"' -f 4 | xargs wget -O KinanCity-core.jar +RUN curl -s https://api.github.com/repos/drallieiv/KinanCity/releases/latest | grep "browser_download_url" | grep "kinancity-core" | head -n 1 | cut -d '"' -f 4 | xargs wget -O kinancity-core.jar -ENTRYPOINT ["java" "-jar KinanCity-core.jar -o /opt/data/result.csv"] +COPY scripts/run.sh /run.sh +RUN chmod +x /run.sh + +ENTRYPOINT ["/run.sh"] diff --git a/KinanCity-core/scripts/run.sh b/KinanCity-core/scripts/run.sh new file mode 100644 index 0000000..ccfd4a4 --- /dev/null +++ b/KinanCity-core/scripts/run.sh @@ -0,0 +1,2 @@ +#!/bin/sh +java -jar kinancity-core.jar -o /opt/data/result.csv \ No newline at end of file diff --git a/KinanCity-core/src/main/java/com/kinancity/core/KinanCityCli.java b/KinanCity-core/src/main/java/com/kinancity/core/KinanCityCli.java index 61efcc4..70ddc74 100644 --- a/KinanCity-core/src/main/java/com/kinancity/core/KinanCityCli.java +++ b/KinanCity-core/src/main/java/com/kinancity/core/KinanCityCli.java @@ -190,6 +190,9 @@ private static Options setupCliOptions() { options.addOption(CliOptions.CK.asOption()); options.addOption(CliOptions.CP.asOption()); + // Output File + options.addOption(CliOptions.OUTPUT.asOption()); + // Number of Threads options.addOption(CliOptions.NB_THREADS.asOption());