intelligentTransportation_back/deploy.sh

21 lines
555 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.

#!/usr/bin/env bash
# 在 citytranapidemo 项目根目录编译,输出到 ../citytrandemo/publish并复制运行所需目录。
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OUT="${ROOT}/../citytrandemo/publish"
BIN_NAME="${BIN_NAME:-citytranapidemo}"
mkdir -p "${OUT}"
echo "==> 编译: ${ROOT} -> ${OUT}/${BIN_NAME}"
(
cd "${ROOT}"
go build -o "${OUT}/${BIN_NAME}" ./cmd/server
)
echo "==> 复制 configs, migrations, cmd"
cp -r "${ROOT}/configs" "${ROOT}/migrations" "${ROOT}/cmd" "${OUT}/"
echo "完成: ${OUT}"