Build Script

This commit is contained in:
Daniel Legt 2024-01-20 02:11:59 +02:00
parent 21f24899a2
commit 5cc58c7d53
2 changed files with 18 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
snapshots.dat snapshots.dat
.env .env
dist

17
build.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
APP_NAME="drive-health"
DIST_DIR="dist"
# Create the dist directory if it doesn't exist
mkdir -p $DIST_DIR
# Build the application
echo "Building the application..."
GOOS=linux GOARCH=amd64 go build -o $DIST_DIR/$APP_NAME
# Copy additional resources (like .env, static files, templates) to the dist directory
echo "Copying additional resources..."
cp -r .env static templates $DIST_DIR/
echo "Compilation and packaging completed."