Files
neomovies-api/build.sh
Foxix 1f525a80d6 Update 11 files
- /src/index.js
- /src/routes/movies.js
- /src/config/tmdb.js
- /src/utils/health.js
- /src/utils/date.js
- /clean.sh
- /package.json
- /package-lock.json
- /vercel.json
- /build.sh
- /README.md
2025-01-03 19:10:34 +00:00

27 lines
901 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Создаем директорию для сборки
BUILD_DIR="$HOME/build_tmp"
mkdir -p "$BUILD_DIR"
# Скачиваем и устанавливаем Go во временную директорию
curl -L https://go.dev/dl/go1.21.5.linux-amd64.tar.gz | tar -C "$BUILD_DIR" -xz
# Настраиваем переменные окружения для Go
export PATH="$BUILD_DIR/go/bin:$PATH"
export GOPATH="$BUILD_DIR/go_path"
export GOCACHE="$BUILD_DIR/go-build"
export GOMODCACHE="$BUILD_DIR/go-mod"
# Создаем необходимые директории
mkdir -p "$GOPATH"
mkdir -p "$GOCACHE"
mkdir -p "$GOMODCACHE"
# Собираем приложение с отключенным CGO и уменьшенным бинарником
cd "$HOME/neomovies-api"
CGO_ENABLED=0 go build -ldflags="-s -w" -o app
# Очищаем после сборки
rm -rf "$BUILD_DIR"