13 lines
396 B
Shell
Executable file
13 lines
396 B
Shell
Executable file
# deploy.sh
|
|
#!/bin/bash
|
|
set -e
|
|
|
|
source .env
|
|
|
|
CC=x86_64-linux-musl-gcc CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
|
|
go build -ldflags='-linkmode external -extldflags "-static"' \
|
|
-o ./build/ronbun ./cmd/web/
|
|
|
|
ssh ${DEPLOY_USER}@${DEPLOY_HOST} 'supervisorctl stop ronbun'
|
|
scp build/ronbun ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}
|
|
ssh ${DEPLOY_USER}@${DEPLOY_HOST} 'supervisorctl restart ronbun'
|