### TMT Execute Step for Shell Commands (Apache Test) Source: https://packit.dev/docs/testing-farm An 'execute' step example demonstrating how to run shell commands directly, including installing packages, starting services, and verifying output, suitable for integration tests. ```yaml execute: script: - dnf -y install httpd curl - systemctl start httpd - echo foo > /var/www/html/index.html - curl http://localhost/ | grep foo ``` -------------------------------- ### TMT Execute Step for Shell Commands (Apache Test) Source: https://packit.dev/docs/configuration/upstream/tests An 'execute' step example demonstrating how to run shell commands directly, including installing packages, starting services, and verifying output, suitable for integration tests. ```yaml execute: script: - dnf -y install httpd curl - systemctl start httpd - echo foo > /var/www/html/index.html - curl http://localhost/ | grep foo ``` -------------------------------- ### Get Version for Python Packages Source: https://packit.dev/docs/configuration/examples This snippet demonstrates how to get the version of a Python package by executing 'python3 setup.py --version'. This is a common method for packages using setuptools. ```python get-current-version: - python3 setup.py --version ``` -------------------------------- ### Get Version from Specfile (grep) Source: https://packit.dev/docs/configuration/examples This snippet demonstrates how to extract the version from a .spec file using grep. It targets lines starting with 'Version:' and extracts the version string. ```shell get-current-version: - grep -oP '^Version:\s+\K\S+' my-package.spec ``` -------------------------------- ### TMT Prepare Step with Ansible Playbook Source: https://packit.dev/docs/testing-farm Example of a 'prepare' step configuration in tmt, specifying an Ansible playbook to set up the test environment, such as installing necessary packages. ```yaml prepare: how: ansible playbook: - setup/packages.yml ``` -------------------------------- ### Copr Build for All Pull Requests Source: https://packit.dev/docs/configuration/examples Sets up a `copr_build` job that triggers for all incoming pull requests and targets all Fedora distributions. ```yaml -job: copr_build trigger: pull_request targets: - fedora-all ``` -------------------------------- ### Packit Koji Build in Container Source: https://packit.dev/docs/cli Illustrates performing a Koji build with the Packit CLI inside a container. This setup involves mounting SSH configuration for authentication and the project source code, along with an initial authentication step. ```bash $ podman run -ti --rm -v ~/.ssh/:/root/.ssh:z -v $PWD:/src:z quay.io/packit/packit bash $ fkinit -u $ packit build in-koji ``` -------------------------------- ### Download Specfile from Dist-Git Source: https://packit.dev/docs/configuration/examples This action downloads a specfile from a Fedora dist-git repository. It uses wget to fetch the file and saves it with the expected name. ```shell post-upstream-clone: -"wget https://src.fedoraproject.org/rpms/my-package/raw/main/f/my-package.spec -O my-package.spec" ``` -------------------------------- ### Koji Build for All Pull Requests Source: https://packit.dev/docs/configuration/examples Configures an `upstream_koji_build` job that triggers for all incoming pull requests and targets all Fedora distributions. ```yaml -job: upstream_koji_build trigger: pull_request targets: - fedora-all ``` -------------------------------- ### Create SRPM Archive with Git Submodules Source: https://packit.dev/docs/configuration/examples This example creates a custom archive for SRPMs that includes git submodules. It updates submodules, lists files recursively, and archives them with a 'pkg/' prefix. ```shell create-archive: - git submodule update --init # Create an archive file with the ‹pkg› directory prefix - bash -c 'git ls-files --recurse-submodules | tar --transform "s|^|pkg/|" -caf .packit/pkg.tar.gz -T-' - echo '.packit/pkg.tar.gz' ``` -------------------------------- ### Get Version from Specfile (rpmspec) Source: https://packit.dev/docs/configuration/examples This snippet shows how to retrieve the version from a .spec file using the rpmspec command, which correctly handles RPM macros. It queries for the VERSION attribute. ```shell get-current-version: - rpmspec -q --queryformat "%{VERSION}\n" --srpm *spec ``` -------------------------------- ### Create SRPM Archive with Custom Make Target Source: https://packit.dev/docs/configuration/examples This example shows how to create a custom archive for SRPM using a 'make release' target. It then lists the most recently created tar.gz file. ```shell create-archive: - make release - bash -c "ls -1t ./my-package-*.tar.gz| head -n 1" ``` -------------------------------- ### TMT Prepare Step with Ansible Playbook Source: https://packit.dev/docs/configuration/upstream/tests Example of a 'prepare' step configuration in tmt, specifying an Ansible playbook to set up the test environment, such as installing necessary packages. ```yaml prepare: how: ansible playbook: - setup/packages.yml ``` -------------------------------- ### TMT Test Structure Example Source: https://packit.dev/docs/testing-farm Demonstrates the output of the tmt command for discovering tests and plans, and lists the contents of the plans directory. Useful for understanding project initialization and structure. ```shell $ tmt Found 3 tests: /tests/full, /tests/smoke and /tests_recording. Found 4 plans: /plans/full, /plans/rpmlint, /plans/session-recording and /plans/smoke. Found 0 stories. $ ls -1 plans/ full.fmf main.fmf rpmlint.fmf session-recording.fmf smoke.fmf ``` -------------------------------- ### Koji Build for Pull Requests on 'main' Branch Source: https://packit.dev/docs/configuration/examples Sets up an `upstream_koji_build` job to trigger for pull requests targeting the 'main' branch, building against all Fedora distributions. ```yaml -job: upstream_koji_build trigger: pull_request branch: main targets: - fedora-all ``` -------------------------------- ### Packit CLI Installation and Configuration Source: https://packit.dev/docs/fedora-releases-guide/what-to-know Steps to install the Packit CLI and configure user settings, including necessary tokens. This is essential for manual operations and troubleshooting during service outages. ```APIDOC Packit CLI Setup: 1. Install Packit CLI: - Reference: https://packit.dev/docs/cli 2. Configure Required Tokens: - Description: Set up authentication and authorization by configuring required tokens in your user configuration file. - Reference: https://packit.dev/docs/configuration#user-configuration-file 3. Verify Setup: - Description: Ensure your Packit CLI setup is working correctly, especially if the service is unavailable. - Follow dist-git onboarding guide: https://packit.dev/docs/fedora-releases-guide/dist-git-onboarding - Validate config: `packit config validate` ``` -------------------------------- ### Install Packit CLI from Source Source: https://packit.dev/docs/cli Installs the Packit CLI directly from its GitHub repository using pip. This method requires installing development dependencies beforehand, as mentioned in the PyPI installation section. ```bash $ pip install --user git+https://github.com/packit/packit ``` -------------------------------- ### Map Build and Test Targets with Distros Source: https://packit.dev/docs/configuration/examples Defines mappings between build targets and test targets, specifying the exact distributions to use for testing. This allows for granular control over the testing environment. ```yaml -job: copr_build trigger: pull_request targets: - epel-7-x86_64 - epel-8-x86_64 -job: tests trigger: pull_request targets: epel-7-x86_64: distros:[centos-7, oraclelinux-7] epel-8-x86_64: distros:[centos-8, oraclelinux-8] ``` -------------------------------- ### TMT Test Structure Example Source: https://packit.dev/docs/configuration/upstream/tests Demonstrates the output of the tmt command for discovering tests and plans, and lists the contents of the plans directory. Useful for understanding project initialization and structure. ```shell $ tmt Found 3 tests: /tests/full, /tests/smoke and /tests_recording. Found 4 plans: /plans/full, /plans/rpmlint, /plans/session-recording and /plans/smoke. Found 0 stories. $ ls -1 plans/ full.fmf main.fmf rpmlint.fmf session-recording.fmf smoke.fmf ``` -------------------------------- ### Provide Additional Testing Farm Artifacts Source: https://packit.dev/docs/configuration/examples Configures Packit to include additional artifacts in the Testing Farm execution. This example specifies an artifact of type 'repository' with a given URL. ```yaml -job: copr_build trigger: pull_request targets: - fedora-all -job: tests trigger: pull_request targets: - fedora-all tf_extra_params: environments: -artifacts: -type: repository id: https://my.repo/repository ``` -------------------------------- ### Packit: Propose Downstream for Fedora Releases Source: https://packit.dev/docs/configuration/examples Configures Packit to automatically propose downstream pull requests for Fedora releases. This setup uses the 'propose_downstream' job and is triggered by release events, targeting all Fedora branches. ```YAML -job: propose_downstream trigger: release dist_git_branches: - fedora-all ``` -------------------------------- ### Custom Changelog Entry from File Source: https://packit.dev/docs/configuration/examples Configures Packit to use the content of a specified file (`.changelog_entry`) as the changelog entry for a release. ```yaml changelog-entry: - cat .changelog_entry ``` -------------------------------- ### Prepare Sources with packit CLI Source: https://packit.dev/docs/reproduce-locally This command prepares sources for Copr builds by fetching and merging pull request changes. It requires the Packit CLI to be installed and configured. ```bash $ packit prepare-sources --result-dir directory-to-place-sources --pr-id 150 \ --merge-pr --target-branch main --job-config-index 2 https://github.com/packit/packit ``` -------------------------------- ### Install Packit CLI from Fedora Copr (Development) Source: https://packit.dev/docs/cli Installs the latest development snapshot of Packit from a Fedora Copr repository. This allows testing the main branch of Packit. ```bash $ sudo dnf copr enable packit/packit-dev $ sudo dnf install packit $ # OR in case you have packit already installed from the Fedora repositories: $ sudo dnf upgrade packit ``` -------------------------------- ### Koji Build Job Configuration Example Source: https://packit.dev/docs/fedora-releases-guide/dist-git-onboarding An example of how to configure the `koji_build` job within the Packit YAML configuration. This job triggers Koji builds when new commits are detected in the dist-git repository. ```yaml jobs: - job: koji_build trigger: commit dist_git_branches: - fedora-all ``` -------------------------------- ### TMT Prepare Step to Skip Artifact Installation Source: https://packit.dev/docs/testing-farm Configuration for the 'prepare' step to exclude all artifacts from installation, useful in scenarios where default artifact handling is not desired. ```yaml prepare: -how: install exclude: - ".*" ``` -------------------------------- ### Copr Build for Pull Requests on 'main' Branch Source: https://packit.dev/docs/configuration/examples Configures a `copr_build` job to trigger specifically for pull requests targeting the 'main' branch, building against all Fedora distributions. ```yaml -job: copr_build trigger: pull_request branch: main targets: - fedora-all ``` -------------------------------- ### EPEL Alias Configuration Example Source: https://packit.dev/docs/configuration Demonstrates how to configure targets for EPEL builds, specifically mapping `rhel+epel-10-x86_64` to `CentOS-Stream-10` when not using internal Testing Farm compose. ```yaml targets: rhel+epel-10-x86_64: distros: [CentOS-Stream-10] ``` -------------------------------- ### Packit: Pull from Upstream with Branch-Specific Configs Source: https://packit.dev/docs/configuration/examples Demonstrates configuring Packit to pull changes from an upstream project with distinct settings for different dist-git branches. This example shows separate configurations for 'fedora-38' and 'fedora-rawhide', including tag filtering. ```YAML upstream_project_url: https://github.com/packit/packit jobs: -job: pull_from_upstream trigger: release dist_git_branches: - fedora-38 upstream_tag_include: "^2\\..+" upstream_tag_exclude: "^.+\\.1\\..+" -job: pull_from_upstream trigger: release dist_git_branches: - fedora-rawhide ``` -------------------------------- ### Packit Job Configuration Example Source: https://packit.dev/docs/configuration/jobs Demonstrates a basic Packit job configuration with a COPR build trigger for multiple targets, showcasing the structure of job definitions. ```yaml jobs: - job: copr_build trigger: pull_request targets: - centos-stream-8-x86_64 - centos-stream-9-x86_64 - fedora-all - job: copr_build trigger: commit branch: main ``` -------------------------------- ### Run Tests Only (Skip Builds) Source: https://packit.dev/docs/configuration/examples Configures Packit to execute only test jobs, skipping any build processes. This is useful when only testing is required for a pull request. ```yaml -job: tests trigger: pull_request targets: - fedora-all skip_build:True ``` -------------------------------- ### Run Packit in a Container Source: https://packit.dev/docs/cli Demonstrates how to run the Packit CLI tool inside a Fedora-based container. This method ensures a consistent environment and includes mounting the current directory for access to project files. ```bash $ podman run -ti --rm -v $PWD:/src:z quay.io/packit/packit bash $ packit Usage: packit [OPTIONS] COMMAND [ARGS]... ``` -------------------------------- ### Provide Custom TMT Context Source: https://packit.dev/docs/configuration/examples Configures Packit to pass custom context information to the TMT (Test Management Tool) execution. The `how: "full"` context is provided via `tf_extra_params`. ```yaml -job: copr_build trigger: pull_request targets: - fedora-all -job: tests trigger: pull_request targets: - fedora-all tf_extra_params: environments: -tmt: context: how:"full" ``` -------------------------------- ### Custom Archive Creation with Tito Source: https://packit.dev/docs/configuration/examples Demonstrates how to create local archives using a `pre-sync` action with `tito` and include them in `files_to_sync` for release syncing. This ensures archives are correctly handled by Packit when moving to the dist-git repo. ```yaml actions: pre-sync: - tito build -o . --tgz files_to_sync: - src: - "-*.tar.gz" dest: . ``` -------------------------------- ### Get Version for Ruby Packages Source: https://packit.dev/docs/configuration/examples This snippet shows how to extract the version from a Ruby gemspec file. It uses Ruby code to load the gemspec and access its version attribute. ```ruby get-current-version: - ruby -rrubygems -e 'puts Gem::Specification::load(Dir.glob("*.gemspec").first).version' ``` -------------------------------- ### Packit Configuration: Custom Archive and Version Commands Source: https://packit.dev/docs/cli/srpm Example of how to define custom commands for creating archives and getting the current version within the `packit.yaml` configuration file. This allows overriding the default Git-based methods. ```yaml actions: create-archive: - python3 setup.py sdist --dist-dir ./fedora/ - bash -c "ls -1t ./fedora/*.tar.gz| head -n 1" get-current-version: python3 setup.py --version ``` -------------------------------- ### Packit: Bodhi Updates for Successful Koji Builds Source: https://packit.dev/docs/configuration/examples Configures Packit to automatically create Bodhi updates for successful Koji builds. This setup uses the 'bodhi_update' job and is triggered by commit events, specifically for 'fedora-branched' branches. ```YAML -job: bodhi_update trigger: commit dist_git_branches: - fedora-branched # rawhide updates are created automatically ``` -------------------------------- ### Create SRPM Archive for Python Packages Source: https://packit.dev/docs/configuration/examples This snippet demonstrates creating a source distribution (sdist) archive for Python packages using 'python3 setup.py sdist'. It then identifies the created tar.gz file. ```python create-archive: - python3 setup.py sdist --dist-dir . - bash -c "ls -1t ./my-package-*.tar.gz| head -n 1" ``` -------------------------------- ### Packit: Koji Builds on Dist-Git Commit Source: https://packit.dev/docs/configuration/examples Configures Packit to trigger Koji builds automatically when pull requests in dist-git are merged or commits are made. This setup uses the 'koji_build' job and is triggered by commit events for all Fedora branches. ```YAML -job: koji_build trigger: commit dist_git_branches: - fedora-all ``` -------------------------------- ### Install Packit CLI Dependencies for PyPI Source: https://packit.dev/docs/cli Installs necessary development packages required for compiling Python dependencies when installing Packit from PyPI on Fedora. These include compilers and development headers. ```bash $ sudo dnf install gcc python3-devel libcurl-devel krb5-devel openssl-devel ``` -------------------------------- ### packit build in-obs CLI Usage and Options Source: https://packit.dev/docs/cli/build/in-obs This snippet details the command-line interface for building projects in OBS using packit. It includes the basic usage syntax, a description of the command's purpose, and a list of available options with their explanations. Before running, ensure your Open Build Service credentials are set up in ~/.config/osc/oscrc by running 'osc'. ```cli Usage: packit build in-obs [OPTIONS] [PATH_OR_URL] Build selected project in OBS Before Running this command, your opensuse user account and password needs to be configured in osc configuration file ~/.config/osc/oscrc. This can be done by running `osc`. Options: --owner TEXT OBS user, owner of the project. (defaults to the username from the oscrc) --project TEXT Project name to build in. It will be created if does not exist. It defaults to home:$owner:packit:$pkg --targets TEXT Comma separated list of chroots to build in. (defaults to 'fedora-rawhide-x86_64') --description TEXT Description of the project to build in. --upstream-ref TEXT Git ref of the last upstream commit in the current branch from which packit should generate patches (this option implies the repository is source-git). --wait / --no-wait Wait for the build to finish -p, --package TEXT Package to build, if more than one available, like in a monorepo configuration. Use it multiple times to select multiple packages.Defaults to all the packages listed inside the config. -h, --help Show this message and exit. ``` -------------------------------- ### Install Packit CLI from PyPI Source: https://packit.dev/docs/cli Installs the Packit CLI using pip from the PyPI repository. Note that the package name on PyPI is 'packitos'. Ensure dependencies are installed first if on Fedora. ```bash $ pip install --user packitos ``` -------------------------------- ### Install Packit CLI on RHEL/CentOS Stream 9 Source: https://packit.dev/docs/cli Installs the Packit CLI on RHEL or CentOS Stream 9 by first enabling the EPEL repository and then installing the packit package via DNF. ```bash $ sudo dnf install epel-release $ sudo dnf install packit ``` -------------------------------- ### Run Packit Sandbox Container with Podman Source: https://packit.dev/docs/reproduce-locally This command launches the production Packit sandbox image using Podman. It binds the current directory to /src within the container and sets the working directory, allowing you to run commands and debug issues in an environment similar to Packit's execution context. ```shell $ podman run -ti --rm --memory 768MB -v $PWD:/src -w /src quay.io/packit/sandcastle:prod bash ``` -------------------------------- ### Install Packit CLI on Fedora Linux Source: https://packit.dev/docs/cli Installs the Packit CLI using the DNF package manager on Fedora Linux. This is the standard method for Fedora users. ```bash $ sudo dnf install packit ``` -------------------------------- ### Propose Downstream Job Configuration Example Source: https://packit.dev/docs/configuration/upstream/propose_downstream Example configuration for the 'propose_downstream' job, specifying dist-git branches for updates. ```yaml jobs: -job: propose_downstream trigger: release -job: propose_downstream trigger: release dist_git_branches: - f39 ``` -------------------------------- ### Packit Configuration with Actions Source: https://packit.dev/docs/configuration/actions An example of a .packit.yaml file defining project settings and custom actions. It shows how to specify actions for tasks like preparing files, creating archives, and generating changelog entries, including the use of bash commands. ```yaml specfile_path: package.spec files_to_sync: - packit.yaml - package.spec upstream_package_name: package downstream_package_name: package dist_git_url: https://src.fedoraproject.org/rpms/package.git actions: prepare-files:"make prepare" create-archive: -"make archive" - bash -c "ls -1 ./package-*.tar.gz" changelog-entry: - bash -c 'echo "- New release ${PACKIT_PROJECT_VERSION}"' ``` -------------------------------- ### TMT Prepare Step to Skip Artifact Installation Source: https://packit.dev/docs/configuration/upstream/tests Configuration for the 'prepare' step to exclude all artifacts from installation, useful in scenarios where default artifact handling is not desired. ```yaml prepare: -how: install exclude: - ".*" ``` -------------------------------- ### Multiple Copr Builds with Custom Actions and Targets Source: https://packit.dev/docs/configuration/examples Defines two `copr_build` jobs: one for all pull requests targeting 'fedora-all' with a custom identifier 'fedora', and another for pull requests with a specific `specfile_path` and custom archive creation actions, targeting 'epel-8'. ```yaml jobs: -job: copr_build trigger: pull_request identifier: fedora targets: - fedora-all -job: copr_build trigger: pull_request specfile_path: epel8/python-specfile.spec identifier: epel8 actions: create-archive: - python3 setup.py sdist --dist-dir ./epel8/ - bash -c "ls -1t ./epel8/*.tar.gz| head -n 1" targets: - epel-8 ``` -------------------------------- ### Copr Build for Pushes to 'main' in Custom Project Source: https://packit.dev/docs/configuration/examples Sets up a `copr_build` job for commits pushed to the 'main' branch, targeting specific EPEL versions (6, 7, 8) within a custom Copr project (`@oamg/convert2rhel`). ```yaml -job: copr_build trigger: commit branch: main owner: "@oamg" project: convert2rhel targets: - epel-6-x86_64 - epel-7-x86_64 - epel-8-x86_64 ``` -------------------------------- ### Bodhi Update Job Configuration Example Source: https://packit.dev/docs/configuration/downstream/bodhi_update An example YAML configuration for setting up a bodhi_update job in Packit, specifying the issue repository, job type, and distribution branches. ```yaml issue_repository: https://github.com/my-username/packit-notifications jobs: - job: bodhi_update trigger: commit dist_git_branches: - fedora-branched - epel-8 ``` -------------------------------- ### Execute Commands in OpenShift Sandbox with Python Sandcastle Source: https://packit.dev/docs/reproduce-locally This Python script demonstrates how to use the sandcastle library to execute commands within an OpenShift pod. It sets up a mapped directory for your project, runs specified commands, and cleans up the pod afterward. This requires the sandcastle library, an active OpenShift login, and the rsync binary. ```python from sandcastle import Sandcastle from sandcastle.mapped_dir import MappedDir # this should be the path to your local clone of the upstream project git_repo_path:str="fill-me" # kubernetes namespace to use k8s_namespace:str="myproject" command =["your","command","of","choice"] # This is how your code gets copied (via rsync) into the openshift pod m_dir = MappedDir(git_repo_path,"/sandcastle", with_interim_pvc=True) o = Sandcastle( image_reference="docker.io/usercont/sandcastle:prod", k8s_namespace_name=k8s_namespace, mapped_dir=m_dir ) o.run() try: output = o.exec(command=command) print(output) finally: o.delete_pod() ``` -------------------------------- ### Packit CLI Initialization Source: https://packit.dev/docs/guide Command to generate a basic Packit configuration file structure. This command helps in setting up a new project with Packit by guessing the package name from the directory. ```cli packit init ``` -------------------------------- ### Install copr-rpmbuild in Fedora Container Source: https://packit.dev/docs/reproduce-locally Installs the `copr-rpmbuild` package within the running Fedora container using the DNF package manager. This tool is required to reproduce Copr builds locally. ```bash [root@f26be2947a15 /]# dnf install -y copr-rpmbuild ``` -------------------------------- ### Packit Pull From Upstream Job Configuration Example Source: https://packit.dev/docs/configuration/downstream/pull_from_upstream An example configuration snippet for the Packit 'pull_from_upstream' job. It demonstrates how to specify the upstream project URL, the repository for notifications, and the dist-git branches Packit should operate on for release synchronization. ```yaml upstream_project_url: https://github.com/packit/packit issue_repository: https://github.com/my-username/packit-notifications jobs: -job: pull_from_upstream trigger: release dist_git_branches: - fedora-all - epel-9 ``` -------------------------------- ### Packit Actions Overview Source: https://packit.dev/docs/configuration/actions Lists common actions and hooks used in Packit for release management, categorized by functionality like syncing releases, creating SRPMs, and job-level controls. Each action has a name, working directory, execution timing, and a description. ```APIDOC Syncing the release actions: - post-upstream-clone: After cloning upstream and dist-git repos. - pre-sync: After GPG keys verification and version compatibility check. - prepare-files: Replaces patching and archive generation. - create-patches: Replaces patching. - post-modifications: After modifications to spec file and before uploading to lookaside cache. - get-current-version: Expects version as stdout parameter. - changelog-entry: Stdout is used as a changelog entry. - commit-message: Overrides default commit message. Creating SRPM actions: - post-upstream-clone: After cloning upstream repo and before other operations. - get-current-version: Expects version as stdout. - create-archive: Replaces the code for creating an archive. - create-patches: Replaces patching. - fix-spec-file: Changes spec file to use the new tarball. - post-modifications: After modifications to spec file and before running rpmbuild. - changelog-entry: Stdout is used as a changelog entry. Job-level actions: - run-condition: Determines if a job will run based on its exit code. ``` -------------------------------- ### Utilize Custom Failure Message Source: https://packit.dev/docs/configuration/examples Configures Packit to send a custom failure message via notifications when tests fail. This example includes a message for reverse dependency tests, referencing the commit SHA and mentioning an admin. ```yaml -job: copr_build trigger: pull_request targets: - fedora-all -job: tests identifier: revdeps trigger: pull_request targets: - fedora-all notifications: failure_comment: message:> Reverse dep tests failed for commit {commit_sha}. @admin, please check. ``` -------------------------------- ### Dist-Git Configuration Example (YAML) Source: https://packit.dev/docs/fedora-releases-guide/dist-git-onboarding This YAML configuration defines a Packit pipeline for dist-git workflows. It includes jobs for pulling from upstream, building packages using Koji, and creating Bodhi updates, specifying triggers and target branches for each step. ```yaml jobs: - job: pull_from_upstream trigger: release dist_git_branches: - fedora-rawhide - job: koji_build trigger: commit dist_git_branches: - fedora-rawhide - job: bodhi_update trigger: commit dist_git_branches: - fedora-branched # rawhide updates are created automatically ``` -------------------------------- ### Use Internal Testing Farm Instance Source: https://packit.dev/docs/configuration/examples Configures Packit to use an internal Testing Farm instance for running tests. This requires enabling the internal instance and specifies targets like 'epel-8-x86_64' with specific RHEL versions. ```yaml -job: copr_build trigger: pull_request targets: - epel-8-x86_64 -job: tests trigger: pull_request targets: epel-8-x86_64: distros:[RHEL-8.8.0-Nightly] use_internal_tf:True ``` -------------------------------- ### `run-condition` Example: Skip Pre-release Versions Source: https://packit.dev/docs/configuration/actions Illustrates how to use the 'run-condition' action with a `bash` command to conditionally execute a job. This specific example ensures the job runs only if the project version is not a pre-release (e.g., not ending in -alpha, -beta, or -rc). ```bash jobs: -job: koji_build trigger: commit dist-git-branches: - fedora-all actions: run-condition: # run only if version is not a pre-release - bash -c 'echo $PACKIT_PROJECT_VERSION | grep -Pvq -- "-(alpha|beta|rc)\d*$"' ```