1- # Short name: Short name, following [a-zA-Z_], used all over the place.
2- # Some uses for short name:
3- # - Docker image name
4- # - Kubernetes service, rc, pod, secret, volume names
51SHORT_NAME ?= builder
62
73# Enable vendor/ directory support.
84export GO15VENDOREXPERIMENT =1
95
106# SemVer with build information is defined in the SemVer 2 spec, but Docker
117# doesn't allow +, so we use -.
12- VERSION ?= 0.0.1 -$(shell date "+ % Y % m % d % H % M % S" )
8+ VERSION ?= git -$(shell git rev-parse --short HEAD )
139BINARY_DEST_DIR := rootfs/usr/bin
1410# Common flags passed into Go's linker.
1511LDFLAGS := "-s -X main.version=${VERSION}"
@@ -19,8 +15,6 @@ STANDALONE := extract-types generate-buildhook yaml2json-procfile
1915# Docker Root FS
2016BINDIR := ./rootfs
2117
22- # Legacy support for DEV_REGISTRY, plus new support for DEIS_REGISTRY.
23- DEV_REGISTRY ?= $$DEV_REGISTRY
2418DEIS_REGISTRY ?= ${DEV_REGISTRY}/
2519
2620# Kubernetes-specific information for RC, Service, and Image.
@@ -50,8 +44,11 @@ build:
5044 $(call check-static-binary,$(BINARY_DEST_DIR ) /$$i) ; \
5145 done
5246
53- docker-build : build
54- docker build --rm -t $(IMAGE ) rootfs
47+ test :
48+ go test ./pkg && go test ./pkg/confd && go test ./pkg/env && go test ./pkg/etcd && go test ./pkg/git && go test ./pkg/sshd
49+
50+ docker-build :
51+ docker build --rm -t ${IMAGE} rootfs
5552 perl -pi -e " s|image: [a-z0-9.:]+\/deis\/bp${SHORT_NAME} :[0-9a-z-.]+|image: ${IMAGE} |g" ${RC}
5653
5754# Push to a registry that Kubernetes can access.
@@ -71,10 +68,8 @@ kube-rc:
7168 kubectl create -f ${RC}
7269
7370kube-clean :
74- kubectl delete rc deis-builder
75-
76- test :
77- @echo " Implement functional tests in _tests directory"
71+ kubectl delete rc deis-${SHORT_NAME}
72+ kubectl delete svc deis-${SHORT_NAME}
7873
7974.PHONY : all build docker-compile kube-up kube-down deploy
8075
0 commit comments