-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
51 lines (40 loc) · 1.19 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
DOCKER_REPO := ddazza
IMAGE_NAME := renogen
DOCKER_TAG ?= latest
# deps:
# @which docker git
help:
@echo 'Usage:'
@echo ' make COMMAND'
@echo ''
@echo 'Command list:'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help
.DEFAULT_GOAL := help
build: build-gem build-image ## Build all
build-image: Dockerfile ## Build docker image
docker build -t $(IMAGE_NAME) .
@echo
.PHONY: build-image
build-gem: renogen.gemspec ## Build ruby gem
gem build renogen.gemspec
@echo
.PHONY: build-gem
tag: build tag-git tag-docker-latest tag-docker-version ## Create all tags
tag-git: ## git tag
@echo 'create git tag v$(TAG)'
git tag "v$(TAG)"
.PHONY: tag-git
tag-docker-latest:
@echo 'create tag latest'
docker tag $(IMAGE_NAME) $(DOCKER_REPO)/$(IMAGE_NAME):latest
.PHONY: tag-docker-latest
tag-docker-version: ## docker tag
@echo 'create tag $(TAG)'
docker tag $(IMAGE_NAME) $(DOCKER_REPO)/$(IMAGE_NAME):$(TAG)
.PHONY: tag-docker-version
push:
git push origin "v$(TAG)"
gem push renogen-$(TAG).gem
docker push $(DOCKER_REPO)/$(IMAGE_NAME):latest
docker push $(DOCKER_REPO)/$(IMAGE_NAME):$(TAG)