Skip to content

Commit

Permalink
Add dockerfile for rhel and gl ci config
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Srb <michal@redhat.com>
  • Loading branch information
msrb committed Feb 8, 2024
1 parent 3f527eb commit 134f074
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
stages:
- buildimage

variables:
CI_REGISTRY: images.paas.redhat.com
CI_REGISTRY_REPO: osci/rpminspect

image build:
rules:
- if: $CI_COMMIT_BRANCH == "master"
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
stage: buildimage
tags:
- docker
before_script:
- mkdir -p /kaniko/.docker
- cat "$DOCKER_AUTH_CONFIG" > /kaniko/.docker/config.json
script:
- >
/kaniko/executor
--skip-tls-verify
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile
--destination ${CI_REGISTRY}/${CI_REGISTRY_REPO}:${CI_COMMIT_SHORT_SHA}
--destination ${CI_REGISTRY}/${CI_REGISTRY_REPO}:latest
merge request image build:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
stage: buildimage
tags:
- docker
before_script:
- mkdir -p /kaniko/.docker
- cat "$DOCKER_AUTH_CONFIG" > /kaniko/.docker/config.json
script:
- >
/kaniko/executor
--skip-tls-verify
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile
--destination ${CI_REGISTRY}/${CI_REGISTRY_REPO}:mr-${CI_MERGE_REQUEST_IID}
--destination ${CI_REGISTRY}/${CI_REGISTRY_REPO}:mr-${CI_MERGE_REQUEST_IID}-${CI_COMMIT_SHORT_SHA}
47 changes: 47 additions & 0 deletions Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM images.paas.redhat.com/osci/base-minimal
LABEL maintainer "OSCI"
LABEL description="rpminspect for RHEL"

# https://copr.fedorainfracloud.org/coprs/dcantrell/rpminspect/
ENV RPMINSPECT_PACKAGE_NAME=rpminspect
# https://copr.devel.redhat.com/coprs/dcantrell/rpminspect-data-redhat/
ENV RPMINSPECT_DATA_PACKAGE_NAME=rpminspect-data-redhat

ENV KOJI_BIN=/usr/bin/brew
ENV RPMINSPECT_CONFIG=/usr/share/rpminspect/redhat.yaml

# Add repository for "brew" command
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
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
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
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

# Update and install dependencies
RUN dnf -y update &&\
dnf -y install --enablerepo=rhel-9-buildroot \
${RPMINSPECT_PACKAGE_NAME} \
${RPMINSPECT_DATA_PACKAGE_NAME} \
clamav-update \
python3-pyyaml \
python3-click \
python3-retry \
python3-GitPython \
koji \
git \
jq \
brewkoji \
&& dnf clean all

RUN freshclam

COPY *.sh *.py /usr/local/bin/

0 comments on commit 134f074

Please sign in to comment.