Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

deployment

FND edited this page Apr 2, 2015 · 9 revisions

assumptions:

  • Naveed resides in ~/naveed
  • Go was installed to ~/go
  • custom GOPATH to avoid global packages
  • default configuration (host, port etc. as per naveed.ini)
  • served via reverse proxy (thus internal vs. external host in configuration)

(re)start script:

#!/usr/bin/env sh

set -e
set -x

export GOROOT="$HOME/go"
export PATH="$PATH:$GOROOT/bin"
export GOPATH="$HOME/naveed/lib"
export NAVEED_USERS_URL="https://example.org/members/"
export NAVEED_USERS_USERNAME="naveed"
export NAVEED_USERS_PASSWORD="S33KR1T"

cd "$HOME/naveed"

kill `cat server.pid` || true
rm server.pid || true

mkdir -p lib/src
ln -s ../../naveed lib/src/naveed || true
go get github.com/gorilla/mux
go get github.com/BurntSushi/toml

mkdir -p dist
go build -o dist/naveed main.go
nohup ./dist/naveed &
echo $! > server.pid
Clone this wiki locally