Skip to content

Commit ec8b981

Browse files
author
smothiki
committed
feat(builder):couple builders and add dockerbuilder pod
1 parent 0951acd commit ec8b981

29 files changed

Lines changed: 139 additions & 913 deletions

Makefile

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,23 @@ DEV_REGISTRY ?= $$DEV_REGISTRY
2525
DEIS_REGISTY ?= ${DEV_REGISTRY}
2626

2727
# Kubernetes-specific information for RC, Service, and Image.
28-
RCBP := manifests/deis-bp${SHORT_NAME}-rc.yaml
29-
SVCBP := manifests/deis-bp${SHORT_NAME}-service.yaml
28+
RC := manifests/deis-${SHORT_NAME}-rc.yaml
29+
SVC := manifests/deis-${SHORT_NAME}-service.yaml
3030
# IMAGEBP := ${DEV_REGISTRY}/deis/bp${SHORT_NAME}:${VERSION}
31-
IMAGEBP := deis/bp${SHORT_NAME}:${VERSION}
31+
IMAGE := smothiki/${SHORT_NAME}:${VERSION}
3232

33-
RCDF := manifests/deis-df${SHORT_NAME}-rc.yaml
34-
SVCDF := manifests/deis-df${SHORT_NAME}-service.yaml
35-
IMAGEDF := ${DEV_REGISTRY}/deis/df${SHORT_NAME}:${VERSION}
3633

3734
all:
3835
@echo "Use a Makefile to control top-level building of the project."
3936

4037
# This illustrates a two-stage Docker build. docker-compile runs inside of
4138
# the Docker environment. Other alternatives are cross-compiling, doing
4239
# the build as a `docker build`.
43-
#
44-
# Aaron(2015-11-17) doesn't work, commented out. use 'make docker-build-bpb' instead
45-
#
46-
# build:
47-
# GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-s' -o $(BINARY_DEST_DIR)/builder boot.go || exit 1
48-
# mkdir -p ${BINDIR}/bin
49-
# docker run --rm -v ${PWD}:/app -w /app golang:1.5.1 make docker-compile
50-
51-
docker-build-bpb:
52-
cp -r bpbuilder/etcd pkg/
53-
cp bpbuilder/kubectl rootfs/bin/
54-
cp bpbuilder/entrypoint.sh rootfs/
55-
cp bpbuilder/deis-slugbuilder.yaml rootfs/etc/
56-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-s' -o $(BINARY_DEST_DIR)/bpbuilder boot.go || exit 1
57-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-s' -o $(BINARY_DEST_DIR)/fetcher bpbuilder/fetcher/fetcher.go || exit 1
58-
@$(call check-static-binary,$(BINARY_DEST_DIR)/bpbuilder)
40+
41+
build:
42+
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-s' -o $(BINARY_DEST_DIR)/builder boot.go || exit 1
43+
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-s' -o $(BINARY_DEST_DIR)/fetcher fetcher/fetcher.go || exit 1
44+
@$(call check-static-binary,$(BINARY_DEST_DIR)/builder)
5945
@$(call check-static-binary,$(BINARY_DEST_DIR)/fetcher)
6046
for i in $(BINARIES); do \
6147
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags '-s' -o $(BINARY_DEST_DIR)/$$i pkg/src/$$i.go || exit 1; \
@@ -64,32 +50,16 @@ docker-build-bpb:
6450
@for i in $(BINARIES); do \
6551
$(call check-static-binary,$(BINARY_DEST_DIR)/$$i); \
6652
done
67-
docker build -t $(IMAGEBP) rootfs
68-
perl -pi -e "s|image: [a-z0-9.:]+\/deis\/bp${SHORT_NAME}:[0-9a-z-.]+|image: ${IMAGEBP}|g" ${RCBP}
69-
rm -rf pkg/etcd
70-
rm rootfs/entrypoint.sh
71-
# For cases where build is run inside of a container.
7253

73-
docker-build-dfb:
74-
cp -r dfbuilder/etcd pkg/
75-
cp bpbuilder/entrypoint.sh rootfs/
76-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' -o $(BINARY_DEST_DIR)/dfbuilder boot.go || exit 1
77-
@$(call check-static-binary,$(BINARY_DEST_DIR)/dfbuilder)
78-
for i in $(BINARIES); do \
79-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' -o $(BINARY_DEST_DIR)/$$i pkg/src/$$i.go || exit 1; \
80-
done
81-
@for i in $(BINARIES); do \
82-
$(call check-static-binary,$(BINARY_DEST_DIR)/$$i); \
83-
done
84-
docker build -t $(IMAGEDF) rootfs
85-
perl -pi -e "s|image: [a-z0-9.:]+\/deis\/df${SHORT_NAME}:[0-9a-z-.]+|image: ${IMAGEDF}|g" ${RCDF}
86-
rm -rf pkg/etcd
87-
rm rootfs/entrypoint.sh
54+
docker-build:
55+
docker build -t $(IMAGE) rootfs
56+
perl -pi -e "s|image: [a-z0-9.:]+\/deis\/bp${SHORT_NAME}:[0-9a-z-.]+|image: ${IMAGE}|g" ${RC}
57+
# For cases where build is run inside of a container.
8858

8959

9060
# Push to a registry that Kubernetes can access.
9161
docker-push-bp:
92-
docker push ${IMAGEBP}
62+
docker push ${IMAGE}
9363

9464
# Deploy is a Kubernetes-oriented target
9565
deploy: kube-service kube-rc
@@ -104,7 +74,7 @@ kube-rc:
10474
kubectl create -f ${RC}
10575

10676
kube-clean:
107-
kubectl delete rc deis-example
77+
kubectl delete rc deis-builder
10878

10979
.PHONY: all build docker-compile kube-up kube-down deploy
11080

bpbuilder/entrypoint.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

bpbuilder/kubectl

-22.4 MB
Binary file not shown.

dfbuilder/builder

Lines changed: 0 additions & 130 deletions
This file was deleted.

dfbuilder/entrypoint.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)