Skip to content

Commit

Permalink
README update (Copr builds & testing pipelines)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpopelka committed Mar 8, 2024
1 parent 6c35b44 commit 04d01dc
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
```

Expand All @@ -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-<PR-number>`
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-<PR-number>/repo/epel-${RHEL_VER_MAJOR}/packit-fedora-ci-mini-tps-<PR-number>.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`.

0 comments on commit 04d01dc

Please sign in to comment.