Files
hello_gitea/scripts/quick-build.sh
Anton Kuznetcov 9da418648c
All checks were successful
Build Builder Docker Image / create-builder-docker-image (push) Successful in 5m42s
changed builder image
2025-07-28 16:02:16 +06:00

19 lines
506 B
Bash

#!/bin/bash
if [ ! -f go.mod ]; then
echo "go.mod not found in current directory"
exit 1
fi
# Проверяем, изменились ли зависимости
if [ ! -f go.sum ] || ! go mod verify >/dev/null 2>&1; then
echo "Dependencies changed, downloading..."
go mod download
fi
# Собираем для указанной платформы
if [ -n "$1" ] && [ -n "$2" ]; then
GOOS=$1 GOARCH=$2 go build -o "hello-api-$1-$2" main.go
else
go build -o hello-api main.go
fi