build-service-system

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2019 License: Apache-2.0

README

Build Service System

Experimental Build Service CRDs.

Pre requirements

  • Kubernetes cluster
  • KNative 0.5 installed

Install

  • Use the most recent github release.

Local Development Install

Access to a Kubernetes cluster is needed in order to install the build service system controllers.

kubectl cluster-info # ensure you have access to a cluster
./hack/apply.sh <IMAGE/NAME> # <IMAGE/NAME> is a writable and publicly accessible location 
Creating an Image Resource
  1. Create a builder resource. This resource tracks a builder on registry and will rebuild images when the builder has updated buildpacks.
apiVersion: build.pivotal.io/v1alpha1
kind: Builder
metadata:
  name: sample-builder
spec:
  image: cloudfoundry/cnb:bionic
  1. Create a service account with access to push to the desired docker registry. The example below is for a registry on gcr. Check out Knative's documentation for more info.
apiVersion: v1
kind: Secret
metadata:
  name: basic-user-pass
  annotations:
    build.knative.dev/docker-0: gcr.io 
type: kubernetes.io/basic-auth
stringData:
  username: <username>
  password: <password>
apiVersion: v1
kind: ServiceAccount
metadata:
  name: service-account
secrets:
  - name: basic-user-pass
  1. Apply an image configuration to the cluster.
apiVersion: build.pivotal.io/v1alpha1
kind: Image
metadata:
  name: sample-image
spec:
  serviceAccount: service-account 
  builderRef: sample-builder
  image: gcr.io/project-name/app
  cacheSize: "1.5Gi"
  failedBuildHistoryLimit: 5
  successBuildHistoryLimit: 5
  source:
    git:
      url: https://github.com/buildpack/sample-java-app.git
      revision: master
  1. See the builds for the image
kubectl get cnbbuilds # before the first builds completes you will see a pending status
---------------
NAME                          SHA   SUCCEEDED   REASON
test-image-build-1-ea3e6fa9         Unknown     Pending

After a build has completed you will be able to see the built digest

Running Tests
  • To run the e2e tests the build service system must be installed and running on a cluster
  • The IMAGE_REGISTRY environment variable must point at a registry with local write access
IMAGE_REGISTRY=gcr.io/<some-project> go test ./...

Directories

Path Synopsis
cmd
pkg
client/clientset/versioned
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
client/clientset/versioned/fake
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
client/clientset/versioned/scheme
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
client/clientset/versioned/typed/build/v1alpha1
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
client/clientset/versioned/typed/build/v1alpha1/fake
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
client/informers/externalversions
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
client/informers/externalversions/build
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
client/informers/externalversions/build/v1alpha1
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
client/informers/externalversions/internalinterfaces
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
client/listers/build/v1alpha1
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* Copyright 2019 The original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
cnb
reconciler/v1alpha1/build/buildfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
reconciler/v1alpha1/builder/builderfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
registry/registryfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL