Blame scripts/bootstrap8.sh

Thomas Oulevey 98f397
KOJI="/usr/bin/koji"
Thomas Oulevey 98f397
URLS=http://composes.rdu2.centos.org/CentOS-Stream-20191210.n.0/compose/
Thomas Oulevey 98f397
URLX=http://composes.rdu2.centos.org/CentOS-Stream-20191210.n.0/compose/
Thomas Oulevey 98f397
BUILDROOT_DEFAULT="curl bash bzip2 coreutils cpio diffutils redhat-release findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux-ng which buildsys-tools tar"
Thomas Oulevey 98f397
Thomas Oulevey 98f397
create_tag () {
Thomas Oulevey 98f397
	local name="$1"
Thomas Oulevey 98f397
	local arches="$2"
Thomas Oulevey 98f397
	local disttag="$3"
Thomas Oulevey 98f397
	local dist="$4" # s or x
Thomas Oulevey 98f397
	$KOJI remove-tag ${name}-build
Thomas Oulevey 98f397
	$KOJI add-tag --arches "${arches}" ${name}-build
Thomas Oulevey 98f397
	$KOJI add-external-repo --tag=${name}-build centos8${dist}-cr --mode bare
Thomas Oulevey 98f397
	$KOJI add-external-repo --tag=${name}-build centos8${dist}-powertools --mode bare 
Thomas Oulevey 98f397
	$KOJI add-external-repo --tag=${name}-build centos8${dist}-appstream --mode bare
Thomas Oulevey 98f397
	$KOJI add-external-repo --tag=${name}-build centos8${dist}-baseos  --mode bare
Thomas Oulevey 98f397
	$KOJI add-tag --arches "${arches}" ${name}-candidate 2> /dev/null # never delete destination tags with content 
Thomas Oulevey 98f397
	$KOJI add-tag --arches "${arches}" ${name}-testing 2> /dev/null # never delete destination tags with content
Thomas Oulevey 98f397
	$KOJI add-tag --arches "${arches}" ${name}-release  2> /dev/null # never delete destination tags with content
Thomas Oulevey 98f397
	$KOJI add-group ${name}-build build
Thomas Oulevey 98f397
	$KOJI add-group ${name}-build srpm-build
Thomas Oulevey 98f397
	$KOJI add-group-pkg ${name}-build build $BUILDROOT_DEFAULT
Thomas Oulevey 98f397
	$KOJI add-group-pkg ${name}-build srpm-build $BUILDROOT_DEFAULT
Thomas Oulevey 98f397
	$KOJI add-target ${name} ${name}-build ${name}-candidate
Thomas Oulevey 98f397
	$KOJI edit-tag ${name}-build --extra="mock.package_manager=dnf"
Thomas Oulevey 98f397
	$KOJI edit-tag ${name}-build --extra="mock.new_chroot=1"
Thomas Oulevey 98f397
	$KOJI regen-repo --nowait ${name}-build
Thomas Oulevey 98f397
}
Thomas Oulevey 98f397
Thomas Oulevey 98f397
add_or_update_repo () {
Thomas Oulevey 98f397
	local name="$1"
Thomas Oulevey 98f397
	local url="$2"
Thomas Oulevey 98f397
	$KOJI edit-external-repo $name --name $name 2>/dev/null
Thomas Oulevey 98f397
	if [ $? -gt 0 ]
Thomas Oulevey 98f397
	then
Thomas Oulevey 98f397
		$KOJI add-external-repo "$name" "$url"
Thomas Oulevey 98f397
	else
Thomas Oulevey 98f397
		$KOJI edit-external-repo $name --url="$url"
Thomas Oulevey 98f397
	fi
Thomas Oulevey 98f397
}
Thomas Oulevey 98f397
Thomas Oulevey 98f397
add_or_update_repo "centos8s-appstream" "$URLS/AppStream/\$arch/os/"
Thomas Oulevey 98f397
add_or_update_repo "centos8s-baseos" "$URLS/BaseOS/\$arch/os/"
Thomas Oulevey 98f397
add_or_update_repo "centos8s-powertools" "$URLS/PowerTools/\$arch/os/"
Thomas Oulevey 98f397
add_or_update_repo "centos8s-cr" "$URLS/CR/\$arch/os/"
Thomas Oulevey 98f397
Thomas Oulevey 98f397
add_or_update_repo "centos8x-appstream" "$URLX/AppStream/\$arch/os/"
Thomas Oulevey 98f397
add_or_update_repo "centos8x-baseos" "$URLX/BaseOS/\$arch/os/"
Thomas Oulevey 98f397
add_or_update_repo "centos8x-powertools" "$URLX/PowerTools/\$arch/os/"
Thomas Oulevey 98f397
add_or_update_repo "centos8x-cr" "$URLX/CR/\$arch/os/"
Thomas Oulevey 98f397
Thomas Oulevey 98f397
#create_tag "buildsys8" "x86_64 aarch64 ppcle64" "el8" "s"
Thomas Oulevey 98f397
create_tag "buildsys8" "x86_64 aarch64 ppc64le" "el8" "x"
Thomas Oulevey 98f397
create_tag "test8" "x86_64" "el8" "x"