Nethack Launcher
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
876 B

GOC=go build
GOFLAGS=-a -ldflags '-s'
CGOR=CGO_ENABLED=0
5 years ago
OS_PERMS=sudo
5 years ago
NETHACK_DIR=$(shell pwd)/hack
IMAGE_NAME=nethack_launch
all: stat
run:
go run \
nethack-launcher.go
stat:
mkdir -p bin/
$(CGOR) $(GOC) $(GOFLAGS) -o bin/nethack-launcher nethack-launcher.go
dependencies:
go get github.com/gorilla/mux
5 years ago
build_docker:
mkdir -p stage.tmp/
cp deps/Dockerfile stage.tmp/
cp deps/server_config.gcfg stage.tmp/config.gcfg
cp bin/nethack-launcher stage.tmp/
cp deps/redis.conf stage.tmp/
cp deps/run.sh stage.tmp/
cp deps/nethackrc stage.tmp/
cp deps/chowner.sh stage.tmp/
cp deps/run_nethack.sh stage.tmp/
5 years ago
cd stage.tmp/ && \
$(OS_PERMS) docker build -t $(IMAGE_NAME) .
run_docker:
$(OS_PERMS) docker run \
-d \
5 years ago
-p 2222:22 \
5 years ago
--name=nethack \
5 years ago
-v $(NETHACK_DIR):/hack:rw \
5 years ago
--restart always \
$(IMAGE_NAME)
clean:
rm -rf bin/
rm -rf stage.tmp/