init first version of pbs_special_agent
This commit is contained in:
@@ -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"]
|
||||
Executable
+15
@@ -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
|
||||
@@ -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}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
urllib3<2
|
||||
flake8
|
||||
pytest
|
||||
pytest-cov
|
||||
requests-mock
|
||||
black
|
||||
Executable
+9
@@ -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
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
find $OMD_ROOT/tmp/ -name "*.pid" -exec rm {} \;
|
||||
@@ -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
|
||||
@@ -0,0 +1,4 @@
|
||||
# Add additional sync excludes for this repo
|
||||
#exclude .github/do-not-sync
|
||||
#exclude .flake8
|
||||
#exclude .gitignore
|
||||
Executable
+23
@@ -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
|
||||
Reference in New Issue
Block a user