Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
themoriarti committed Mar 29, 2024
2 parents 8ca6443 + 669509a commit 59f8c20
Show file tree
Hide file tree
Showing 21 changed files with 1,433 additions and 763 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
21 changes: 17 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ on:
push:
branches:
- main
- develop
tags:
- v*
pull_request:
branches:
- main
- develop

jobs:
lint:
Expand All @@ -21,18 +19,33 @@ jobs:

steps:
- name: Checkout code
<<<<<<< HEAD
uses: actions/checkout@v3

- name: Install pylint / pyflakes
run: |
sudo apt-get update
sudo apt-get install --yes pylint pyflakes3
=======
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: pip install -r requirements.txt

- name: Install test dependencies
run: pip install -r requirements-test.txt
>>>>>>> upstream/main

- name: Install pve_exporter
run: sudo pip install -e .
run: pip install .

- name: Run pylint
run: pylint pve_exporter

- name: Run pyflakes
run: pyflakes3 src/pve_exporter
run: pyflakes src/pve_exporter
27 changes: 21 additions & 6 deletions .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,40 @@ jobs:
contents: read

steps:
<<<<<<< HEAD
- uses: actions/checkout@v3
=======
- name: Checkout repository
uses: actions/checkout@v4
>>>>>>> upstream/main

- uses: docker/metadata-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
uses: docker/metadata-action@v5
id: meta
with:
images: prompve/prometheus-pve-exporter
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}.{{minor}}
type=pep440,pattern={{major}}
- uses: docker/login-action@v1
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- uses: docker/build-push-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/arm64,linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
54 changes: 54 additions & 0 deletions .github/workflows/container-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Build and test container image

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- 'Dockerfile'
- 'requirements.txt'
- 'setup.py'

jobs:
test:
strategy:
matrix:
include:
- platform: 'linux/arm64'
tag: prometheus-pve-exporter:develop-arm64
smoketest: false
- platform: 'linux/amd64'
tag: prometheus-pve-exporter:develop-amd64
smoketest: true

runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image (all architectures)
uses: docker/build-push-action@v5
with:
context: .
load: true
platforms: ${{ matrix.platform }}
tags: ${{ matrix.tag }}

- name: Container image smoketest
if: ${{ matrix.smoketest }}
run: docker run --rm ${{ matrix.tag }} --help
47 changes: 39 additions & 8 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,51 @@ on:
types: [created]

jobs:
deploy:
build:
runs-on: ubuntu-latest
steps:
<<<<<<< HEAD
- uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes python3-wheel twine
=======
- name: Checkout code
uses: actions/checkout@v4

- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python3 setup.py sdist bdist_wheel
twine upload dist/*
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: pip install build
>>>>>>> upstream/main

- name: Build
run: python -m build .

- uses: actions/upload-artifact@v4
with:
path: ./dist
name: dist

pypi-publish:
needs: ['build']
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/prometheus-pve-exporter/
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: ./dist
name: dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
141 changes: 140 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,136 @@ The format is based on `Keep a Changelog`_ and this project adheres to
`Unreleased`_
-------------


`3.2.3`_ - 2024-02-25
---------------------

Changed
~~~~~~~

- Bump cryptography from 42.0.2 to 42.0.4 (#232)


`3.2.2`_ - 2024-02-06
---------------------

Changed
~~~~~~~

- Bump cryptography from 41.0.7 to 42.0.0 (#226)
- Bump alpine container image version from 3.19.0 to 3.19.1 (#225)


`3.2.1`_ - 2024-01-07
---------------------

Changed
~~~~~~~

- Build cffi and pyyaml from source (#222)
- Use appropriate build tools to create dist for pypi (#220)


`3.2.0`_ - 2024-01-06
---------------------

Changed
~~~~~~~

- Bump alpine from 3.18.5 to 3.19.0 (#216)
- Update to pylint 3 (#218)
- Use pyproject.toml, pip-compile and venv to build container image (#215)


`3.1.0`_ - 2024-01-03
---------------------

Added
~~~~~

- Adding template label to pve_guest_info metric (#208)

Changed
~~~~~~~

- Simplify container build spec (#210)
- Fix coding style after template label addition (#209)
- Bump actions/download-artifact from 3 to 4 (#205)
- Bump actions/upload-artifact from 3 to 4 (#206)
- Correct cluster and node params (#202)
- Extract cluster and node collectors into separate files (#198)


`3.0.2`_ - 2023-11-05
---------------------

Changed
~~~~~~~

- Specify same arguments for upload-artifact and download-artifact actions
(#196)


`3.0.1`_ - 2023-11-05
---------------------

Changed
~~~~~~~

- Revert to deprecated way of building packages (#193)


`3.0.0`_ - 2023-11-05
---------------------

Changed (BREAKING)
~~~~~~~~~~~~~~~~~~
- Use flags instead of positional arguments for config file and listen address
(#190)
- Scrape /nodes endpoint from current node only (#180)
- Remove tini from docker image (#179)
- Bump required python version to 3.9 (bullseye) (#162)
- Run with a dedicated user in container by default (#182)

Changed
~~~~~~~

- Implement pypi trusted publishing workflow (#187)
- Use PEP440 pattern when converting repo release tags into docker image tags (#183)
- Remove references to develop branch (#181)
- Update docker image to alpine 3.18.4 (#170)
- Bump required python version to 3.9 (in README) (#169)
- Remove fallback for BooleanOptionalAction (obsolete in python>=3.9) (#163)
- Fix github actions (#161)
- Bump actions/checkout from 2 to 4 (#177)
- ci: add dependabot (#176)
- ci: add arm64 image build (#175)


`3.0.0b1`_ - 2023-10-16
-----------------------

Changed (BREAKING)
~~~~~~~~~~~~~~~~~~
- Scrape /nodes endpoint from current node only (#180)
- Remove tini from docker image (#179)
- Bump required python version to 3.9 (bullseye) (#162)
- Run with a dedicated user in container by default (#182)

Changed
~~~~~~~
- Use PEP440 pattern when converting repo release tags into docker image tags (#183)
- Update docker image to alpine 3.18.4 (#170)
- Remove fallback for BooleanOptionalAction (obsolete in python>=3.9) (#163)
- Fix github actions (#161)
- Bump actions/checkout from 2 to 4 (#177)

Added
~~~~~
- ci: add dependabot (#176)
- ci: add arm64 image build (#175)


`2.3.1`_ - 2023-08-02
---------------------

Expand Down Expand Up @@ -240,7 +370,16 @@ Added

.. _Keep a Changelog: http://keepachangelog.com/en/1.0.0/
.. _Semantic Versioning: http://semver.org/spec/v2.0.0.html
.. _Unreleased: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.3.1...HEAD
.. _Unreleased: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v3.2.3...HEAD
.. _3.2.3: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v3.2.3...v3.2.2
.. _3.2.2: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v3.2.2...v3.2.1
.. _3.2.1: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v3.2.1...v3.2.0
.. _3.2.0: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v3.2.0...v3.1.0
.. _3.1.0: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v3.1.0...v3.0.2
.. _3.0.2: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v3.0.2...v3.0.1
.. _3.0.1: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v3.0.1...v3.0.0
.. _3.0.0: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v3.0.0b1...v3.0.0
.. _3.0.0b1: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.3.1...v3.0.0b1
.. _2.3.1: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.3.0...v2.3.1
.. _2.3.0: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.2.4...v2.3.0
.. _2.2.3: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.2.3...v2.2.4
Expand Down
Loading

0 comments on commit 59f8c20

Please sign in to comment.