server: add make commands to build and push Docker image
This CL adds a Makefile with commands to build the Docker image and push
it to the internal docker registry.
Change-Id: I7bed046b1287617b26fa6eee7a4d05ae695323a7
diff --git a/cmd/server/Makefile b/cmd/server/Makefile
new file mode 100644
index 0000000..7cc7c1b
--- /dev/null
+++ b/cmd/server/Makefile
@@ -0,0 +1,12 @@
+MUTABLE_VERSION ?= latest
+VERSION ?= $(shell git rev-parse --short HEAD)
+
+IMAGE_INTERNAL := docker-registry.corp.avm99963.com/twpt-server
+
+docker-internal: Dockerfile
+ docker build --force-rm -f Dockerfile --tag $(IMAGE_INTERNAL):$(VERSION) ../..
+ docker tag $(IMAGE_INTERNAL):$(VERSION) $(IMAGE_INTERNAL):$(MUTABLE_VERSION)
+
+push-internal: docker-internal
+ docker push $(IMAGE_INTERNAL):$(VERSION)
+ docker push $(IMAGE_INTERNAL):$(MUTABLE_VERSION)