Quick Start
This guide is for users who want to connect a Git repository to an existing PAC installation and trigger the first PipelineRun.
TOC
IntroductionEstimated Reading TimePrerequisitesStep 1: Configure RepositoryConfirm tkn pac PluginCreate GitLab Personal Access TokenConfigure Repository with tkn pacStep 2: Create Your First PipelineStep 3: Test the PipelineTrigger via PushTrigger via Merge RequestCheck Pipeline StatusNext StepsIntroduction
You will:
- Create a PAC
Repositoryconnection withtkn pac - Add a simple
PipelineRundefinition to the repository - Trigger and check the first run
Estimated Reading Time
10-15 minutes
Prerequisites
- PAC is deployed and exposed to the Git provider network. See Manage PAC Component.
- You have the PAC webhook URL. See Get the PAC Webhook URL.
- You know the PAC namespace. The default is
tekton-pipelines. kubectlis configured for the target cluster.tknCLI is installed with thepacplugin. See tkn pac Command Reference.- You have administrator or maintainer access to the Git repository.
Step 1: Configure Repository
The steps below use the tkn pac CLI and GitLab as an example. For GitHub or manifest-based setup, see Configure GitHub Repository or Configure GitLab Repository.
--pac-namespaceis the namespace where PAC is deployed. The default istekton-pipelines.- The interactive prompt for pipeline namespace is where the
RepositoryandPipelineRunresources are created. Create that namespace before running the command.
Confirm tkn pac Plugin
Confirm the plugin is available:
Example output:
If the command fails, install the plugin from tkn pac Command Reference.
Create GitLab Personal Access Token
- Go to GitLab → Settings → Access Tokens
- Create a token with
apiscope - Save the token securely
Configure Repository with tkn pac
Run the command from the Git repository directory. The .tekton directory will be created in the current working directory.
Replace tekton-pipelines if PAC was deployed in a different namespace.
Follow the interactive prompts:
- Enter Git repository URL (auto-detected from current directory, or enter manually)
- Enter namespace for pipelines, for example
project-pipelines. The namespace must already exist. - Repository CR will be created at this point
- Enter GitLab project ID (found in project settings → General)
- Enter the PAC webhook URL from Get the PAC Webhook URL
- Enter webhook secret (or press Enter to use auto-generated default)
- Enter GitLab access token (the Personal Access Token you created)
- Enter GitLab API URL (default:
https://gitlab.com, or enter your self-hosted GitLab URL)
The command will:
- Create the
Repositoryresource in the selected namespace - Configure GitLab webhook automatically
- Create Kubernetes Secret with credentials
- Generate
.tekton/pipelinerun.yamltemplate in your repository
Step 2: Create Your First Pipeline
The tkn pac create repo command creates a basic template at .tekton/pipelinerun.yaml. Edit it to define your pipeline:
Commit and push to your repository:
Note:
- Replace
<your-branch-name>with your branch name (e.g.,main,master, ordevelop) - Make sure the annotation
pipelinesascode.tekton.dev/on-target-branchmatches your branch name. For example, if your branch ismain, use"[refs/heads/main]"; if it'stest, use"[refs/heads/test]" - To match multiple branches, use comma-separated values:
"[main, develop]"or"[refs/heads/main,refs/heads/develop]" - To match all branches, use:
"[refs/heads/*]"
Step 3: Test the Pipeline
Trigger via Push
Push a commit to the branch specified in your pipeline annotation to trigger the pipeline:
Trigger via Merge Request
Create a Merge Request to trigger the pipeline:
Then create a Merge Request in GitLab.
Check Pipeline Status
View PipelineRuns in the namespace:
Example output:
View pipeline logs:
Example output:
Example output:
Next Steps
- Manage PAC Component - Deploy, update, and uninstall guide
- Guides - End-to-end repository configuration walkthroughs
- Define PipelineRuns in Git - PipelineRun files and trigger annotations
- Trigger Pipelines - Event triggering guide