GitXplorerGitXplorer
g

supply-chain-component-accelerator

public
1 stars
2 forks
0 issues

Commits

List of commits on branch main.
Unverified
35111e0a661f5f618b21b3088c620fc7e31474de

chore: don't trigger on docs resources

ggarethjevans committed a year ago
Unverified
a8882b949944f489b612f74b6a544d32863a6173

chore: remove unused common resource types

ggarethjevans committed a year ago
Unverified
a76347fae11d00f94966ea3297c0a7a61c52d5be

chore: bump golang to 1.21

ggarethjevans committed a year ago
Unverified
a07d27805eb9d159ad6b1aad8278b567681210ed

fix: semver component will always use main branch

ggarethjevans committed a year ago
Unverified
707e06a88687b025b37afba7ab941920032ec1da

chore: allow pipeline to be used for release branches

ggarethjevans committed a year ago
Unverified
fd06baa2f7a4dc9ecad1d9de4780bf77f2fa50f5

chore: remove the git extension when configuring renovate

ggarethjevans committed a year ago

README

The README file for this repository.

source-test-scan-to-url

This repository contains the source and build templates for a cartographer v2 component ready to be packaged into a carvel package.

To Build

make carvel package

To Install

make install-from-package

To setup CI/CD on Runway

Follow the guide on the CI page

What to do next?

Now that your repository has been created, the next steps are to configure the build.

Things you might want to do

Below is a list of common tasks we think that teams may want to do when the build their own component.

Use a shared/existing namespace

To use an existing namespace, we need to stop the namespace resource from being created:

  1. Remove the file config/common/namespace.yaml
  2. Remove the reference to that file inside config/common/kustomization.yaml

Add an additional docker image

Any images that need to be built as part of this package are stored within the images directory. When a new image is added you'll also need to add some configuration to ensure that it's built locally, and by lever.

Add an entry in build-templates/kbld-config.yaml that looks similar to:

sources:
  - image: woke:latest
    path: images/woke
    docker:
      buildx:
        rawOptions: ["--platform", "linux/amd64"]

and a destination to ensure that it's pushed to the correct location:

destinations:
  - image: woke:latest
    newImage: #@ data.values.build.registry_host + "/" + data.values.build.registry_project + "/woke"

to ensure that lever builds the new docker image add a new request in the file ci/lever/manifests/request.yaml:

apiVersion: supplychain.cc.build/v1alpha2
kind: Request
metadata: #@ metadata("woke-image")
spec:
  artifacts:
    images:
      - name: #@ image("woke-image")
  buildType: kaniko
  buildConfig:
    kanikoBuildConfig:
      subPath: images/woke
      dockerfile: Dockerfile
      extraArgs: []
  source: #@ git()
  isOfficial: #@ data.values.official

and configure that as a dependant build to the main package build in ci/lever/manifests/package-request.yaml:

    - imageName: #@ image("woke-image")
      kbldSource: woke:latest
      requestName: #@ namespace_name("woke-image")

Use an existing docker image

To use an existing image, we need to ensure that it's relocated to the correct repository, do this by adding an entry to build-templates/kbld-config.yaml

destinations:
  - image: gcr.io/my-project/my-tool:latest
    newImage: #@ data.values.build.registry_host + "/" + data.values.build.registry_project + "/my-tool"

Load / Persist data from the oci-store

The following tasks can be used to load and persist a workspace to an oci registry.

    - name: fetch
      workspaces:
        - name: store
          workspace: shared-data
      params:
        - name: url
          value: $(params.config-url)
      taskRef:
        name: fetch-tgz-content-oci
    - name: store
      runAfter:
        - carvel-package
      params:
        - name: workload-name
          value: $(params.workload-name)
      taskRef:
        name: store-content-oci
      workspaces:
        - name: input
          workspace: shared-data

Use a resumption to retrigger a supplychain

TODO

Display debug information to the application developer

There is a special result called message that can be used to pass information to up to the UI/CLI for use by the application developer.

To use this, define a result in your task/pipeline:

results:
- name: message
  description: Important result description, especially for error messages

Then write a message to that result:

printf "No git-url provided. git-url must exist" | tee $(results.message.path)

Add custom rbac for the task

TODO

Development Flow

Locally, use the make carvel package targets to build the pacakge locally. Behind the scenes, this uses kctrl to package the component locally and make install-from-package to deploy this to a TAP cluster.