feat: update java web demo

This commit is contained in:
zhanghelong 2021-08-24 19:32:56 +08:00
parent 01fa619887
commit 54e7f0dba1
4 changed files with 13 additions and 17 deletions

6
Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM adoptopenjdk/openjdk8
RUN mkdir /app
WORKDIR /tmp/build
COPY ./target/web-svc-demo-0.0.1-SNAPSHOT.jar ./
ENTRYPOINT java -jar web-svc-demo-0.0.1-SNAPSHOT.jar

View File

@ -2,11 +2,12 @@
set -ex
PROJECT_PTAH=$(pwd)
BUILD_VERSION="0.0.1-SNAPSHOT"
MODULE_PATH="./web-svc-demo"
cd $MODULE_PATH || exit
./gradlew build
mkdir output
cp "./build/libs/web-svc-demo-$BUILD_VERSION.jar" ./output/app.jar
mkdir "$PROJECT_PTAH/target"
cp "./build/libs/web-svc-demo-$BUILD_VERSION.jar" "$PROJECT_PTAH/target/app.jar"

View File

@ -1,9 +1,5 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
set -ex
MODULE_PATH="./web-svc-demo"
cd $MODULE_PATH || exit
./gradlew clean
if [ -d "./target" ]; then
rm -rf ./target
fi

View File

@ -1,7 +0,0 @@
#!/usr/bin/env sh
set -ex
MODULE_PATH="/tmp/build/web-svc-demo"
cp "$MODULE_PATH/output/*" /app/