-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
21 lines (18 loc) · 729 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SHELL:=/bin/bash
GIT_SHA ?= $(shell git rev-parse HEAD)
SEMVER := "0.1.0"
TINYSHA ?= $(shell git rev-parse HEAD | cut -c 1-8)
.PHONY: docker.build
docker.build:
docker build -t $(TRAVIS_REPO_SLUG):$(GIT_SHA) .
.PHONY: docker
docker: docker.build
docker login -u $(DOCKER_USER) -p $(DOCKER_PASSWORD) $(REGISTRY_PROVIDER)
docker tag $(TRAVIS_REPO_SLUG):$(GIT_SHA) $(REPOSITORY_NAME):latest
docker tag $(TRAVIS_REPO_SLUG):$(GIT_SHA) $(REPOSITORY_NAME):build-$(GIT_SHA)
docker tag $(TRAVIS_REPO_SLUG):$(GIT_SHA) $(REPOSITORY_NAME):$(SEMVER)-$(TINYSHA)
docker push $(REPOSITORY_NAME):latest
docker push $(REPOSITORY_NAME):build-$(GIT_SHA)
docker push $(REPOSITORY_NAME):$(SEMVER)-$(TINYSHA)
.PHONY: default
default: docker