Skip to content

Commit

Permalink
Adding convenience commands to Makefile for building and running dock…
Browse files Browse the repository at this point in the history
…er image locally (#207)

* Adding convenience commands to Makefile for building and running docker
image locally

* Changing docker make commands to use hyphens instead of underscores to
match existing conventions.
Removed unnecessary docker comment.
Moved .PHONY directives to be colocated to their respective targets for
better maintenance/management.

* Fixing misspelled Make command for `docket-run` to `docker-run`
  • Loading branch information
joshuajlai authored and brandur-stripe committed Jan 17, 2020
1 parent 384d68c commit b1cd488
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
GIT_COMMITSHA = $(shell git rev-parse HEAD)
IMAGE_NAME = "stripemock/stripe-mock"

all: test vet lint check-gofmt

check-gofmt:
Expand All @@ -13,3 +16,11 @@ test:

vet:
go vet ./...

docker-build:
docker build -t "$(IMAGE_NAME):latest" -t "$(IMAGE_NAME):$(GIT_COMMITSHA)" .
.PHONY: docker-build

docker-run:
docker run --rm -it -p 12111-12112:12111-12112 "$(IMAGE_NAME):latest"
.PHONY: docker-run

0 comments on commit b1cd488

Please sign in to comment.