Skip to content

Commit

Permalink
Merge pull request tektoncd#2 from aaron-prindle/add-types
Browse files Browse the repository at this point in the history
Add types
  • Loading branch information
aaron-prindle authored Sep 7, 2018
2 parents c868e16 + 707b582 commit e847442
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# bin folder
bin/
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Build the manager binary
FROM golang:1.10.3 as builder

# Copy in the go src
WORKDIR /go/src/github.com/knative/build-pipeline
COPY pkg/ pkg/
COPY cmd/ cmd/
COPY vendor/ vendor/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager github.com/knative/build-pipeline/cmd/manager

# Copy the controller-manager into a thin image
FROM ubuntu:latest
WORKDIR /root/
COPY --from=builder /go/src/github.com/knative/build-pipeline/manager .
ENTRYPOINT ["./manager"]
52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

# Image URL to use all building/pushing image targets
IMG ?= controller:latest

all: test manager

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

# Build manager binary
manager: generate fmt vet
go build -o bin/manager github.com/knative/build-pipeline/cmd/manager

# Run against the configured Kubernetes cluster in ~/.kube/config
run: generate fmt vet
go run ./cmd/manager/main.go

# Install CRDs into a cluster
install: manifests
kubectl apply -f config/crds

# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
deploy: manifests
kubectl apply -f config/crds
kustomize build config/default | kubectl apply -f -

# Generate manifests e.g. CRD, RBAC etc.
manifests:
go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go all

# Run go fmt against code
fmt:
go fmt ./pkg/... ./cmd/...

# Run go vet against code
vet:
go vet ./pkg/... ./cmd/...

# Generate code
generate:
go generate ./pkg/... ./cmd/...

# Build the docker image
docker-build: test
docker build . -t ${IMG}
@echo "updating kustomize image patch file for manager resource"
sed -i 's@image: .*@image: '"${IMG}"'@' ./config/default/manager_image_patch.yaml

# Push the docker image
docker-push:
docker push ${IMG}
3 changes: 3 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version: "1"
domain: knative.dev
repo: github.com/knative/build-pipeline

0 comments on commit e847442

Please sign in to comment.