-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve packaging and distribution (see #1)
- Loading branch information
Showing
17 changed files
with
201 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
- name: Install | ||
run: pip install . | ||
|
||
- name: Show all plugins | ||
run: | | ||
nagios_d3s_check_health || true | ||
echo | ||
nagios_d3s_check_memory || true | ||
echo | ||
nagios_d3s_check_os_updates || true | ||
echo | ||
nagios_d3s_check_systemd_service --service sshd || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Linux packages | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
PACKAGE_NAME: d3s-nagios-plugins-git | ||
PACKAGE_MAINTAINER: vhotspur | ||
PACKAGE_SUMMARY: "Collection of various Nagios plugins" | ||
PACKAGE_VERSION: 1.0.0 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
- name: Prepare install for Debian | ||
run: | | ||
pip install --root ${{github.workspace}}/pkg-deb --prefix /usr . | ||
find ${{github.workspace}}/pkg-deb | ||
- uses: jiro4989/build-deb-action@v3 | ||
with: | ||
package_root: ${{github.workspace}}/pkg-deb | ||
package: ${{ env.PACKAGE_NAME }} | ||
maintainer: ${{ env.PACKAGE_MAINTAINER }} | ||
desc: '${{ env.PACKAGE_SUMMARY }}' | ||
version: '${{ env.PACKAGE_VERSION }}' | ||
arch: 'amd64' | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: deb-package | ||
path: | | ||
./d3s*.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
env: | ||
PACKAGE_NAME: d3s-nagios-plugins | ||
PACKAGE_MAINTAINER: vhotspur | ||
PACKAGE_SUMMARY: "Collection of various Nagios plugins" | ||
PACKAGE_VERSION: 1.0.0 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
- name: Prepare install for Debian | ||
run: | | ||
pip install --root ${{github.workspace}}/pkg-deb --prefix /usr . | ||
find ${{github.workspace}}/pkg-deb | ||
- uses: jiro4989/build-deb-action@v3 | ||
with: | ||
package_root: ${{github.workspace}}/pkg-deb | ||
package: ${{ env.PACKAGE_NAME }} | ||
maintainer: ${{ env.PACKAGE_MAINTAINER }} | ||
desc: '${{ env.PACKAGE_SUMMARY }}' | ||
version: '${{ env.PACKAGE_VERSION }}' | ||
arch: 'amd64' | ||
|
||
- name: Setup release notes | ||
run: ./contrib/get-release-notes.sh ${{ env.PACKAGE_VERSION }} >gh-release-body.txt | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body_path: gh-release-body.txt | ||
files: | | ||
msim*.deb | ||
msim*.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# D3S Nagios Plugins change log | ||
|
||
All notable changes to D3S Nagios Plugins will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## Unreleased | ||
|
||
### Fixed | ||
|
||
### Added | ||
|
||
### Changed | ||
|
||
### Deprecated | ||
|
||
### Removed | ||
|
||
|
||
## v1.0.0 - 2024-03-20 | ||
|
||
### Changed | ||
|
||
* Packaging setup (@vhotspur) | ||
* Move changelog to a more structured format (@vhotspur) | ||
|
||
### Added | ||
|
||
* Automated releases (@vhotspur) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# Get release notes from change log file. | ||
|
||
set -ueo pipefail | ||
|
||
get_changelog_for() { | ||
# Find text between header lines and remove those header lines | ||
sed -n -e "/^## v${1} - 20[0-9][0-9]-[01][0-9]-[0123][0-9]$/,/^## v/{/^## v/d;p}" | ||
} | ||
|
||
strip_empty_lines() { | ||
# https://unix.stackexchange.com/a/552195 | ||
sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' | ||
} | ||
|
||
get_changelog_for "$1" < "CHANGELOG.md" | strip_empty_lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[build-system] | ||
requires = ["setuptools>=42"] | ||
build-backend = "setuptools.build_meta" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[metadata] | ||
name = d3s-nagios-plugins | ||
version = 1.0 | ||
author = Vojtech Horky | ||
author_email = [email protected] | ||
description = Collection of various Nagios plugins | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
url = https://github.com/d-iii-s/d3s-nagios-plugins | ||
keywords = Nagios monitoring | ||
classifiers = | ||
License :: OSI Approved :: Apache 2 License | ||
|
||
[options] | ||
package_dir = | ||
= src | ||
packages = find: | ||
python_requires = >=3.8 | ||
zip_safe = False | ||
|
||
[options.packages.find] | ||
where = src | ||
|
||
[options.entry_points] | ||
console_scripts = | ||
nagios_d3s_check_health = d3s.nagios_plugins.check_health:main | ||
nagios_d3s_check_memory = d3s.nagios_plugins.check_memory:main | ||
nagios_d3s_check_os_updates = d3s.nagios_plugins.check_os_updates:main | ||
nagios_d3s_check_systemd_service = d3s.nagios_plugins.check_systemd_service:main |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.