From 04d01dce3e8ce03edbab11e2f2645a5bbc36f4b5 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Fri, 8 Mar 2024 13:31:53 +0100 Subject: [PATCH] README update (Copr builds & testing pipelines) --- .packit.yaml | 9 ++++--- .pre-commit-config.yaml | 4 +-- README.md | 55 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 62 insertions(+), 6 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index 037e8e0..b43afaa 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -15,8 +15,11 @@ jobs: # branch: main # targets: # - fedora-all -# - epel-7 -# - epel-8 -# - epel-9 +# - epel-7-x86_64 +# - epel-7-aarch64 +# - epel-8-x86_64 +# - epel-8-aarch64 +# - epel-9-x86_64 +# - epel-9-aarch64 # owner: "@osci" # project: mini-tps diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fac2c84..b069290 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ # HOWTO: https://pre-commit.com/#usage # dnf install pre-commit -# pre-commit install -t pre-commit -t pre-push +# pre-commit install repos: - repo: https://github.com/pre-commit/mirrors-prettier @@ -16,7 +16,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.7 + rev: v0.3.1 hooks: - id: ruff-format - id: ruff diff --git a/README.md b/README.md index 060068a..faa9d5d 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,6 @@ See `mtps-prepare-system --list` for the list of available profiles. 3. Fetch the Koji/Brew builds. ``` - mtps-get-task --recursive --task=${TASK_ID} --srpm mtps-get-task --createrepo --installrepofile --recursive --task=${TASK_ID} --download='/var/lib/brew-repo' ``` @@ -48,3 +47,57 @@ See `mtps-prepare-system --list` for the list of available profiles. 5. If you wish to test another package, remove `/etc/yum.repos.d/brew-${TASK_ID}.repo` and the files in `/var/lib/brew-repo` and repeat from the step 3. + +See how the installability pipeline in fedora and RHEL do that: + +- [fedora prepare.sh](https://github.com/fedora-ci/installability-pipeline/blob/master/prepare.sh) +- [fedora installability_runner.sh](https://github.com/fedora-ci/installability-pipeline/blob/master/installability_runner.sh) +- [rhel prepare.sh](https://gitlab.cee.redhat.com/osci-pipelines/installability-pipeline/-/blob/master/prepare.sh) (internal GitLab) +- [rhel](https://gitlab.cee.redhat.com/osci-pipelines/installability-pipeline/-/blob/master/installability_runner.sh) (internal GitLab) + +## Copr RPM builds + +### From a pull request + +The [.packit.yaml](.packit.yaml) tells [Packit](https://packit.dev) to build RPMs from +pull requests in Copr. RPMs from each PR are in a separate repository which you can enable +to install the RPM. + +For example, for [PR#43](https://github.com/fedora-ci/mini-tps/pull/43) +the repository is [packit/fedora-ci-mini-tps-43](https://copr.fedorainfracloud.org/coprs/packit/fedora-ci-mini-tps-43/) (might be already deleted). +You can either run `dnf copr enable packit/fedora-ci-mini-tps-43 ` or if you need a URL to the +repo file then you can find it in the `Repo Download` on the Copr page. + +### From the main branch + +Currently, we don't build automatically because there are no tests and +an unnoticed push to `main` could silently break our RHEL/Fedora pipelines. +To create a new build: + +- run `rpmdev-bumpspec mini-tps.spec` to bump the release in the spec file +- run `packit srpm --no-update-release` to create a SRPM +- Go to [@osci/mini-tps New Build](https://copr.fedorainfracloud.org/coprs/g/osci/mini-tps/add_build_upload), + select the SRPM file and hit `Build` + +To enable the automatic builds, all you need to do is uncomment the `copr_build` job +in the [.packit.yaml](.packit.yaml). + +## Testing your change in a Jenkins pipeline + +Mini-TPS is used in the installability pipeline in Fedora and RHEL. The way you can test a +change from a (yet unmerged) pull request in those pipelines: + +#### Fedora + +- Replace `dnf -y copr enable @osci/mini-tps` with `dnf -y copr enable packit/fedora-ci-mini-tps-` + in [prepare.sh](https://github.com/fedora-ci/installability-pipeline/blob/master/prepare.sh#L13) + and open a PR in the [repo](https://github.com/fedora-ci/installability-pipeline). +- Once the PR appears in [pipelines for PRs](https://osci-jenkins-1.ci.fedoraproject.org/job/fedora-ci/job/installability-pipeline/view/change-requests/), submit `Build with Parameters`. + +#### RHEL + +- Replace [repo url](https://gitlab.cee.redhat.com/osci-pipelines/installability-pipeline/-/blob/master/prepare.sh?ref_type=heads#L27) + with `https://copr.fedorainfracloud.org/coprs/packit/fedora-ci-mini-tps-/repo/epel-${RHEL_VER_MAJOR}/packit-fedora-ci-mini-tps-.repo` and open an MR in the + [repo](https://gitlab.cee.redhat.com/osci-pipelines/installability-pipeline). +- Once the MR appears in [pipelines for MRs](https://jenkins.prod.osci.redhat.com/job/OSCI-Pipelines/job/osci-pipelines%252Finstallability-pipeline/view/change-requests/), + submit `Build with Parameters`.