Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types #2

Merged
merged 6 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
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/
70 changes: 70 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Developing

## Getting started

1. Create [a GitHub account](https://github.com/join)
1. Setup [GitHub access via
SSH](https://help.github.com/articles/connecting-to-github-with-ssh/)
1. Install [requirements](#requirements)
1. [Set up a kubernetes cluster](https://github.com/knative/serving/blob/master/docs/creating-a-kubernetes-cluster.md)
1. [Configure kubectl to use your cluster](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/)

### Requirements

You must install these tools:

1. [`go`](https://golang.org/doc/install): The language `Pipeline CRD` is built in
1. [`git`](https://help.github.com/articles/set-up-git/): For source control
1. [`dep`](https://github.com/golang/dep): For managing external Go
dependencies.
1. [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/): For interacting with your kube cluster (also required for kubebuidler)
1. [`kustomize`](https://github.com/kubernetes-sigs/kustomize): Required for kubebuilder
1. [`kubebuilder`](https://book.kubebuilder.io/quick_start.html): For generating CRD related
boilerplate (see [docs on iterating with kubebuilder](#installing-and-running)) - Note that
the installation instructions default to `mac`, use the tabs at the top to switch to `linux`

## Iterating

### Dependencies

This repo uses [`dep`](https://golang.github.io/dep/docs/daily-dep.html) for dependency management:

* Update the deps with `dep ensure -update`
* `dep ensure` should be a no-op
* Add a dep with `dep ensure -add $MY_DEP`

### Installing and running

The skeleton for this project was generated using [kubebuilder](https://book.kubebuilder.io/quick_start.html),
which created our [Makefile](./Makefile). The `Makefile` will call out to `kubectl`,
so you must [configure your `kubeconfig` to use your cluster](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/).

Then a typical development cycle will look like this:

```bash
# Add/update CRDs in your kubernetes cluster
make install

# Run your controller locally, (stop execution with `ctrl-c`)
make run

# In another terminal, deploy tasks
kubectl apply -f config/samples
```

You will also want to [run tests](#running-tests).

### Running tests

Run the tests with:

```bash
make test
```

### Where's the code?

To make changes to these CRDs, you will probably interact with:

* The CRD type definitions in [./pkg/apis/pipeline/v1beta1](./pkg/apis/pipeline/v1beta1)
aaron-prindle marked this conversation as resolved.
Show resolved Hide resolved
* The controllers in [./pkg/controller](./pkg/controller)
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
aaron-prindle marked this conversation as resolved.
Show resolved Hide resolved
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"]
Loading