Skip to content

Commit

Permalink
Introduce embedded BuildSpec for BuildRuns
Browse files Browse the repository at this point in the history
Make `BuildRef` optional and generate CRDs and fix all occurrences.

Introduce code in `GetBuildObject` to support both the `BuildRef` approach and
the new `BuildSpec` option. Return a transient in-memory Build resource in case
the BuildRun has an embedded BuildSpec.

Add optional `BuildSpec` in BuildRun spec.

Add E2E test cases for embedded builds in buildruns.

Add new BuildRun validation option in docs.

Remove variable name for `context` to make it undefined (linter warning).

Add empty lines for readability.

Sort imports based on common kube/others order.

Replace copy/paste description with specific one for bundle tests.

Add `Expect`s to give human readable error in case test environment variables
are not set.

Remove duplicate import of `k8s.io/api/core/v1`.

Simplify code by removing the `if` check.

Fix warning that variable declaration could shadow previous variable value by
refactoring the respective `if` block.

Add or remove empty lines in `buildrun_test.go` to increase readability and to
keep the same style as in other test cases.

Refactor code to fix variable value shadow warning.

Replace generic `errors.New("not found")` with Kube specific one.

Introduce empty status call stub (not not fail in status update case).

Refactor return statement to be more simple.

Introduce `BuildSpec` in BuildRun spec

Refactor build reconciler logic by inlining `UpdateBuildStatusAndRetreat`
function that is only used once.

Add test case to cover special case for build resource not being in the system.

Refactor validation code by moving out validation list into a global variable.

Add convenience function to get the name of the referenced build.

Use `resources.GetBuildObject` instead of manual look-up in test cases.

Introduce controller-runtime Kubernetes client in test handle.

Add functions to create the validation structs in a consistent way.

Add convenience function to validate a Build with validation varargs.

Introduce validation code for field permutations.

Add test cases for field validation.

Fix markdown linter warnings and indention.
  • Loading branch information
HeavyWombat committed Apr 1, 2022
1 parent 2f83db9 commit b1ca5f2
Show file tree
Hide file tree
Showing 31 changed files with 1,217 additions and 209 deletions.
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ Shipwright supports any tool that can build container images in Kubernetes clust

## Try It!

* We assume you already have a Kubernetes cluster (v1.21+). If you don't, you can use [KinD](https://kind.sigs.k8s.io), which you can install by running [`./hack/install-kind.sh`](./hack/install-kind.sh).
- We assume you already have a Kubernetes cluster (v1.21+). If you don't, you can use [KinD](https://kind.sigs.k8s.io), which you can install by running [`./hack/install-kind.sh`](./hack/install-kind.sh).

* We also require a Tekton installation (v0.30+). To install the newest supported version, run:
- We also require a Tekton installation (v0.30+). To install the newest supported version, run:

```bash
kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.34.1/release.yaml
```

* Install the Shipwright deployment. To install the latest version, run:
- Install the Shipwright deployment. To install the latest version, run:

```bash
kubectl apply --filename https://github.com/shipwright-io/build/releases/download/v0.8.0/release.yaml
```

* Install the Shipwright strategies. To install the latest version, run:
- Install the Shipwright strategies. To install the latest version, run:

```bash
kubectl apply --filename https://github.com/shipwright-io/build/releases/download/v0.8.0/sample-strategies.yaml
```

* Generate a secret to access your container registry, such as one on [Docker Hub](https://hub.docker.com/) or [Quay.io](https://quay.io/):
- Generate a secret to access your container registry, such as one on [Docker Hub](https://hub.docker.com/) or [Quay.io](https://quay.io/):

```bash
REGISTRY_SERVER=https://index.docker.io/v1/ REGISTRY_USER=<your_registry_user> REGISTRY_PASSWORD=<your_registry_password>
Expand All @@ -63,7 +63,7 @@ Shipwright supports any tool that can build container images in Kubernetes clust
--docker-email=<your_email>
```

* Create a *Build* object, replacing `<REGISTRY_ORG>` with the registry username your `push-secret` secret have access to:
- Create a *Build* object, replacing `<REGISTRY_ORG>` with the registry username your `push-secret` secret have access to:

```bash
REGISTRY_ORG=<your_registry_org>
Expand All @@ -86,15 +86,16 @@ Shipwright supports any tool that can build container images in Kubernetes clust
EOF
```
To view the *Build* which you just created:
To view the *Build* which you just created:
```
$ kubectl get builds
```bash
$ kubectl get builds
NAME REGISTERED REASON BUILDSTRATEGYKIND BUILDSTRATEGYNAME CREATIONTIME
buildpack-nodejs-build True Succeeded ClusterBuildStrategy buildpacks-v3 68s
```
* Submit your *BuildRun*:
- Submit your *BuildRun*:
```bash
cat <<EOF | kubectl create -f -
Expand All @@ -108,9 +109,9 @@ To view the *Build* which you just created:
EOF
```
* Wait until your *BuildRun* is completed and then you can view it as follows:
- Wait until your *BuildRun* is completed and then you can view it as follows:
```
```bash
$ kubectl get buildruns
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
Expand All @@ -123,7 +124,7 @@ To view the *Build* which you just created:
kubectl get buildrun --output name | xargs kubectl wait --for=condition=Succeeded --timeout=180s
```
* After your *BuildRun* is completed, check your container registry, you will find the new generated image uploaded there.
- After your *BuildRun* is completed, check your container registry, you will find the new generated image uploaded there.
## Please tell us more!
Expand Down Expand Up @@ -175,16 +176,16 @@ Our sample build strategies are all functional on linux/amd64. Their support on
We host weekly meetings for users, contributors, maintainers and anyone interested in the project. The weekly meetings take place on Mondays at 1pm UTC.
* Meeting [minutes](https://github.com/shipwright-io/community/issues?q=is%3Aissue+label%3Acommunity+label%3Ameeting)
* Public calendar [invite](https://calendar.google.com/calendar/u/1?cid=Y19iMWVndjc3anUyczJkbWNkM2R1ZnAxazhuNEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t)
- Meeting [minutes](https://github.com/shipwright-io/community/issues?q=is%3Aissue+label%3Acommunity+label%3Ameeting)
- Public calendar [invite](https://calendar.google.com/calendar/u/1?cid=Y19iMWVndjc3anUyczJkbWNkM2R1ZnAxazhuNEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t)
### Want to contribute
We are so excited to have you!
* See [CONTRIBUTING.md](CONTRIBUTING.md) for an overview of our processes
* See [DEVELOPMENT.md](DEVELOPMENT.md) for how to get started
* See [HACK.md](HACK.md) for how to build, test & run
- See [CONTRIBUTING.md](CONTRIBUTING.md) for an overview of our processes
- See [DEVELOPMENT.md](DEVELOPMENT.md) for how to get started
- See [HACK.md](HACK.md) for how to build, test & run
(advanced reading material)
- Look at our
[good first issues](https://github.com/shipwright-io/build/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
Expand Down
Loading

0 comments on commit b1ca5f2

Please sign in to comment.