Files
go-service/build.sh

22 lines
398 B
Bash

#!/usr/bin/env bash
set -e
APP_NAME="gpio-monitor-server"
CMD_PATH="./cmd/server"
BUILD_DIR="./build"
echo ">> Cleaning old build..."
rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR}
echo ">> Downloading dependencies..."
go mod tidy
echo ">> Building ${APP_NAME}..."
GOOS=linux GOARCH=arm64 go build -o ${BUILD_DIR}/${APP_NAME} ${CMD_PATH}
echo ">> Build complete:"
ls -lh ${BUILD_DIR}/${APP_NAME}