Skip to content

Commit

Permalink
jsonify (#259)
Browse files Browse the repository at this point in the history
* New json template

* New JSON formatter

* New JSON formatter

* Use dict instead of list for other_info

* Fix syntax

* linter fixes

* Fix tests

* Fix variables

* Try to force older pytest versions

See pytest-dev/pytest#12275

* CentOS 7 is long gone

* Fix the formatter
  • Loading branch information
enolfc authored May 21, 2024
1 parent df00390 commit 43cefc2
Show file tree
Hide file tree
Showing 12 changed files with 683 additions and 258 deletions.
73 changes: 0 additions & 73 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,49 +31,6 @@ jobs:
name: sdist
path: dist/*tar.gz

centos7:
name: build centos 7 rpms
needs: sdist
runs-on: ubuntu-latest
container: centos:7
steps:
- uses: actions/download-artifact@v3
with:
name: sdist
- name: install build requisites
run: |
yum install -y rpm-build rpmlint
yum install -y centos-release-openstack-queens
yum install -y python-pbr python-setuptools
- name: build rpm
run: |
tar -xzf cloud_info_provider-${{ needs.sdist.outputs.version }}.tar.gz \
--strip-components 1 \
cloud_info_provider-${{ needs.sdist.outputs.version }}/rpm
sed -i "s/^\(Version.\).*/\\1 ${{ needs.sdist.outputs.version }}/" \
rpm/cloud-info-provider.spec
sed -i "s/^\(Version.\).*/\\1 ${{ needs.sdist.outputs.version }}/" \
rpm/cloud-info-provider-opennebula.spec
sed -i "s/^\(Version.\).*/\\1 ${{ needs.sdist.outputs.version }}/" \
rpm/cloud-info-provider-openstack.spec
mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
cp -v cloud_info_provider-${{ needs.sdist.outputs.version }}.tar.gz \
SOURCES
for rpm in rpm/cloud-info-provider.spec \
rpm/cloud-info-provider-openstack.spec \
rpm/cloud-info-provider-opennebula.spec; do
rpmbuild --define "_topdir $PWD" -ba "$rpm"
done
rpmlint RPMS/noarch/*.rpm
- name: Upload rpms
uses: actions/upload-artifact@v3
with:
name: rpms
path: |
RPMS/noarch/cloud-info-provider-${{ needs.sdist.outputs.version }}-1.el7.noarch.rpm
RPMS/noarch/cloud-info-provider-opennebula-${{ needs.sdist.outputs.version }}-1.el7.noarch.rpm
RPMS/noarch/cloud-info-provider-openstack-${{ needs.sdist.outputs.version }}-1.el7.noarch.rpm
ubuntu:
name: build debs
needs: sdist
Expand Down Expand Up @@ -115,36 +72,6 @@ jobs:
python-cloud-info-provider-opennebula_${{ needs.sdist.outputs.version }}-1_all.deb
python-cloud-info-provider-openstack_${{ needs.sdist.outputs.version }}-1_all.deb
centos7-install-openstack:
name: install centos 7 rpms (openstack)
needs: centos7
runs-on: ubuntu-latest
container: centos:7
steps:
- uses: actions/download-artifact@v3
with:
name: rpms
- name: install generated rpms
run: |
yum install -y centos-release-openstack-queens
yum localinstall -y cloud-info-provider-openstack-*.rpm \
cloud-info-provider-[^o]*.rpm
centos7-install-opennebula:
name: install centos 7 rpms (opennebula)
needs: centos7
runs-on: ubuntu-latest
container: centos:7
steps:
- uses: actions/download-artifact@v3
with:
name: rpms
- name: install generated rpms
run: |
yum install -y epel-release
yum localinstall -y cloud-info-provider-opennebula-*.rpm \
cloud-info-provider-[^o]*.rpm
ubuntu-install-openstack:
name: install debs (openstack)
needs: ubuntu
Expand Down
38 changes: 1 addition & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,42 +59,6 @@ jobs:
name: sdist
path: dist/*tar.gz

centos7:
name: build centos 7 rpms
needs: sdist
runs-on: ubuntu-latest
container: centos:7
steps:
- uses: actions/download-artifact@v3
with:
name: sdist
- name: install build requisites
run: |
yum install -y rpm-build rpmlint
yum install -y centos-release-openstack-queens
yum install -y python-pbr python-setuptools
- name: build rpm
run: |
tar -xzf cloud_info_provider-${{ needs.sdist.outputs.version }}.tar.gz \
--strip-components 1 cloud_info_provider-${{ needs.sdist.outputs.version }}/rpm
sed -i "s/^\(Version.\).*/\\1 ${{ needs.sdist.outputs.version }}/" rpm/cloud-info-provider.spec
sed -i "s/^\(Version.\).*/\\1 ${{ needs.sdist.outputs.version }}/" rpm/cloud-info-provider-opennebula.spec
sed -i "s/^\(Version.\).*/\\1 ${{ needs.sdist.outputs.version }}/" rpm/cloud-info-provider-openstack.spec
mkdir -p {BUILD,RPMS,SOURCES,SPECS,SRPMS}
cp -v cloud_info_provider-${{ needs.sdist.outputs.version }}.tar.gz SOURCES
rpmbuild --define "_topdir $PWD" -ba rpm/cloud-info-provider.spec
rpmbuild --define "_topdir $PWD" -ba rpm/cloud-info-provider-openstack.spec
rpmbuild --define "_topdir $PWD" -ba rpm/cloud-info-provider-opennebula.spec
rpmlint RPMS/noarch/*.rpm
- name: Upload rpms
uses: actions/upload-artifact@v3
with:
name: rpms
path: |
RPMS/noarch/cloud-info-provider-${{ needs.sdist.outputs.version }}-1.el7.noarch.rpm
RPMS/noarch/cloud-info-provider-opennebula-${{ needs.sdist.outputs.version }}-1.el7.noarch.rpm
RPMS/noarch/cloud-info-provider-openstack-${{ needs.sdist.outputs.version }}-1.el7.noarch.rpm
ubuntu:
name: build debs
needs: sdist
Expand Down Expand Up @@ -134,7 +98,7 @@ jobs:
python-cloud-info-provider-openstack_${{ needs.sdist.outputs.version }}-1_all.deb
release:
needs: [sdist, ubuntu, centos7, prepare-release]
needs: [sdist, ubuntu, prepare-release]
name: Upload release artefacts
runs-on: ubuntu-latest
steps:
Expand Down
Loading

0 comments on commit 43cefc2

Please sign in to comment.