forked from deis/slugbuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (44 loc) · 1.74 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
SHORT_NAME ?= slugbuilder
export GO15VENDOREXPERIMENT=1
# Note that Minio currently uses CGO.
LDFLAGS := "-s -X main.version=${VERSION}"
IMAGE_PREFIX ?= deis
BINDIR := ./rootfs/bin
include versioning.mk
SHELL_SCRIPTS = $(wildcard _scripts/*.sh) $(wildcard rootfs/bin/*_object) $(wildcard rootfs/bin/*_cache) rootfs/bin/normalize_storage $(wildcard rootfs/builder/*)
# The following variables describe the containerized development environment
# and other build options
DEV_ENV_IMAGE := quay.io/deis/go-dev:0.20.0
DEV_ENV_WORK_DIR := /go/src/${REPO_PATH}
DEV_ENV_CMD := docker run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
DEV_ENV_CMD_INT := docker run -it --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
all: build docker-build docker-push
bootstrap:
@echo Nothing to do.
build:
@echo Nothing to do.
docker-build:
docker build -t smothiki/slugrunner:repo rootfs
# docker tag ${IMAGE} ${MUTABLE_IMAGE}
deploy: docker-build docker-push
kube-pod: kube-service
kubectl create -f ${POD}
kube-secrets:
- kubectl create -f ${SEC}
secrets:
perl -pi -e "s|access-key-id: .+|access-key-id: ${key}|g" ${SEC}
perl -pi -e "s|access-secret-key: .+|access-secret-key: ${secret}|g" ${SEC}
echo ${key} ${secret}
kube-service: kube-secrets
- kubectl create -f ${SVC}
kube-clean:
- kubectl delete rc deis-${SHORT_NAME}-rc
test: test-style test-unit test-functional
test-style:
${DEV_ENV_CMD} shellcheck $(SHELL_SCRIPTS)
test-unit:
docker run --entrypoint /usr/bin/env ${IMAGE} python3 -m unittest procfile
test-functional:
@echo "Implement functional tests in _tests directory"
.PHONY: all bootstrap build docker-build docker-push deploy kube-pod kube-secrets \
secrets kube-service kube-clean test