forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tektoncd#2 from aaron-prindle/add-types
Add types
- Loading branch information
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,6 @@ | |
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# bin folder | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |