openshift-knative / hack

CI tooling to improve and automate CI and release management
Apache License 2.0
4 stars 16 forks source link

hack

CI tooling and hacks to improve CI

Generate openshift/release config

To generate openshift/release config for a single repository, run the specific task in the Makefile or run individual commands in the Makefile, such as:

go run github.com/openshift-knative/hack/cmd/prowgen --config config/eventing-hyperfoil-benchmark.yaml --remote <your_remote>
# go run github.com/openshift-knative/hack/cmd/prowgen --config config/eventing-hyperfoil-benchmark.yaml --remote git@github.com:aliok/release.git 

This generation works this way:

Limitations:

Apply Konflux configurations

  1. Follow the instructions to access the Konflux instance at GitLab (VPN required)
  2. Set the kubectl context to use the ocp-serverless workspace
    kubectl config use-context konflux-ocp-serverless
  3. Run make konflux-apply

Run unit tests

make unit-tests

Updating OpenShift versions

CI configs use specific OpenShift versions. To change the version, you need to update the YAML files in the config/ directory.

When a new OpenShift version is released, wait until the cluster pool for OpenShift CI is available in https://docs.ci.openshift.org/docs/how-tos/cluster-claim/#existing-cluster-pools.

Getting SO branch associated with upstream branch

SO branch follows the product versioning, while midstream branches follows the upstream versioning.

To make the "clone associated SO branch" easier, you can run the sobranch tool as follows:

GO111MODULE=off go get -u github.com/openshift-knative/hack/cmd/sobranch

so_branch=$( $(go env GOPATH)/bin/sobranch --upstream-version "release-1.11") # or "release-v1.11" or "release-1.11" or "v1.11" or "1.11"

git clone --branch $so_branch git@github.com:openshift-knative/serverless-operator.git

Troubleshooting

Git not configured to use GPG signing

error: gpg failed to sign the data
fatal: failed to write commit object

You need to configure GPG signing in your git config. See https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key.

If you see this error, you need to update your Git to version 2.34 or later.

error: unsupported value for gpg.format: ssh
fatal: bad config variable 'gpg.format' in file '/Users/<you>/.gitconfig'