Skip to content

Commit

Permalink
Merge pull request #108 from jpopelka/update-license-data
Browse files Browse the repository at this point in the history
Install fedora-license-data from Copr and update it during run
  • Loading branch information
jpopelka authored Feb 21, 2024
2 parents b33496d + 7f1cad5 commit 776429b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 11 deletions.
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# HOWTO: https://pre-commit.com/#usage
# dnf install pre-commit
# pre-commit install

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
args: [--severity=error]
10 changes: 7 additions & 3 deletions Dockerfile.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@ ENV RPMINSPECT_CONFIG=/usr/share/rpminspect/redhat.yaml
RUN cd /etc/yum.repos.d/ && \
curl -L -O https://download.devel.redhat.com/rel-eng/RCMTOOLS/rcm-tools-rhel-9-baseos.repo

# Add COPR reposiroty with rpminspect
# Add COPR repository with rpminspect
RUN cd /etc/yum.repos.d/ && \
curl -L -O https://copr.fedorainfracloud.org/coprs/g/osci/rpminspect/repo/epel-9/group_osci-rpminspect-epel-9.repo

# Add COPR reposiroty with rpminspect data package
# Add COPR repository with rpminspect data package
RUN cd /etc/yum.repos.d/ && \
curl -L -O https://copr.devel.redhat.com/coprs/dcantrell/rpminspect-data-redhat/repo/epel-9/dcantrell-rpminspect-data-redhat-epel-9.repo

# Add COPR reposiroty with rpminspect data package dependencies
# Add COPR repository with rpminspect data package dependencies
RUN cd /etc/yum.repos.d/ && \
curl -L -O https://copr.fedorainfracloud.org/coprs/g/osci/rpminspect-data-deps/repo/epel-9/group_osci-rpminspect-data-deps-epel-9.repo

# Add COPR repository with latest fedora-license-data
RUN cd /etc/yum.repos.d/ && \
curl -L -O https://copr.fedorainfracloud.org/coprs/g/osci/fedora-license-data/repo/epel-9/group_osci-fedora-license-data-epel-9.repo

# Update and install dependencies
RUN dnf -y update &&\
dnf -y install --enablerepo=rhel-9-buildroot \
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

This repository contains bits needed to build a container image for [rpminspect](https://github.com/rpminspect/rpminspect). This image can be later used by Fedora CI.


## Example usage

`rpminspect_runner.sh` takes three parameters: `<task-id>` `<koji-tag-with-previous-build>` `<inspection-name>`
Expand Down
10 changes: 5 additions & 5 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@

The runner script tries to update rpminspect (and data package) to the latest version every time it runs.


## How to build and run the container image locally


Build the image using podman:

```shell
$ podman build -t quay.io/fedoraci/rpminspect:devel .
```

You can also force-update base image and dependencies with `--pull` and `--no-cache` options:

```shell
$ podman build --pull --no-cache -t quay.io/fedoraci/rpminspect:devel .
```

Run the image:

```shell
$ podman run -ti --rm quay.io/fedoraci/rpminspect:devel /bin/bash

Expand All @@ -31,7 +32,6 @@ $ rpminspect_runner.sh 84688996 f37-updates license
...
```


## rpminspect-image CI/CD

Push to the master branch triggers a new image build in [Quay.io](https://quay.io/repository/fedoraci/rpminspect). Once the build is finished, you can pull the image from the registry (replace the image tag):
Expand All @@ -49,23 +49,23 @@ If Quay.io fails to build the image (infra/network errors...), it is possible to
Only owners of the [`fedoraci` namespace](https://quay.io/organization/fedoraci/teams/owners) can push images manually.

Build the image using podman:

```shell
$ podman build --pull --no-cache -t quay.io/fedoraci/rpminspect:$(git rev-parse --short HEAD) .
```

Create a new [robot account](https://quay.io/repository/fedoraci/rpminspect?tab=settings), then click on the account name and select the "Docker Login" tab. Copy the login command and replace "docker" with "podman".

Push the image:

```shell
podman push quay.io/fedoraci/rpminspect:$(git rev-parse --short HEAD)
```


## Promote new image to production

Update image tag in [rpminspect.fmf](https://github.com/fedora-ci/rpminspect-pipeline/blob/master/rpminspect.fmf).


### Test the image end-to-end in CI

Opening a pull-request in [fedora-ci/rpminspect-pipeline](https://github.com/fedora-ci/rpminspect-pipeline) repository will automatically create a test pipeline in [Fedora CI Jenkins](https://osci-jenkins-1.ci.fedoraproject.org/job/fedora-ci/job/rpminspect-pipeline/view/change-requests/). This pipeline contains changes from the pull-request, so it is possible to update the image reference in the [rpminspect.fmf](https://github.com/fedora-ci/rpminspect-pipeline/blob/master/rpminspect.fmf) file and then test the whole pipeline end-to-end in Jenkins.
4 changes: 2 additions & 2 deletions rpminspect_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ fi
# We can uncomment this once the latest annocheck can be installed from a stable repo.
#dnf update -y annobin* > update_annobin.log 2>&1 || :

# Update the data package, but from COPR, not from the official Fedora repositories
dnf update --disablerepo="fedora*" -y ${RPMINSPECT_PACKAGE_NAME} ${RPMINSPECT_DATA_PACKAGE_NAME} > update_rpminspect.log 2>&1 || :
# Update the data packages, but from COPR, not from the official Fedora repositories
dnf -y update --disablerepo="fedora*" "${RPMINSPECT_PACKAGE_NAME}" "${RPMINSPECT_DATA_PACKAGE_NAME}" fedora-license-data > update_rpminspect.log 2>&1 || :

output_filename=${TMT_TEST_DATA:-.}/result.json
verbose_log=${TMT_TEST_DATA:-.}/verbose.log
Expand Down

0 comments on commit 776429b

Please sign in to comment.