-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-web-server.sh
executable file
·37 lines (26 loc) · 1.03 KB
/
build-web-server.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if [[ -z "$BUILD__DOCKER_APP_NAME" ]]; then
echo "Error: Missing 'BUILD__DOCKER_APP_NAME' env var." >&2
exit 1
fi
if [[ -z "$BUILD__DOCKER_TAG" ]]; then
echo "Error: Missing 'BUILD__DOCKER_TAG' env var." >&2
exit 1
fi
BUILD__DOCKERFILE_SCRIPT="""
FROM ubuntu:22.04
RUN apt-get update && \
apt-get install -y openjdk-11-jdk && \
apt-get clean
WORKDIR /app
COPY harness-web-app-template/res res
COPY harness-web-app-template/modules/web-server/target/artifacts/harness-web-app-template--web-server--$BUILD__DOCKER_TAG.jar web-server.jar
CMD [\"java\", \"-jar\", \"web-server.jar\", \"-C=env:APP_CONFIG\", \"--\", \"server\"]
"""
BUILD__DOCKERFILE_TEMPFILE=$(mktemp --tmpdir=.)
echo "$BUILD__DOCKERFILE_SCRIPT" >> $BUILD__DOCKERFILE_TEMPFILE
export WEB_SERVER_VERSION="$BUILD__DOCKER_TAG"
sbt \
"harness-web-app-template--ui-web/webComp --full" \
harness-web-app-template--web-server/assembly
docker build --file "$BUILD__DOCKERFILE_TEMPFILE" -t "$BUILD__DOCKER_APP_NAME:$BUILD__DOCKER_TAG" .
rm $BUILD__DOCKERFILE_TEMPFILE