Skip to content

Commit

Permalink
Merge pull request #62 from opensciencegrid/SOFTARE-5774-mktarball-no…
Browse files Browse the repository at this point in the history
…-osgver

SOFTWARE-5774: extract osgver from version
  • Loading branch information
matyasselmeci authored Dec 20, 2023
2 parents 80cdb20 + cf9eee4 commit 1583db1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tarball-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
OS_TYPE: ["centos"]
OS_VERSION: [7, 8]
OSG_VERSION: [3.6]
OS_TYPE: ["almalinux"]
OS_VERSION: [8, 9]
OSG_VERSION: [3.6.123456, 23.123456]
env:
OS_TYPE: ${{ matrix.OS_TYPE }}
OS_VERSION: ${{ matrix.OS_VERSION }}
Expand Down
16 changes: 10 additions & 6 deletions make_client_tarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import shutil
import tempfile
import subprocess
import re
try:
import ConfigParser
except ImportError:
Expand Down Expand Up @@ -101,11 +102,10 @@ def make_tarball(bundlecfg, bundle, basearch, dver, packages, patch_dirs, prog_d

def parse_cmdline_args(argv):
parser = OptionParser("""
%prog [options] --osgver=<osgver> --dver=<dver> [--basearch=<basearch>]
or: %prog [options] --osgver=<osgver> --all
%prog [options] --version=<version> --dver=<dver> [--basearch=<basearch>]
or: %prog [options] --version=<version> --all
""")
parser.add_option("-o", "--osgver", help="OSG Major Version (e.g 3.4). Either this or --bundle must be specified.")
parser.add_option("--version", default=None, help="Version of the tarball; will be taken from the versionrpm of the bundle, e.g. osg-version, if not specified")
parser.add_option("-v", "--version", default=None, help="Version of the tarball; will be taken from the versionrpm of the bundle, e.g. osg-version, if not specified")
parser.add_option("-r", "--relnum", default="1", help="Release number. Default is %default.")
parser.add_option("--prerelease", default=True, action="store_true", help="Take packages from the prerelease repository (the default)")
parser.add_option("--no-prerelease", "--noprerelease", dest="prerelease", action="store_false", help="Do not take packages from the prerelease repository")
Expand All @@ -125,8 +125,12 @@ def parse_cmdline_args(argv):
if not options.all and not options.dver:
parser.error("Either --all or --dver must be specified.")

if not options.bundles and not options.osgver:
parser.error("--osgver or --bundle must be specified")
if not options.bundles and not options.version:
parser.error("--version or --bundle must be specified")

if options.version:
match = re.search(r'^[0-9.]+\.', options.version)
options.osgver = match.group()[0:-1]

if options.prerelease:
options.extra_repos = options.extra_repos or []
Expand Down
4 changes: 2 additions & 2 deletions tests/setup_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
pkg_name=tarball-client
image=
case "${OS_TYPE}${OS_VERSION}" in
centos7) image=centos:centos7 ;;
centos8) image=quay.io/centos/centos:stream8 ;;
almalinux8) image=almalinux:8 ;;
almalinux9) image=almalinux:9 ;;
*) echo >&2 "${OS_TYPE}${OS_VERSION} not supported"; exit 1 ;;
esac

Expand Down
7 changes: 2 additions & 5 deletions tests/test_inside_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ rpm -U https://dl.fedoraproject.org/pub/epel/epel-release-latest-${OS_VERSION}.n
# Broken mirror?
echo "exclude=mirror.beyondhosting.net" >> /etc/yum/pluginconf.d/fastestmirror.conf

yum -y install /bin/mount patch python2 yum-utils
yum -y install /bin/mount patch python3 yum-utils
if [[ $OS_VERSION -lt 8 ]]; then
yum -y install yum-plugin-priorities
fi

pushd tarball-client
args=(--osgver ${OSG_VERSION} --dver el${OS_VERSION} --basearch x86_64 --bundle osg-wn-client-${OSG_VERSION})
if [[ $OSG_VERSION == 3.5 ]]; then
args+=(--version=3.5.99)
fi
args=(--version ${OSG_VERSION} --dver el${OS_VERSION} --basearch x86_64)
./make-client-tarball "${args[@]}"
popd

0 comments on commit 1583db1

Please sign in to comment.