GithubHelp home page GithubHelp logo

openshift-pipelines / task-buildpacks Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 4.0 54 KB

License: Apache License 2.0

Makefile 16.45% Shell 71.26% Smarty 9.51% Dockerfile 2.77%
tekton ecosystem tasks pipelines

task-buildpacks's Introduction

GitHub Test Workflow Status GitHub release (latest by date)

buildpacks Tekton Task

Tekton Task for the Buildpacks, to build a application from source code into a container image.

Usage

Please consider a example usage to build Paketo's Node.js sample below. The Pipeline uses task-git (0.0.1) to clone the repository:

---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata: {}
spec:
  workspaces:
    - name: source

  params:
    - name: IMAGE
      type: string
      description: Fully qualified image name, including tag

  tasks:
    # Cloning the git repository (URL) onto the "source" workspace.
    - name: git
      taskRef:
        name: git
      workspaces:
        - name: output
          workspace: source
      params:
        - name: URL
          value: https://github.com/paketo-buildpacks/samples.git

    # Running the buildpacks' CNB on the source code to build the container
    # image (IMAGE param).
    - name: buildpacks
      taskRef:
        name: buildpacks
      runAfter:
        - git
      workspaces:
        - name: source
          workspace: source
      params:
        - name: SUBDIRECTORY
          value: nodejs/npm
        - name: IMAGE
          value: $(params.IMAGE)

Please consider the Workspaces, Parameters and Results described below.

Container Registry Authentication

The buildpacks Task needs credentials to communicate with the Container Registries to publish the images created by the CNB (IMAGE param), and also, to optionally store cached data (CACHE_IMAGE param).

Please consider Tekton Pipeline documentation to setup the Container Registry authentication.

Workspaces

Workspace Optional Description
source false Application source-code.
cache true Cache directory, alternative to the CACHE_IMAGE param.
bindings true Extra bindings, CA certificate bundle files.

source

Contains the application source code, please consider task-git to handle the Git repository clone. The param SUBDIRECTORY defines a relative path on this Workspace to be used as application's source code alternatively, as the usage example shows.

cache

Contains the build cache to be reused on subsequent executions. Caching can also be achieved using the CACHE_IMAGE param to store the cache data as a container image.

Considering the nature of the cached data, it's recommended to use a Kubernetes Persistent Volume Claim.

bindings

Workspace for the extra binding certificates needed for the application runtime. The files present on this Workspace matching BINDINGS_GLOB will be copied into SERVICE_BINDING_ROOT, where the CNB picks up the binding files.

For instance, the following Secret carries a example.pem file:

kubectl create secret generic buildpacks-ex --from-file="example.pem=/path/to/example.pem"

Given the param BINDINGS_GLOB is set to pick up *.pem files, then you can mount the "buildpacks-ex" Secret on the Task's bindings workspace.

Params

Param Type Default Description
IMAGE string (required) Application's container image name, and tag.
BUILDER_IMAGE string docker.io/paketobuildpacks/builder:base Cloud Native Builder (CNB) container image name (and tag).
CNB_PLATFORM_API string 0.11 Lifecycle platform API compatibility version.
SUBDIRECTORY string "" (empty) Alternative CNB_APP_DIR directory, relative to the "source" Workspace.
ENV_VARS array [] (empty) Environment variables to set during "build-time".
PROCESS_TYPE string web Application process type.
BINDINGS_GLOB string *.pem Extra binding file name(s) (glob expression) present on the bindings Workspace to be copied into SERVICE_BINDING_ROOT directory.
RUN_IMAGE string "" (empty) Reference to a run image to use.
CACHE_IMAGE string "" (empty) The name of the persistent cache image (when cache workspace is not provided).
SKIP_RESTORE string false Do not write layer metadata or restore cached layers.
USER_ID string 1000 CNB container image user-id (UID).
GROUP_ID string 1000 CNB container image group-id (GID).
VERBOSE string false Turns on verbose logging, all commands executed will be printed out.

Results

Result Description
IMAGE_DIGEST Reported IMAGE digest.
IMAGE_URL Reported fully qualified container image name.

task-buildpacks's People

Contributors

aneesh-m-bhat avatar dependabot[bot] avatar otaviof avatar savitaashture avatar senjuti256 avatar vdemeester avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.