From 3dd6ec4cbf29a255df1c5954cd8ee99068eb1f5a Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 3 Sep 2024 11:37:51 +0200 Subject: [PATCH 1/2] Revert "drop packit during branding -- we do not have branded rpm spec (yet)" This reverts commit b6bc9d8aed6b8e522f284d9da5ae5caf42845923. --- .packit.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ Makefile | 1 - 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .packit.yaml diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 00000000..47206ca4 --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,41 @@ +# See the documentation for more information: +# https://packit.dev/docs/configuration/ + +specfile_path: ansible-collection-theforeman-foreman.spec + +# add or remove files that should be synced +files_to_sync: + - ansible-collection-theforeman-foreman.spec + - .packit.yaml + +# name in upstream package repository or registry (e.g. in PyPI) +upstream_package_name: theforeman.foreman +# downstream (Fedora) RPM package name +downstream_package_name: ansible-collection-theforeman-foreman + +upstream_tag_template: v{version} + +actions: + post-upstream-clone: + - "wget https://github.com/theforeman/foreman-packaging/raw/rpm/develop/packages/plugins/ansible-collection-theforeman-foreman/ansible-collection-theforeman-foreman.spec -O ansible-collection-theforeman-foreman.spec" + get-current-version: + - python3 -c 'import yaml; print(yaml.safe_load(open("galaxy.yml"))["version"].replace("-dev", ""))' + create-archive: + - make dist PYTHON_COMMAND=python3 + - bash -c "ls -1t ./theforeman-foreman-*.tar.gz | head -n 1" + +jobs: + - job: copr_build + trigger: pull_request + targets: + - rhel-8 + - rhel-9 + module_hotfixes: true + +srpm_build_deps: + - wget + - python3 + - python3-py + - python3-pyyaml + - make + - ansible-core diff --git a/Makefile b/Makefile index fa264bcd..f920dc72 100644 --- a/Makefile +++ b/Makefile @@ -162,7 +162,6 @@ branding: rm -rf tests/test_playbooks/snapshot* tests/test_playbooks/tasks/snapshot* tests/test_playbooks/fixtures/snapshot* plugins/modules/snapshot*.py tests/fixtures/apidoc/snapshot*.json rm -rf tests/test_playbooks/*_deb.yml rm -rf tests/test_playbooks/*_ostree.yml - rm -rf .packit.yaml make $(RUNTIME_YML) FORCE: From 827d31a218aa2d44c55038f47eec20132024040d Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 3 Sep 2024 11:41:03 +0200 Subject: [PATCH 2/2] correctly brand packit config --- .packit.yaml | 12 ++++++------ Makefile | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index 47206ca4..cbd2341c 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -1,28 +1,28 @@ # See the documentation for more information: # https://packit.dev/docs/configuration/ -specfile_path: ansible-collection-theforeman-foreman.spec +specfile_path: ansible-collection-redhat-satellite.spec # add or remove files that should be synced files_to_sync: - - ansible-collection-theforeman-foreman.spec + - ansible-collection-redhat-satellite.spec - .packit.yaml # name in upstream package repository or registry (e.g. in PyPI) -upstream_package_name: theforeman.foreman +upstream_package_name: redhat.satellite # downstream (Fedora) RPM package name -downstream_package_name: ansible-collection-theforeman-foreman +downstream_package_name: ansible-collection-redhat-satellite upstream_tag_template: v{version} actions: post-upstream-clone: - - "wget https://github.com/theforeman/foreman-packaging/raw/rpm/develop/packages/plugins/ansible-collection-theforeman-foreman/ansible-collection-theforeman-foreman.spec -O ansible-collection-theforeman-foreman.spec" + - "wget https://github.com/theforeman/foreman-packaging/raw/rpm/develop/packages/satellite/ansible-collection-redhat-satellite/ansible-collection-redhat-satellite.spec -O ansible-collection-redhat-satellite.spec" get-current-version: - python3 -c 'import yaml; print(yaml.safe_load(open("galaxy.yml"))["version"].replace("-dev", ""))' create-archive: - make dist PYTHON_COMMAND=python3 - - bash -c "ls -1t ./theforeman-foreman-*.tar.gz | head -n 1" + - bash -c "ls -1t ./redhat-satellite-*.tar.gz | head -n 1" jobs: - job: copr_build diff --git a/Makefile b/Makefile index f920dc72..bfa5ea7a 100644 --- a/Makefile +++ b/Makefile @@ -145,10 +145,10 @@ $(RUNTIME_YML): FORCE $(PYTHON_COMMAND) generate_action_groups.py branding: - sed -i 's/theforeman\.foreman/redhat.satellite/g' plugins/*/*.py tests/inventory/*.foreman.yml tests/test_callback.py tests/test_module_state.py tests/test_playbooks/*.yml changelogs/config.yaml changelogs/changelog.yaml CHANGELOG.rst roles/*/README.md roles/*/*/*.yml docs/cvmanager.md tests/test_playbooks/fixtures/*.yml $(RUNTIME_YML) .ansible-lint + sed -i 's/theforeman\.foreman/redhat.satellite/g' plugins/*/*.py tests/inventory/*.foreman.yml tests/test_callback.py tests/test_module_state.py tests/test_playbooks/*.yml changelogs/config.yaml changelogs/changelog.yaml CHANGELOG.rst roles/*/README.md roles/*/*/*.yml docs/cvmanager.md tests/test_playbooks/fixtures/*.yml $(RUNTIME_YML) .ansible-lint .packit.yaml sed -i 's/foreman.example.com/satellite.example.com/g' plugins/*/*.py docs/cvmanager.md roles/*/README.md roles/*/*/*.yml sed -i 's#theforeman/foreman-ansible-modules#RedHatSatellite/satellite-ansible-collection#g' .github/workflows/*.yml - sed -i 's/theforeman-foreman/redhat-satellite/g' .github/workflows/*.yml + sed -i 's/theforeman-foreman/redhat-satellite/g' .github/workflows/*.yml .packit.yaml sed -i 's/Foreman Ansible Modules/Red Hat Satellite Ansible Collection/g' docs/index.rst docs/conf.py docs/cvmanager.md docs/_gh_include/*.inc sed -i 's/The Foreman Project/Red Hat, Inc./g' docs/conf.py sed -i '/FOREMAN_\w/ s/FOREMAN_/SATELLITE_/g' plugins/doc_fragments/foreman.py plugins/module_utils/foreman_helper.py Makefile @@ -158,6 +158,7 @@ branding: sed -i 's/foreman:/satellite:/' $(RUNTIME_YML) sed -i 's/foreman/satellite/' generate_action_groups.py .ansible-lint sed -i '/group/ s/foreman/satellite/' tests/test_playbooks/module_defaults.yml + sed -i 's#packages/plugins#packages/satellite#' .packit.yaml rm -rf tests/test_playbooks/scc_* tests/test_playbooks/tasks/scc_* tests/test_playbooks/fixtures/scc_* plugins/modules/scc_*.py tests/fixtures/apidoc/scc_*.json rm -rf tests/test_playbooks/snapshot* tests/test_playbooks/tasks/snapshot* tests/test_playbooks/fixtures/snapshot* plugins/modules/snapshot*.py tests/fixtures/apidoc/snapshot*.json rm -rf tests/test_playbooks/*_deb.yml