From 50a6a1ee40495f45bab0233872d11169bb607a83 Mon Sep 17 00:00:00 2001 From: koehn Date: Sat, 24 Nov 2018 17:49:52 +0000 Subject: [PATCH 1/4] added docker support to `make release` --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 126bbb1..a899879 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ GOBUILD=$(GOCMD) build $(LDFLAGS) GOTEST=$(GOCMD) test $(LDFLAGS) GOGET=$(GOCMD) get BINARY_NAME=writefreely +IMAGE_NAME=writeas/writefreely all : build @@ -53,7 +54,8 @@ release : clean ui rm build/$(BINARY_NAME) $(MAKE) build-windows cp cmd/writefreely/$(BINARY_NAME).exe build - cd build; zip -r ../$(BINARY_NAME)_$(GITREV)_windows_amd64.zip ./* + cd build; zip -r ../$(BINARY_NAME)_$(GITREV)_windows_amd64.zip ./*; cd .. + docker build -t $(IMAGE_NAME):latest -t $(IMAGE_NAME):$(GITREV) . ui : force_look cd less/; $(MAKE) $(MFLAGS) From 695bc796963916d48166e532cd08b5c027d4fbcf Mon Sep 17 00:00:00 2001 From: koehn Date: Sat, 24 Nov 2018 17:57:01 +0000 Subject: [PATCH 2/4] extracted docker command a la `go` and `make` --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a899879..fa7989d 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ GOBUILD=$(GOCMD) build $(LDFLAGS) GOTEST=$(GOCMD) test $(LDFLAGS) GOGET=$(GOCMD) get BINARY_NAME=writefreely +DOCKERCMD=docker IMAGE_NAME=writeas/writefreely all : build @@ -55,7 +56,7 @@ release : clean ui $(MAKE) build-windows cp cmd/writefreely/$(BINARY_NAME).exe build cd build; zip -r ../$(BINARY_NAME)_$(GITREV)_windows_amd64.zip ./*; cd .. - docker build -t $(IMAGE_NAME):latest -t $(IMAGE_NAME):$(GITREV) . + $(DOCKERCMD) build -t $(IMAGE_NAME):latest -t $(IMAGE_NAME):$(GITREV) . ui : force_look cd less/; $(MAKE) $(MFLAGS) From 402f66770e6fdca3f6bf49a49f978234fab2dd26 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Sat, 24 Nov 2018 14:11:39 -0500 Subject: [PATCH 3/4] Move docker build to `make build-docker` --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fa7989d..cbe27f1 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,9 @@ build-windows: deps build-darwin: deps cd cmd/writefreely; GOOS=darwin GOARCH=amd64 $(GOBUILD) -v +build-docker : + $(DOCKERCMD) build -t $(IMAGE_NAME):latest -t $(IMAGE_NAME):$(GITREV) . + test: $(GOTEST) -v ./... @@ -55,8 +58,8 @@ release : clean ui rm build/$(BINARY_NAME) $(MAKE) build-windows cp cmd/writefreely/$(BINARY_NAME).exe build - cd build; zip -r ../$(BINARY_NAME)_$(GITREV)_windows_amd64.zip ./*; cd .. - $(DOCKERCMD) build -t $(IMAGE_NAME):latest -t $(IMAGE_NAME):$(GITREV) . + cd build; zip -r ../$(BINARY_NAME)_$(GITREV)_windows_amd64.zip ./* + $(MAKE) build-docker ui : force_look cd less/; $(MAKE) $(MFLAGS) From 7bbc1b4b4717c64dc82cc3a4a8b8c23e40ef3049 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Sat, 24 Nov 2018 14:18:11 -0500 Subject: [PATCH 4/4] Add `make release-docker` --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index cbe27f1..33eb3ae 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,10 @@ release : clean ui cp cmd/writefreely/$(BINARY_NAME).exe build cd build; zip -r ../$(BINARY_NAME)_$(GITREV)_windows_amd64.zip ./* $(MAKE) build-docker + $(MAKE) release-docker + +release-docker : + $(DOCKERCMD) push $(IMAGE_NAME) ui : force_look cd less/; $(MAKE) $(MFLAGS)