Skip to content

Commit a782e57

Browse files
committed
fix(Makefile): change VERSION, add and fix targets
- adding go test to test target - removing build target from docker-build - deleting the service on kube-clean
1 parent b183450 commit a782e57

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

Makefile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
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
51
SHORT_NAME ?= builder
62

73
# Enable vendor/ directory support.
84
export 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)
139
BINARY_DEST_DIR := rootfs/usr/bin
1410
# Common flags passed into Go's linker.
1511
LDFLAGS := "-s -X main.version=${VERSION}"
@@ -19,8 +15,7 @@ STANDALONE := extract-types generate-buildhook yaml2json-procfile
1915
# Docker Root FS
2016
BINDIR := ./rootfs
2117

22-
# Legacy support for DEV_REGISTRY, plus new support for DEIS_REGISTRY.
23-
DEV_REGISTRY ?= $$DEV_REGISTRY
18+
DEV_REGISTRY ?= $(shell docker-machine ip deis):5000
2419
DEIS_REGISTRY ?= ${DEV_REGISTRY}/
2520

2621
# Kubernetes-specific information for RC, Service, and Image.
@@ -50,8 +45,11 @@ build:
5045
$(call check-static-binary,$(BINARY_DEST_DIR)/$$i); \
5146
done
5247

53-
docker-build: build
54-
docker build --rm -t $(IMAGE) rootfs
48+
test:
49+
go test ./pkg && go test ./pkg/confd && go test ./pkg/env && go test ./pkg/etcd && go test ./pkg/git && go test ./pkg/sshd
50+
51+
docker-build:
52+
docker build --rm -t ${IMAGE} rootfs
5553
perl -pi -e "s|image: [a-z0-9.:]+\/deis\/bp${SHORT_NAME}:[0-9a-z-.]+|image: ${IMAGE}|g" ${RC}
5654

5755
# Push to a registry that Kubernetes can access.
@@ -71,10 +69,8 @@ kube-rc:
7169
kubectl create -f ${RC}
7270

7371
kube-clean:
74-
kubectl delete rc deis-builder
75-
76-
test:
77-
@echo "Implement functional tests in _tests directory"
72+
kubectl delete rc deis-${SHORT_NAME}
73+
kubectl delete svc deis-${SHORT_NAME}
7874

7975
.PHONY: all build docker-compile kube-up kube-down deploy
8076

0 commit comments

Comments
 (0)