Skip to content

Commit

Permalink
Merge pull request #8 from spotahome/release
Browse files Browse the repository at this point in the history
Add release tasks to Makefile
  • Loading branch information
ese authored Dec 15, 2017
2 parents 6c0b31a + 3496ccd commit 648bcd7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# The following are targers that do not exist in the filesystem as real files and should be always executed by make
.PHONY: default build deps-development docker-build shell run image unit-test test generate go-generate get-deps update-deps
VERSION := 0.1.1

# Name of this service/application
SERVICE_NAME := redisfailover
SERVICE_NAME := redis-operator

# Docker image name for this project
IMAGE_NAME := spotahome/$(SERVICE_NAME)
Expand All @@ -20,7 +21,7 @@ DOCKER := $(shell command -v docker)
UID := $(shell id -u)

# Commit hash from git
COMMIT=$(shell git rev-parse --short HEAD)
COMMIT=$(shell git rev-parse HEAD)

# Branch from git
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
Expand Down Expand Up @@ -80,6 +81,15 @@ image: deps-development
-t $(REPOSITORY):$(BRANCH) \
-f $(APP_DIR)/Dockerfile \
.
tag:
git tag $(VERSION)

publish:
@COMMIT_VERSION="$$(git rev-list -n 1 $(VERSION))"; \
docker tag $(REPOSITORY):"$$COMMIT_VERSION" $(REPOSITORY):$(VERSION)
docker push $(REPOSITORY):$(VERSION)

release: tag image publish

# Test stuff in dev
unit-test: docker-build
Expand Down

0 comments on commit 648bcd7

Please sign in to comment.