Update mssql commit, fix replacing fedora.linux_system_roles

- Update mssql commit
  Resolves: rhbz#2066337
- Add condition for upstream spec build for galaxy_transform
- Replace extra-mapping with replacing in the legacy format with sed
This commit is contained in:
Sergei Petrosian 2022-07-07 14:25:08 +02:00
parent 388b3ca77a
commit 18dd927b56
1 changed files with 24 additions and 4 deletions

View File

@ -26,7 +26,7 @@ Name: ansible-collection-microsoft-sql
Url: https://github.com/linux-system-roles/mssql
Summary: The Ansible collection for Microsoft SQL Server management
Version: 1.2.0
Release: 1%{?dist}
Release: 2%{?dist}
#Group: Development/Libraries
License: MIT
@ -111,7 +111,7 @@ BuildRequires: %{ansible_build_dep}
%%global collection_rolenames %%{?collection_rolenames} [%{rolename%{1}}]="%{collection_rolename%{1}}"
}
%defcommit 1 27201be4f2e557a6dcde36463354a1de0cbadb08
%defcommit 1 4eb3dd55defd801a5032efa597983cbbec4bbeea
%global rolename1 mssql
%global target_rolename1 sql-server
%global collection_rolename1 server
@ -198,7 +198,9 @@ mkdir .collections
cp %{rolename1}/.collection/README.md lsr_role2collection/collection_readme.md
# Copy galaxy.yml for the collection build
cp %{rolename1}/.collection/galaxy.yml ./
# Ensure the correct entries in galaxy.yml
%if 0%{?rhel}
./galaxy_transform.py "%{collection_namespace}" "%{collection_name}" "%{collection_version}" \
"Ansible collection for Microsoft SQL Server management" \
"https://github.com/linux-system-roles/mssql" \
@ -206,11 +208,24 @@ cp %{rolename1}/.collection/galaxy.yml ./
"https://github.com/linux-system-roles/mssql/blob/master/README.md" \
"https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%208&component=ansible-collection-microsoft-sql" \
> galaxy.yml.tmp
%else
./galaxy_transform.py "%{collection_namespace}" "%{collection_name}" "%{collection_version}" \
"Ansible collection for Microsoft SQL Server management" \
> galaxy.yml.tmp
%endif
mv galaxy.yml.tmp galaxy.yml
# Declare the array containing collection rolenames to convert roles to
declare -A COLLECTION_ROLENAMES=(%{collection_rolenames})
# Replace fedora.linux_system_roles with redhat.rhel_system_roles
%if 0%{?rhel}
for rolename in %{rolenames}; do
sed -i 's/fedora\.linux_system_roles/redhat.rhel_system_roles/g' \
$rolename/tasks/*.yml $rolename/tests/*.yml $rolename/meta/*.yml
done
%endif
# Convert roles to the collection format
for rolename in %{rolenames}; do
python3 lsr_role2collection.py --role "$rolename" \
@ -220,8 +235,7 @@ for rolename in %{rolenames}; do
--readme lsr_role2collection/collection_readme.md \
--namespace %{collection_namespace} --collection %{collection_name} \
--new-role "${COLLECTION_ROLENAMES[${rolename}]}" \
--meta-runtime lsr_role2collection/runtime.yml \
--extra-mapping "fedora.linux_system_roles:redhat.rhel_system_roles"
--meta-runtime lsr_role2collection/runtime.yml
done
# removing dot files/dirs
@ -419,6 +433,12 @@ fi
%endif
%changelog
* Mon Jul 4 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.2.0-2
- Update mssql commit
Resolves: rhbz#2066337
- Add condition for upstream spec build for galaxy_transform
- Replace extra-mapping with replacing in the legacy format with sed
* Fri Jun 17 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.2.0-1
- Add MVP HA functionality to the server role
Resolves: rhbz#2066337