-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (38 loc) · 1.38 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
CONTAINER_NAME := gitlab-migrate
DOCKER_REGISTRY := docker.artifactory.efr.open.ru
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(shell pwd)
IMG_VER := $(shell cat ${CURRENT_DIR}/VERSION)
DOCKERFILE := ${CURRENT_DIR}/Dockerfile
K8S := ${CURRENT_DIR}/manifests/
NAMESPACE := gitlab-migrate
.DEFAULT_GOAL: usage
.PHONY: usage
usage:
@echo "Use one of following commands:"
@echo "\tmake all - build and push Gitlab-Migrate Utility image"
@echo "\tmake build - build Gitlab-Migrate Utility image"
@echo "\tmake push - push Gitlab-Migrate Utility image"
@echo "\tmake apply - deploy Gitlab-Migrate Utility to k8s cluster"
@echo "\tmake delete - delete Gitlab-Migrate Utility from k8s cluster"
@echo "\tmake debug - using configuration:"
.PHONY: debug
debug:
@echo "Using following configuration:"
@echo "\tMKFILE_PATH: ${CONTAINER_NAME}"
@echo "\tDOCKER_REGISTRY: ${DOCKER_REGISTRY}"
@echo "\tMKFILE_PATH: ${MKFILE_PATH}"
@echo "\tCURRENT_DIR: ${CURRENT_DIR}"
@echo "\tIMG_VER: ${IMG_VER}"
@echo "\tDOCKERFILE: ${DOCKERFILE}"
@echo "\tK8S: ${K8S}"
@echo "\tNAMESPACE: ${NAMESPACE}"
all: build push
build:
docker build --pull -f ${DOCKERFILE} . -t ${DOCKER_REGISTRY}/${CONTAINER_NAME}:${IMG_VER}
push:
docker push ${DOCKER_REGISTRY}/${CONTAINER_NAME}:${IMG_VER}
apply:
kubectl -n ${NAMESPACE} apply -R -f ${K8S}
delete:
kubectl delete namespaces ${NAMESPACE}