-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sh
More file actions
28 lines (21 loc) · 696 Bytes
/
build.sh
File metadata and controls
28 lines (21 loc) · 696 Bytes
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
#!/bin/bash
# Script to build and run the Docker container for compiling SimpleItemGenerator with shadowJar
IMAGE_NAME="simpleitemgenerator-builder"
OUTPUT_DIR="./docker-output"
echo "Building Docker image: $IMAGE_NAME"
docker build -t $IMAGE_NAME .
if [ $? -ne 0 ]; then
echo "Failed to build Docker image"
exit 1
fi
echo "Creating output directory: $OUTPUT_DIR"
mkdir -p $OUTPUT_DIR
echo "Running Docker container to build the project"
docker run --rm -v "$(pwd)/$OUTPUT_DIR:/app/build/libs" $IMAGE_NAME
if [ $? -eq 0 ]; then
echo "Build completed successfully!"
echo "Check the $OUTPUT_DIR directory for the built JAR files."
else
echo "Build failed!"
exit 1
fi