This pipeline is slightly more complex than the previuos example. This example assumes that you read and understood the previous one.
- After building the image, the pipeline then generates the SonataFlow manifest based on your project and the built image
- Next, the pipeline prepares a PR to update the config repository with SonataFlow manifests
- Finally, it opens the PR in the target repo.
The idea is to update the application status in a Kubernetes cluster.
See main prereqs.
Create a secret to hold your ssh credentials. For security reasons, you may create a new SSH key and configure in your Github account.
# Make sure to keep the file as https://github.com/tektoncd/catalog/blob/main/task/git-cli/0.4/README.md#using-ssh-credentials
kubectl create secret generic ssh-github --from-file=${HOME}/.ssh
Create a secret to hold a Github token to open PRs in your organization:
# Generate a Github Token with permissions to open PRs, see more at https://github.com/tektoncd/catalog/blob/main/task/github-open-pr/0.2/README.md
kubectl create secret generic github-token --from-literal=token=<YOUR-TOKEN-HERE>
See main Install required Tasks, additionally you must install:
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/git-cli/0.4/git-cli.yaml
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/github-open-pr/0.2/github-open-pr.yaml
To install the pipeline in the target namespace just run the following command from this directory:
kubectl apply -f sonataflow-kaniko-genman-pipeline.yaml
You can see the pipeline installed in the Tekton Dashboard.
Besides the required inputs from the previous example, you need:
repo-config-url
: the configuration Github repository. E.g. where you keep the kubernetes manifests to update the cluster state.github-token-secret
: the Secret that holds the Github Token to open a PR.github-user
andgithub-email
: the Github user and e-mail that owns the token and that will open the PR.
Edit to change with your data, then you can then create the PipelineRun
manifest:
kubectl create -f sonataflow-kaniko-genman-pipeline-run.yaml
You may fire a new run anytime by just creating new runs using this manifest. You may also change the parameters to run your own project.