Commit 721cd2e2 authored by Mo Firouz's avatar Mo Firouz
Browse files

Update health endpoint to be on the main server port. Streamline Docker releases. Merged #63

parent 52cf1829
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -11,6 +11,8 @@ The format is based on [keep a changelog](http://keepachangelog.com/) and this p
- Updated Zap logging library to latest stable version.
- Command line `--verbose` flag no longer alters the logging output to print to both terminal and file.
- Log output format is set to JSON.
- Updated health endpoint to be on the '/' of the main server port.
- Streamline Docker image releases.

### Fixed
- Fix issue where ping tickers could not have stopped correctly under some circumstances.
+16 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ BINNAME := nakama
VERSION := 0.13.0-dev
BUILDDIR := build
COMMITID := $(shell git rev-parse --short HEAD 2>/dev/null || echo nosha)
DOCKERDIR := install/docker/nakama

PROTOC ?= protoc
PROTOCFLAGS := -I . -I vendor --gogoslick_out=plugins=grpc:.
@@ -140,3 +141,18 @@ dbsetup:
.PHONY: dbreset
dbreset:
	./${BUILDDIR}/dev/${BINNAME} migrate down --limit 0

.PHONY: dockerbuild
dockerbuild:
	docker build --build-arg version=${VERSION} ${DOCKERDIR}

.PHONY: docker
docker: dockerbuild
	$(eval IMAGEID := $(shell docker images --filter "label=version=${VERSION}" --format "{{.ID}}"))
	docker tag ${IMAGEID} heroiclabs/nakama:${VERSION}
	docker tag ${IMAGEID} heroiclabs/nakama:latest

.PHONY: dockerpush
dockerpush:
	docker push heroiclabs/nakama:${VERSION}
	docker push heroiclabs/nakama:latest
+9 −2
Original line number Diff line number Diff line
@@ -63,7 +63,14 @@ The development team use these steps to build and upload a release.

5. Login and access the [new draft release](https://github.com/heroiclabs/nakama/releases) on GitHub. Repeat the changelog in the release description. Then publish the release.

6. Add new `## [Unreleased]` section to start of `CHANGELOG.md`. Increment and add suffix `"-dev"` to version in `Makefile` and commit. i.e. `VERSION := 0.10.0` should now become `VERSION := 0.11.0-dev`.
6. Create Docker image and push to Docker Hub. 

  ```
  docker login
  make docker dockerpush
  ```

7. Add new `## [Unreleased]` section to start of `CHANGELOG.md`. Increment and add suffix `"-dev"` to version in `Makefile` and commit. i.e. `VERSION := 0.10.0` should now become `VERSION := 0.11.0-dev`.

   ```
   git add Makefile CHANGELOG.md
+2 −0
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@ To stop and purge all stored data, containers, and images from your machine. Run

## Build and deploy the Docker image

#### You can use the makefile to build, tag and release Docker images. The following is the manual way of doing achieving the same result.

1. To build the image locally. Setup a local copy of the codebase. Run the following command (in the same directory as this README):

   If you have updated the version number in the `Dockerfile` also update it in the command below:
+7 −1
Original line number Diff line number Diff line
@@ -2,6 +2,11 @@ FROM ubuntu:xenial

MAINTAINER Heroic Labs <support@heroiclabs.com>

ARG version

LABEL version=$version
LABEL description="Distributed server for social and realtime games and apps."

RUN mkdir -p /nakama
RUN mkdir -p /nakama/data/log/
RUN touch /nakama/data/log/nakama.log
@@ -13,7 +18,8 @@ RUN ln -sf /dev/stdout data/log/nakama.log

RUN apt-get update; apt-get install -y curl

RUN curl -sL https://github.com/heroiclabs/nakama/releases/download/v0.12.1/nakama-0.12.1-linux-amd64.tar.gz | tar xz
RUN echo "Fetching https://github.com/heroiclabs/nakama/releases/download/v$version/nakama-$version-linux-amd64.tar.gz ..."
RUN curl -sL https://github.com/heroiclabs/nakama/releases/download/v$version/nakama-$version-linux-amd64.tar.gz | tar xz

EXPOSE 7350 7351

Loading