Skip to content

Commit

Permalink
Merge pull request #6 from twiest/ci-changes
Browse files Browse the repository at this point in the history
Change Hive repo to work with ci.
  • Loading branch information
Joel Diaz authored Sep 19, 2018
2 parents eaed394 + 20e7414 commit b9a7358
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest

all: test manager
all: test build

# Run tests
test: generate fmt vet manifests
go test ./pkg/... ./cmd/... -coverprofile cover.out

# Builds all of hive's binaries (including utils).
.PHONY: build
build: manager


# Build manager binary
manager: generate fmt vet
go build -o bin/manager github.com/openshift/hive/cmd/manager
Expand Down
36 changes: 36 additions & 0 deletions build/build-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM openshift/origin-release:golang-GO_VERSION

# Install the golint, use this to check our source for niceness
RUN go get -u github.com/golang/lint/golint

# Install gomock and mockgen for the mocks used in unit tests
RUN go get -u github.com/golang/mock/gomock
RUN go get -u github.com/golang/mock/mockgen

# Install kubebuilder 1.0.1 TODO: ask cewong if there's a way to cache this. It takes a long time to d/l
RUN export version=1.0.1 && \
cd /tmp && \
curl -L -O https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_${version}_linux_amd64.tar.gz && \
tar -zxvf /tmp/kubebuilder_${version}_linux_amd64.tar.gz && \
mv kubebuilder_${version}_linux_amd64 /usr/local/kubebuilder


# Create the full dir tree that we'll mount our src into when we run the image
RUN mkdir -p /go/src/github.com/openshift/hive

# Default to our src dir
WORKDIR /go/src/github.com/openshift/hive
25 changes: 25 additions & 0 deletions build/test-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This image is meant to be used only for CI as a base for
# verification tests and unit tests.
# It combines the builder image (images/builder-image) and the
# hive source.

FROM builder-base
RUN mkdir -p /go/src/github.com/openshift/hive && \
cd /go/src/github.com/openshift/hive
WORKDIR /go/src/github.com/openshift/hive
COPY . .
RUN chmod -R og+w /go

0 comments on commit b9a7358

Please sign in to comment.