init first version of pbs_special_agent
build / Build Checkmk package (push) Failing after 36s
build-release / Build Release Package (push) Failing after 35s
Lint / flake8_py3 (push) Failing after 18s
pytest / pytest (push) Failing after 32s

This commit is contained in:
Simon Zeyer
2026-03-10 19:28:57 +00:00
commit 19cf015e95
29 changed files with 1229 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
ARG VARIANT
FROM checkmk/check-mk-cloud:${VARIANT}
RUN /docker-entrypoint.sh /bin/true
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends nodejs gcc
ADD requirements.txt /tmp/requirements.txt
USER cmk
RUN PATH="/omd/sites/cmk/bin:${PATH}" \
OMD_ROOT="/omd/sites/cmk" \
/omd/sites/cmk/bin/pip3 install -r /tmp/requirements.txt
ENTRYPOINT ["/bin/bash"]
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
NAME=$(python -c 'print(eval(open("package").read())["name"])')
rm /omd/sites/cmk/var/check_mk/packages/* ||:
ln -s $WORKSPACE/package /omd/sites/cmk/var/check_mk/packages/$NAME
mkp -v pack $NAME
# Set Outputs for GitHub Workflow steps
if [ -n "$GITHUB_WORKSPACE" ]; then
echo "::set-output name=pkgfile::$(ls *.mkp)"
echo "::set-output name=pkgname::${NAME}"
VERSION=$(python -c 'print(eval(open("package").read())["version"])')
echo "::set-output name=pkgversion::$VERSION"
fi
+55
View File
@@ -0,0 +1,55 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.155.1/containers/ubuntu
{
"name": "Checkmk",
"build": {
"dockerfile": "Dockerfile",
"args": { "VARIANT": "2.3.0p42" }
},
"customizations": {
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.flake8",
"ms-python.isort",
"ms-python.pylint",
"ms-python.black-formatter",
"ms-python.vscode-pylance",
"littlefoxteam.vscode-python-test-adapter",
"rioj7.command-variable"
],
// Bash as default shell.
"settings": {"terminal.integrated.defaultProfile.linux": "bash"},
"python.defaultInterpreterPath": "/omd/sites/cmk/bin/python3"
}
},
// Mount complete volume for site directories
"mounts": [
{ "source": "omd-sites", "target": "/opt/omd/sites", "type": "volume" },
{ "source": "${localWorkspaceFolder}/lib", "target": "/opt/omd/sites/cmk/local/lib/python3/cmk", "type": "bind"},
{ "source": "${localWorkspaceFolder}/plugins", "target": "/opt/omd/sites/cmk/local/lib/python3/cmk_addons/plugins", "type": "bind" },
{ "source": "${localWorkspaceFolder}/plugins_legacy", "target": "/opt/omd/sites/cmk/local/share/check_mk", "type": "bind"},
{ "source": "${localWorkspaceFolder}/packages_local", "target": "/opt/omd/sites/cmk/var/check_mk/packages_local/", "type": "bind"}
],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": ".devcontainer/setpwd.sh",
// Start omd every time the container is started
"postStartCommand": ".devcontainer/startup.sh",
"postAttachCommand": "omd restart && cmk-update-license-usage",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "cmk",
"remoteEnv": {
"PATH": "/omd/sites/cmk/bin:/omd/sites/cmk/local/lib/python3/bin/:${containerEnv:PATH}",
"OMD_ROOT": "/omd/sites/cmk",
"OMD_SITE": "cmk",
"CMK_SITE_ID": "cmk",
"WORKSPACE": "${containerWorkspaceFolder}"
}
}
+6
View File
@@ -0,0 +1,6 @@
urllib3<2
flake8
pytest
pytest-cov
requests-mock
black
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
rm -rfv $OMD_ROOT/local/lib/nagios/plugins
ln -sv $WORKSPACE/nagios_plugins $OMD_ROOT/local/lib/nagios/plugins
rm -rfv $OMD_ROOT/local/tmp
ln -sv $WORKSPACE/temp $OMD_ROOT/local/tmp
source /omd/sites/cmk/.profile && echo 'cmkadmin' | /omd/sites/cmk/bin/cmk-passwd -i cmkadmin
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
find $OMD_ROOT/tmp/ -name "*.pid" -exec rm {} \;
+10
View File
@@ -0,0 +1,10 @@
# DO NOT EDIT - Change template-sync.conf
include .devcontainer/
include .devcontainer/**
exclude .github/template-sync.conf
include .github/
include .github/**
include .vscode/
include .vscode/**
include .flake8
include .gitignore
+4
View File
@@ -0,0 +1,4 @@
# Add additional sync excludes for this repo
#exclude .github/do-not-sync
#exclude .flake8
#exclude .gitignore
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/bash
TEMPDIR=$(mktemp --directory)
cleanup() {
echo "Removing $TEMPDIR"
rm -rf $TEMPDIR
}
trap cleanup EXIT
git -C $TEMPDIR clone https://github.com/Yogibaer75/checkmk_template.git
CMD="rsync --archive --cvs-exclude --no-owner --no-group --no-times --verbose"
if [ -e ".devcontainer/template-sync.conf" ]; then
CMD="${CMD} --filter='merge .devcontainer/template-sync.conf'"
fi
if [ -e "${TEMPDIR}/checkmk_template/.devcontainer/template-sync-includes.conf" ]; then
CMD="${CMD} --filter='merge ${TEMPDIR}/checkmk_template/.devcontainer/template-sync-includes.conf'"
fi
CMD="${CMD} --filter='exclude *' ${TEMPDIR}/checkmk_template/ $(pwd)/"
bash -c "$CMD"
echo $CMD