-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'clebergnu/release_92_1_check_copr' into…
… 92lts Signed-off-by: Cleber Rosa <crosa@redhat.com>
- Loading branch information
Showing
2 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
contrib/containers/ci/selftests/check-copr-rpm-version.docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This container is used in selftests/pre_release/tests/check-copr-rpm-version.sh | ||
FROM fedora:36 | ||
LABEL description "Fedora image used on COPR RPM version check" | ||
RUN dnf -y module disable avocado:latest | ||
RUN dnf -y install 'dnf-command(copr)' | ||
RUN dnf -y copr enable @avocado/avocado-latest | ||
RUN dnf -y clean all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
#!/bin/sh -e | ||
|
||
# This script accepts a package NVR as its first argument. If not given, | ||
# it will default to a NVR based on the info of the repository given | ||
|
||
# Put here the name of your GIT remote that tracks the official | ||
# repo, that is, https://github.com/avocado-framework/avocado | ||
# (or the git:// url version of the same repo) | ||
ORIGIN=origin | ||
|
||
git fetch $ORIGIN | ||
|
||
ORIGIN_MASTER_COMMIT=$(git log --pretty=format:'%h' -n 1 $ORIGIN/master) | ||
ORIGIN_MASTER_COMMIT=$(git log --pretty=format:'%h' -n 1 $ORIGIN/92lts) | ||
VERSION=$(python setup.py --version 2>/dev/null) | ||
COMMIT_DATE=$(git log --pretty='format:%cd' --date='format:%Y%m%d' -n 1) | ||
SHORT_COMMIT=$(git rev-parse --short=9 $ORIGIN/master) | ||
COMMIT_DATE=$(git log --pretty='format:%cd' --date='format:%Y%m%d' -n 1 $ORIGIN/92lts) | ||
SHORT_COMMIT=$(git rev-parse --short=9 $ORIGIN/92lts) | ||
RPM_RELEASE_NUMBER=$(grep -E '^Release:\s([0-9]+)' python-avocado.spec | sed -E 's/Release:\s([0-9]+).*/\1/') | ||
DISTRO=fedora | ||
DISTRO_VERSION=34 | ||
DISTRO_VERSION=36 | ||
|
||
RPM_NVR="python3-avocado-${VERSION}-${RPM_RELEASE_NUMBER}.${COMMIT_DATE}git${SHORT_COMMIT}.fc${DISTRO_VERSION}" | ||
DEFAULT_RPM_NVR="python3-avocado-${VERSION}-${RPM_RELEASE_NUMBER}.${COMMIT_DATE}git${SHORT_COMMIT}.fc${DISTRO_VERSION}" | ||
RPM_NVR="${1:-$DEFAULT_RPM_NVR}" | ||
|
||
PODMAN=$(which podman) | ||
PODMAN_IMAGE="${DISTRO}:${DISTRO_VERSION}" | ||
PODMAN=$(which podman 2>/dev/null || which docker) | ||
PODMAN_IMAGE=quay.io/avocado-framework/check-copr-rpm-version | ||
|
||
$PODMAN run --rm -ti $PODMAN_IMAGE /bin/bash -c "dnf -y module disable avocado && dnf -y install 'dnf-command(copr)' && dnf -y copr enable @avocado/avocado-latest && dnf -y install ${RPM_NVR}" | ||
$PODMAN run --rm -ti $PODMAN_IMAGE /bin/bash -c "dnf -y install ${RPM_NVR}" |