Name | cmk-dev-site JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | Easily Install Checkmk |
upload_time | 2025-07-15 11:31:03 |
maintainer | None |
docs_url | None |
author | None |
requires_python | <4.0,>=3.11 |
license | None |
keywords |
checkmk
cmk
monitoring
site
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Easy Install Checkmk
Script to install CMK
<!-- MarkdownTOC -->
- [General](#general)
- [Preparation](#preparation)
- [Install tooling](#install-tooling)
- [Create venv](#create-venv)
- [Usage](#usage)
- [Install the script](#install-the-script)
- [Install the latest daily version](#install-the-latest-daily-version)
- [Development & Contribution](#development--contribution)
- [Workflow](#workflow)
- [Overview](#overview)
- [How to](#how-to)
<!-- /MarkdownTOC -->
## General
## Preparation
### Install tooling
See also [Wiki - How to install bazelisk][ref-how-to-bazelisk]
```bash
cd git/check_mk
sudo ./buildscripts/infrastructure/build-nodes/scripts/install-development.sh --profile bazel --only
```
### Create venv
Next, install `uv` from the directory of this README via Bazel and generate the `requirements.txt` file.
The file `requirements.txt` shall exist on the initial run, but it may be empty.
```bash
bazel run //:generate_requirements_txt
```
Finally generate the `.venv` with `uv` by using Bazel again
```bash
bazel run //:create_venv
```
Activate and use the created `.venv` with the following standard command
```bash
source .venv/bin/activate
```
## Usage
### Install the script
See [project-cmk-dev-install Slack channel](https://tribe29.slack.com/archives/C08L9S9CUCC)
It is recommended to install this project inside a virtual environment
```bash
pip install .
```
### Install the latest daily version
```bash
cmk-dev-install
```
## Development & Contribution
### Workflow
#### Overview
The changelog is built with the help of [`changelog-generator`][ref-snippets2changelog] based on the snippets stored in `.snippets` which can be generated by `changelog-generator`.
If there is no snippet added with a commit and thereby no new version, no release will be published, neither to [test.pypi.org][ref-test-pypi-cmk-dev-site] nor after the submitted review to [pypi.org][ref-pypi-cmk-dev-site]
The version info file `__version__.py` in the python source code is generated and updated by [`changelog2version`][ref-changelog2version].
Each change pushed to be reviewed in Gerrit is released on [test.pypi.org][ref-test-pypi-cmk-dev-site] with an incremented release candidate number based on the patchset number. Additionally Jenkins will create and push a tag for this change.
As soon as the change is submitted Jenkins will build the changelog based on the latest available snippets, create a tag and publish the package at [pypi.org][ref-pypi-cmk-dev-site]. This enables a version-merge-conflict free workflow. If a bugfix was started before e.g. the breaking change `0.7.12 -> 1.0.0` but merged after the breaking change the new version will automatically become `1.0.1`.
As mentioned at the beginning, if there is no new snippet added to a change, no new tag and no new release will be published after a submit of that change.
#### How to
Create a new changelog snippet. If no new snippet is found on a merged change
no new release will be built and published.
If the change is based on a Jira ticket, use the Jira ticket name as snippet
name otherwise use a unique name.
```sh
uv run \
changelog-generator \
create .snippets/CMK-24265.md
```
After committing the snippet a changelog can be generated locally for testing purposes. For CI usage the `--in-place` flag is recommended to use as it will update the existing changelog with the collected snippets. For local usage remember to reset the changelog file before a second run, as the version would be updated recursively due to the way the changelog generator is working. It extracts the latest version from the changelog file and puts the found snippets on top.
Future changes to the changelog are ignored by
```sh
git update-index --assume-unchanged changelog.md
```
```sh
uv run \
changelog-generator \
changelog changelog.md \
--snippets=.snippets \
--in-place \
--version-reference="https://review.lan.tribe29.com/gitweb?p=cmk-dev-site.git;a=tag;h=refs/tags/"
```
`hatch` requires a variable named `__version__` [containing the version as string](https://hatch.pypa.io/1.9/version/#configuration) but `changelog2version` is joining the `__version_info__` data at least until the used version `0.12.1` which requires the usage of a custom version template.
Update the version of the project in all required files by calling
```sh
uv run \
changelog2version \
--changelog_file changelog.md \
--version_file cmk_dev_site/version.py \
--template_file cmk_dev_site/custom_version_template.py.template \
--additional_version_info="-rc42+$(git rev-parse HEAD)" \
--print \
| jq -r .info.version
```
* modify and check commits via `pre-commit run --all-files`
* after work is done locally:
- update dependencies before/with a new release
```sh
uv lock --check
```
- build and check package locally
```sh
uv build && \
uv run twine check dist/* &&
python3 -m pip uninstall -y cmk-dev-site && \
python3 -m pip install --user dist/cmk_dev_site-$(grep -E "^__version__.?=" cmk_dev_site/version.py | cut -d '"' -f 2 | sed 's/-//g')-py3-none-any.whl
```
- commit, push and review the changes
```sh
git add ...
git commit -m "bump version, update dependencies"
git push origin HEAD:refs/for/main
```
- test deployed packages by the Gerrit CV Jenkins job from `test.pypi.org`. The extra index URL is required to get those dependencies from `pypi.org` which are not available from `test.pypi.org`
```sh
pip install --no-cache-dir \
-i https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
cmk-dev-site==<VERSION_WITH_RC>
```
- finally merge the changes and let Jenkins create the release tag and deployment to [pypi.org][ref-pypi-cmk-dev-site]
<!-- Links -->
[ref-how-to-batelisk]: https://wiki.lan.checkmk.net/display/DEV/How+to+install+bazelisk
[ref-snippets2changelog]: https://github.com/brainelectronics/snippets2changelog
[ref-test-pypi-cmk-dev-site]: https://test-pypi.org/project/checkmk-toolbelt/
[ref-pypi-cmk-dev-site]: https://pypi.org/project/checkmk-toolbelt/
[ref-changelog2version]: https://github.com/brainelectronics/changelog2version
Raw data
{
"_id": null,
"home_page": null,
"name": "cmk-dev-site",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": "checkmk, cmk, monitoring, site",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/8c/9f/58c9b902dfa369f4a406d79cc126ff2d73b7d4fb4681bf989261f17f6976/cmk_dev_site-0.1.0.tar.gz",
"platform": null,
"description": "# Easy Install Checkmk\n\nScript to install CMK\n\n<!-- MarkdownTOC -->\n\n- [General](#general)\n- [Preparation](#preparation)\n - [Install tooling](#install-tooling)\n - [Create venv](#create-venv)\n- [Usage](#usage)\n - [Install the script](#install-the-script)\n - [Install the latest daily version](#install-the-latest-daily-version)\n- [Development & Contribution](#development--contribution)\n - [Workflow](#workflow)\n - [Overview](#overview)\n - [How to](#how-to)\n\n<!-- /MarkdownTOC -->\n\n## General\n\n\n## Preparation\n\n### Install tooling\n\nSee also [Wiki - How to install bazelisk][ref-how-to-bazelisk]\n\n```bash\ncd git/check_mk\nsudo ./buildscripts/infrastructure/build-nodes/scripts/install-development.sh --profile bazel --only\n```\n\n### Create venv\n\nNext, install `uv` from the directory of this README via Bazel and generate the `requirements.txt` file.\nThe file `requirements.txt` shall exist on the initial run, but it may be empty.\n\n```bash\nbazel run //:generate_requirements_txt\n```\n\nFinally generate the `.venv` with `uv` by using Bazel again\n\n```bash\nbazel run //:create_venv\n```\n\nActivate and use the created `.venv` with the following standard command\n\n```bash\nsource .venv/bin/activate\n```\n\n## Usage\n\n### Install the script\n\nSee [project-cmk-dev-install Slack channel](https://tribe29.slack.com/archives/C08L9S9CUCC)\n\nIt is recommended to install this project inside a virtual environment\n\n```bash\npip install .\n```\n\n### Install the latest daily version\n\n```bash\ncmk-dev-install\n```\n\n## Development & Contribution\n\n### Workflow\n\n#### Overview\n\nThe changelog is built with the help of [`changelog-generator`][ref-snippets2changelog] based on the snippets stored in `.snippets` which can be generated by `changelog-generator`.\nIf there is no snippet added with a commit and thereby no new version, no release will be published, neither to [test.pypi.org][ref-test-pypi-cmk-dev-site] nor after the submitted review to [pypi.org][ref-pypi-cmk-dev-site]\n\nThe version info file `__version__.py` in the python source code is generated and updated by [`changelog2version`][ref-changelog2version].\n\nEach change pushed to be reviewed in Gerrit is released on [test.pypi.org][ref-test-pypi-cmk-dev-site] with an incremented release candidate number based on the patchset number. Additionally Jenkins will create and push a tag for this change.\n\nAs soon as the change is submitted Jenkins will build the changelog based on the latest available snippets, create a tag and publish the package at [pypi.org][ref-pypi-cmk-dev-site]. This enables a version-merge-conflict free workflow. If a bugfix was started before e.g. the breaking change `0.7.12 -> 1.0.0` but merged after the breaking change the new version will automatically become `1.0.1`.\n\nAs mentioned at the beginning, if there is no new snippet added to a change, no new tag and no new release will be published after a submit of that change.\n\n#### How to\n\nCreate a new changelog snippet. If no new snippet is found on a merged change\nno new release will be built and published.\n\nIf the change is based on a Jira ticket, use the Jira ticket name as snippet\nname otherwise use a unique name.\n\n```sh\nuv run \\\n changelog-generator \\\n create .snippets/CMK-24265.md\n```\n\nAfter committing the snippet a changelog can be generated locally for testing purposes. For CI usage the `--in-place` flag is recommended to use as it will update the existing changelog with the collected snippets. For local usage remember to reset the changelog file before a second run, as the version would be updated recursively due to the way the changelog generator is working. It extracts the latest version from the changelog file and puts the found snippets on top.\n\nFuture changes to the changelog are ignored by\n\n```sh\ngit update-index --assume-unchanged changelog.md\n```\n\n```sh\nuv run \\\n changelog-generator \\\n changelog changelog.md \\\n --snippets=.snippets \\\n --in-place \\\n --version-reference=\"https://review.lan.tribe29.com/gitweb?p=cmk-dev-site.git;a=tag;h=refs/tags/\"\n```\n\n`hatch` requires a variable named `__version__` [containing the version as string](https://hatch.pypa.io/1.9/version/#configuration) but `changelog2version` is joining the `__version_info__` data at least until the used version `0.12.1` which requires the usage of a custom version template.\n\nUpdate the version of the project in all required files by calling\n\n```sh\nuv run \\\n changelog2version \\\n --changelog_file changelog.md \\\n --version_file cmk_dev_site/version.py \\\n --template_file cmk_dev_site/custom_version_template.py.template \\\n --additional_version_info=\"-rc42+$(git rev-parse HEAD)\" \\\n --print \\\n | jq -r .info.version\n```\n\n* modify and check commits via `pre-commit run --all-files`\n* after work is done locally:\n\n - update dependencies before/with a new release\n```sh\nuv lock --check\n```\n - build and check package locally\n```sh\nuv build && \\\nuv run twine check dist/* &&\npython3 -m pip uninstall -y cmk-dev-site && \\\npython3 -m pip install --user dist/cmk_dev_site-$(grep -E \"^__version__.?=\" cmk_dev_site/version.py | cut -d '\"' -f 2 | sed 's/-//g')-py3-none-any.whl\n```\n - commit, push and review the changes\n```sh\ngit add ...\ngit commit -m \"bump version, update dependencies\"\ngit push origin HEAD:refs/for/main\n```\n - test deployed packages by the Gerrit CV Jenkins job from `test.pypi.org`. The extra index URL is required to get those dependencies from `pypi.org` which are not available from `test.pypi.org`\n```sh\npip install --no-cache-dir \\\n -i https://test.pypi.org/simple/ \\\n --extra-index-url https://pypi.org/simple \\\n cmk-dev-site==<VERSION_WITH_RC>\n```\n - finally merge the changes and let Jenkins create the release tag and deployment to [pypi.org][ref-pypi-cmk-dev-site]\n\n<!-- Links -->\n[ref-how-to-batelisk]: https://wiki.lan.checkmk.net/display/DEV/How+to+install+bazelisk\n[ref-snippets2changelog]: https://github.com/brainelectronics/snippets2changelog\n[ref-test-pypi-cmk-dev-site]: https://test-pypi.org/project/checkmk-toolbelt/\n[ref-pypi-cmk-dev-site]: https://pypi.org/project/checkmk-toolbelt/\n[ref-changelog2version]: https://github.com/brainelectronics/changelog2version\n",
"bugtrack_url": null,
"license": null,
"summary": "Easily Install Checkmk",
"version": "0.1.0",
"project_urls": {
"Changelog": "https://github.com/Checkmk/cmk-dev-site/blob/release/0.1.0/changelog.md",
"Repository": "https://github.com/Checkmk/cmk-dev-site"
},
"split_keywords": [
"checkmk",
" cmk",
" monitoring",
" site"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a0c139378a0e4ec2f7f4c6a8aa40d25b4e057cd58a7ba416ea6c2d2738881a61",
"md5": "df33c2b37b8726f2baa99528195c17ad",
"sha256": "f9aff275a6657acb45aafc9710902d4be5eb9667119a6481ef65f127cf63e96c"
},
"downloads": -1,
"filename": "cmk_dev_site-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "df33c2b37b8726f2baa99528195c17ad",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 38162,
"upload_time": "2025-07-15T11:31:01",
"upload_time_iso_8601": "2025-07-15T11:31:01.969176Z",
"url": "https://files.pythonhosted.org/packages/a0/c1/39378a0e4ec2f7f4c6a8aa40d25b4e057cd58a7ba416ea6c2d2738881a61/cmk_dev_site-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8c9f58c9b902dfa369f4a406d79cc126ff2d73b7d4fb4681bf989261f17f6976",
"md5": "7f31184210a13313514955733265b1c8",
"sha256": "a2d0495ebcf758073178891f51ef2d2b5a4511ec3431ed6a302252383226e0ad"
},
"downloads": -1,
"filename": "cmk_dev_site-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "7f31184210a13313514955733265b1c8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 99547,
"upload_time": "2025-07-15T11:31:03",
"upload_time_iso_8601": "2025-07-15T11:31:03.660282Z",
"url": "https://files.pythonhosted.org/packages/8c/9f/58c9b902dfa369f4a406d79cc126ff2d73b7d4fb4681bf989261f17f6976/cmk_dev_site-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-15 11:31:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Checkmk",
"github_project": "cmk-dev-site",
"github_not_found": true,
"lcname": "cmk-dev-site"
}