Skip to content

Commit

Permalink
Merge version v0.1.0 of Service Catalog from https://github.com/opens…
Browse files Browse the repository at this point in the history
  • Loading branch information
jpeeler committed Oct 24, 2017
2 parents 230b6a1 + ee4ff3f commit 1af9822
Show file tree
Hide file tree
Showing 107 changed files with 4,196 additions and 1,744 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ SRC_DIRS = $(shell sh -c "find $(TOP_SRC_DIRS) -name \\*.go \
TEST_DIRS ?= $(shell sh -c "find $(TOP_SRC_DIRS) -name \\*_test.go \
-exec dirname {} \\; | sort | uniq")
VERSION ?= $(shell git describe --always --abbrev=7 --dirty)
BUILD_LDFLAGS = $(shell build/version.sh $(ROOT) $(SC_PKG))

# Run stat against /dev/null and check if it has any stdout output.
# If stdout is blank, we are detecting bsd-stat because stat it has
Expand Down Expand Up @@ -73,15 +74,13 @@ $(error Unsupported platform to compile for)
endif

GO_BUILD = env GOOS=$(PLATFORM) GOARCH=$(ARCH) go build -i $(GOFLAGS) \
-ldflags "-X $(SC_PKG)/pkg.VERSION=$(VERSION)"
-ldflags "-X $(SC_PKG)/pkg.VERSION=$(VERSION) $(BUILD_LDFLAGS)"
BASE_PATH = $(ROOT:/src/github.com/kubernetes-incubator/service-catalog/=)
export GOPATH = $(BASE_PATH):$(ROOT)/vendor

MUTABLE_TAG ?= canary
APISERVER_IMAGE = $(REGISTRY)apiserver-$(ARCH):$(VERSION)
APISERVER_MUTABLE_IMAGE = $(REGISTRY)apiserver-$(ARCH):$(MUTABLE_TAG)
CONTROLLER_MANAGER_IMAGE = $(REGISTRY)controller-manager-$(ARCH):$(VERSION)
CONTROLLER_MANAGER_MUTABLE_IMAGE = $(REGISTRY)controller-manager-$(ARCH):$(MUTABLE_TAG)
SERVICE_CATALOG_IMAGE = $(REGISTRY)service-catalog-$(ARCH):$(VERSION)
SERVICE_CATALOG_MUTABLE_IMAGE = $(REGISTRY)service-catalog-$(ARCH):$(MUTABLE_TAG)
USER_BROKER_IMAGE = $(REGISTRY)user-broker-$(ARCH):$(VERSION)
USER_BROKER_MUTABLE_IMAGE = $(REGISTRY)user-broker-$(ARCH):$(MUTABLE_TAG)

Expand Down Expand Up @@ -109,11 +108,10 @@ NON_VENDOR_DIRS = $(shell $(DOCKER_CMD) glide nv)

# This section builds the output binaries.
# Some will have dedicated targets to make it easier to type, for example
# "apiserver" instead of "bin/apiserver".
# "service-catalog" instead of "bin/service-catalog".
#########################################################################
build: .init .generate_files \
$(BINDIR)/apiserver \
$(BINDIR)/controller-manager \
$(BINDIR)/service-catalog \
$(BINDIR)/user-broker

user-broker: $(BINDIR)/user-broker
Expand All @@ -122,14 +120,10 @@ $(BINDIR)/user-broker: .init contrib/cmd/user-broker \
$(shell find contrib/pkg/broker -type f)
$(DOCKER_CMD) $(GO_BUILD) -o $@ $(SC_PKG)/contrib/cmd/user-broker

# We'll rebuild apiserver if any go file has changed (ie. NEWEST_GO_FILE)
apiserver: $(BINDIR)/apiserver
$(BINDIR)/apiserver: .init .generate_files cmd/apiserver $(NEWEST_GO_FILE)
$(DOCKER_CMD) $(GO_BUILD) -o $@ $(SC_PKG)/cmd/apiserver

controller-manager: $(BINDIR)/controller-manager
$(BINDIR)/controller-manager: .init .generate_files cmd/controller-manager $(NEWEST_GO_FILE)
$(DOCKER_CMD) $(GO_BUILD) -o $@ $(SC_PKG)/cmd/controller-manager
# We'll rebuild service-catalog if any go file has changed (ie. NEWEST_GO_FILE)
service-catalog: $(BINDIR)/service-catalog
$(BINDIR)/service-catalog: .init .generate_files cmd/service-catalog $(NEWEST_GO_FILE)
$(DOCKER_CMD) $(GO_BUILD) -o $@ $(SC_PKG)/cmd/service-catalog

# This section contains the code generation stuff
#################################################
Expand Down Expand Up @@ -220,8 +214,9 @@ $(BINDIR)/e2e.test: .init $(NEWEST_E2ETEST_SOURCE) $(NEWEST_GO_FILE)
verify: .init .generate_files verify-client-gen
@echo Running gofmt:
@$(DOCKER_CMD) gofmt -l -s $(TOP_TEST_DIRS) $(TOP_SRC_DIRS)>.out 2>&1||true
@bash -c '[ "`cat .out`" == "" ] || \
(echo -e "\n*** Please 'gofmt' the following:" ; cat .out ; echo ; false)'
@[ ! -s .out ] || \
(echo && echo "*** Please 'gofmt' the following:" && \
cat .out && echo && rm .out && false)
@rm .out
@#
@echo Running golint and go vet:
Expand All @@ -240,7 +235,7 @@ verify: .init .generate_files verify-client-gen
$(DOCKER_CMD) go vet $(NON_VENDOR_DIRS)
@echo Running repo-infra verify scripts
@$(DOCKER_CMD) vendor/github.com/kubernetes/repo-infra/verify/verify-boilerplate.sh --rootdir=. | grep -v generated > .out 2>&1 || true
@bash -c '[ "`cat .out`" == "" ] || (cat .out ; false)'
@[ ! -s .out ] || (cat .out && rm .out && false)
@rm .out
@#
@echo Running href checker:
Expand Down Expand Up @@ -328,7 +323,7 @@ clean-coverage:

# Building Docker Images for our executables
############################################
images: user-broker-image controller-manager-image apiserver-image
images: user-broker-image service-catalog-image

images-all: $(addprefix arch-image-,$(ALL_ARCH))
arch-image-%:
Expand Down Expand Up @@ -357,24 +352,17 @@ ifeq ($(ARCH),amd64)
docker tag $(USER_BROKER_MUTABLE_IMAGE) $(REGISTRY)user-broker:$(MUTABLE_TAG)
endif

apiserver-image: build/apiserver/Dockerfile $(BINDIR)/apiserver
$(call build-and-tag,"apiserver",$(APISERVER_IMAGE),$(APISERVER_MUTABLE_IMAGE))
ifeq ($(ARCH),amd64)
docker tag $(APISERVER_IMAGE) $(REGISTRY)apiserver:$(VERSION)
docker tag $(APISERVER_MUTABLE_IMAGE) $(REGISTRY)apiserver:$(MUTABLE_TAG)
endif

controller-manager-image: build/controller-manager/Dockerfile $(BINDIR)/controller-manager
$(call build-and-tag,"controller-manager",$(CONTROLLER_MANAGER_IMAGE),$(CONTROLLER_MANAGER_MUTABLE_IMAGE))
service-catalog-image: build/service-catalog/Dockerfile $(BINDIR)/service-catalog
$(call build-and-tag,"service-catalog",$(SERVICE_CATALOG_IMAGE),$(SERVICE_CATALOG_MUTABLE_IMAGE))
ifeq ($(ARCH),amd64)
docker tag $(CONTROLLER_MANAGER_IMAGE) $(REGISTRY)controller-manager:$(VERSION)
docker tag $(CONTROLLER_MANAGER_MUTABLE_IMAGE) $(REGISTRY)controller-manager:$(MUTABLE_TAG)
docker tag $(SERVICE_CATALOG_IMAGE) $(REGISTRY)service-catalog:$(VERSION)
docker tag $(SERVICE_CATALOG_MUTABLE_IMAGE) $(REGISTRY)service-catalog:$(MUTABLE_TAG)
endif


# Push our Docker Images to a registry
######################################
push: user-broker-push controller-manager-push apiserver-push
push: user-broker-push service-catalog-push

user-broker-push: user-broker-image
docker push $(USER_BROKER_IMAGE)
Expand All @@ -384,20 +372,12 @@ ifeq ($(ARCH),amd64)
docker push $(REGISTRY)user-broker:$(MUTABLE_TAG)
endif

controller-manager-push: controller-manager-image
docker push $(CONTROLLER_MANAGER_IMAGE)
docker push $(CONTROLLER_MANAGER_MUTABLE_IMAGE)
ifeq ($(ARCH),amd64)
docker push $(REGISTRY)controller-manager:$(VERSION)
docker push $(REGISTRY)controller-manager:$(MUTABLE_TAG)
endif

apiserver-push: apiserver-image
docker push $(APISERVER_IMAGE)
docker push $(APISERVER_MUTABLE_IMAGE)
service-catalog-push: service-catalog-image
docker push $(SERVICE_CATALOG_IMAGE)
docker push $(SERVICE_CATALOG_MUTABLE_IMAGE)
ifeq ($(ARCH),amd64)
docker push $(REGISTRY)apiserver:$(VERSION)
docker push $(REGISTRY)apiserver:$(MUTABLE_TAG)
docker push $(REGISTRY)service-catalog:$(VERSION)
docker push $(REGISTRY)service-catalog:$(MUTABLE_TAG)
endif


Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

FROM BASEIMAGE

ADD controller-manager /opt/services/
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install ca-certificates -y && \
rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["/opt/services/controller-manager" ]
ADD service-catalog opt/services/

ENTRYPOINT ["/opt/services/service-catalog"]
Loading

0 comments on commit 1af9822

Please sign in to comment.