Skip to content

Commit

Permalink
add boilerplate for all pipeline primitive types
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-prindle committed Sep 6, 2018
1 parent 6b077e0 commit 2df884b
Show file tree
Hide file tree
Showing 43 changed files with 3,900 additions and 0 deletions.
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 `Knative Serving` 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)
* 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
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

0 comments on commit 2df884b

Please sign in to comment.