Restructure

This commit is contained in:
Arnie
2017-12-24 17:35:49 +01:00
parent 9d42de5bb9
commit d9163bcff8
7 changed files with 307 additions and 50 deletions
+22 -7
View File
@@ -1,14 +1,29 @@
#
# Settings
#
all: build publish
# Name of the docker image
APP_NAME := code-formatter
# Select the docker registry to use for the image
DOCKER_REGISTRY := yoursystemcz
# Describe current branch
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
COMMIT = $(shell git rev-parse HEAD)
GIT_TAG = $(shell git describe --tags --exact-match 2>/dev/null)
build:
docker build -t yoursystemcz/code-formatter:latest .
VERSION := $(or $(GIT_TAG),latest)
publish:
docker push yoursystemcz/code-formatter:latest
exec:
docker run --rm -it --entrypoint bash yoursystemcz/code-formatter:latest
all : build release
.PHONY : all
build :
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION) .
release : build
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)