Checkmk DevOps tools
Project description
Checkmk Dev Tools
This repository includes scripts/tools for Checkmk developers.
Installation
[<PYTHON> -m] pip[3] install [--upgrade] checkmk-dev-tools
ci-artifacts
ci-rtifacts
is a tool which makes artifacts of CI jobs (currently only Jenkins)
locally available based on certain constraints like job parameters and time constraints.
Usage
Run ci-artifacts --help
in general. Here come a few more detailed examples,
which might be outdated.
Assuming credentials are configured and you don't have any more constraints than
a build has been completed successfully, fetch
downloads a given jobs artifacts
to a folder called out
:
ci-artifacts fetch checkmk/master/winagt-build
In contrast, this is what a more detailed call might look like
ci-artifacts --log-level debug \
--credentials url_env=JENKINS_URL,username_env=JENKINS_USERNAME,password_env=JENKINS_PASSWORD \
fetch checkmk/master/winagt-build \
--params EDITION=raw,DISTRO="ubuntu-22.04" \
--params-no-check DISABLE_CACHE=false \
--dependency-paths agents/wnx,agents/windows,packages/cmk-agent-ctl \
--time-constraints today \
--base-dir ~/my-git-projects/checkmk/master \
--out-dir package_download
--credentials <CREDENTIALS>
Provide URL, username and password to your Jenkins instance.
--params <JOB-PARAMETERS>
Comma separated list of job-parameters used for identifying existing builds and to start new ones.
--params-no-check <JOB-PARAMETERS>
Comma separated list of job-parameters used only to start new ones.
--time-constraints <SPECIFIER>
Check for build date constraints when looking for existing builds - currently
only today
is taken into account.
--dependency-paths <PATH,..>
Comma separated list of relative paths to files and directories checked for differences when looking for existing builds
--base-dir <PATH>
Path taken as repository base dir to prefix paths provided with --dependency-paths
as well as base dir for --out-dir
.
--out-dir <PATH>
Artifact download destination directory.
--omit-new-build
Don't start new builds, even when no matching build could be found.
--force-new-build
Don't look for existing builds, always start a new build instead.
--log-level
Provide a Python logging
level name, e.g. DEBUG
(case-insensitive)
Development & Contribution
Setup
For active development you need to have poetry
and pre-commit
installed
python3 -m pip install --upgrade --user poetry pre-commit
git clone ssh://review.lan.tribe29.com:29418/checkmk_dev_tools
cd checkmk_dev_tools
pre-commit install
# if you need a specific version of Python inside your dev environment
poetry env use ~/.pyenv/versions/3.10.4/bin/python3
poetry install
Workflow
- (once and only for publishing to PyPi) Get token on PyPi.org
- (once and only for publishing to PyPi)
poetry config pypi-token.pypi pypi-<LONG-STRING>
(will write to~/.config/pypoetry/auth.toml
) - modify and check commits via
pre-commit
- after work is done locally:
- adapt version in
pyproject.toml
- build and check a package
- adapt version in
poetry build && \
twine check dist/* &&
python3 -m pip uninstall -y checkmk_dev_tools && \
python3 -m pip install --user dist/checkmk_dev_tools-$(grep -E "^version.?=" pyproject.toml | cut -d '"' -f 2)-py3-none-any.whl
- check installed package
- go through review process
- publish the new package
poetry publish --build
- commit new version && push
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for checkmk_dev_tools-0.1.23-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8e52a5e3a713908d0a8e2825cf6e3da68bdfcc6180a3d875ae244781f337135 |
|
MD5 | e64be84ecf3aa367c7849f01724e27fb |
|
BLAKE2b-256 | 08ed423502d35ef65fd95b0f60ecfb8d093c26353b02f536cd78f7f67fb5c263 |