-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
809 additions
and
432 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
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,19 @@ | ||
ARG VARIANT | ||
FROM checkmk/check-mk-enterprise:$VARIANT | ||
|
||
# install python3 on the container | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install wget build-essential libreadline-gplv2-dev libncursesw5-dev \ | ||
libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev \ | ||
&& cd /tmp && wget https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tgz \ | ||
&& tar xzf Python-3.9.4.tgz \ | ||
&& cd Python-3.9.4 \ | ||
&& ./configure \ | ||
&& make build_all \ | ||
&& make install | ||
|
||
# install python modules to run the Robotmk plugin in this container | ||
RUN pip3 install robotframework pyyaml mergedeep python-dateutil ipdb | ||
|
||
RUN export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends jq tree htop vim git telnet file lsyncd |
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,2 @@ | ||
CMKVERSIONS="1.6.0p25 | ||
2.0.0p5" |
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,54 @@ | ||
#!/bin/bash | ||
# This script should be executed at the very beginning to craft Docker images based on | ||
# the original Checkmk 1/2 Docker images which also contain Python 3.9 and Robotframework. | ||
# | ||
# 1) Edit build-devcontainer.env and change the variable CMKVERSIONS to your needs. | ||
# It should only contain CMK versions you want to test/develop on. | ||
# 2) Start build-devcontainer.sh. It will check if the CMK Docker images are already | ||
# available locally. If not, it asks for credentials to download the | ||
# image from the CMK download page. | ||
# 3) After the image tgz has been downloaded, it will be imported into Docker. | ||
# (approx. 5 minutes) | ||
# 4) In the last step, the script will build an image based on the CMK version, including | ||
# Python3 and robotframework. (approx. 10 minutes) | ||
# $ docker images | grep mk | ||
# robotmk-cmk-python3 2.0.0p5 1d96bebf47a6 27 seconds ago 2.18GB | ||
# robotmk-cmk-python3 1.6.0p25 599e8beeb9c7 10 minutes ago 1.93GB | ||
|
||
|
||
# Name of the resulting images | ||
IMAGE=robotmk-cmk-python3 | ||
# load Checkmk versions | ||
. build-devcontainer.env | ||
|
||
for VERSION in $CMKVERSIONS; do | ||
docker images | egrep "checkmk/check-mk-enterprise.*$VERSION" 2>&1 > /dev/null | ||
if [ $? -gt 0 ]; then | ||
echo "Docker image checkmk/check-mk-enterprise.*$VERSION is not available locally." | ||
read -p "Download this image? " -n 1 -r | ||
echo | ||
if [[ $REPLY =~ ^[Yy]$ ]]; then | ||
|
||
read -p "Username: " user | ||
DOWNLOAD_FOLDER=$(mktemp -d) | ||
URL=https://download.checkmk.com/checkmk/$VERSION | ||
TGZ=check-mk-enterprise-docker-$VERSION.tar.gz | ||
TGZ_FILE=${DOWNLOAD_FOLDER}/${TGZ} | ||
echo "+ Downloading docker image $VERSION to $DOWNLOAD_FOLDER ..." | ||
wget -P $DOWNLOAD_FOLDER --user $user ${URL}/${TGZ} --ask-password | ||
if [ -f $TGZ_FILE ]; then | ||
echo "+ Importing image $TGZ_FILE ..." | ||
docker load -i $TGZ_FILE | ||
else | ||
echo "ERROR: $TGZ_FILE not found!" | ||
fi | ||
else | ||
continue | ||
fi | ||
fi | ||
echo "----" | ||
echo "Docker image checkmk/check-mk-enterprise.*$VERSION is ready to use" | ||
echo "----" | ||
echo "Building now the image robotmk-cmk-python3:$VERSION from Dockerfile_cmk_python ..." | ||
docker build -t robotmk-cmk-python3:$VERSION -f Dockerfile_cmk_python --build-arg VARIANT=$VERSION . | ||
done |
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
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
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
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
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# This step ties the workspace files with the Devcontainer. | ||
# V1 sites use lsyncd instead of symlinks because the bakery/rpmbuild needs real files instead of links. | ||
.devcontainer/linkfiles.sh | ||
# This step ties the workspace files with the Devcontainer. lsyncd is used to synchronize files. | ||
/workspaces/robotmk/.devcontainer/linkfiles.sh | ||
|
||
# Password for the automation user | ||
echo "secret" > /opt/omd/sites/cmk/var/check_mk/web/automation/automation.secret | ||
|
||
# Fire up the site | ||
omd start |
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 |
---|---|---|
|
@@ -24,4 +24,4 @@ dist/* | |
mkpackage.pyc | ||
*.mkp | ||
*.swp | ||
nohup.out | ||
nohup.out |
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
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
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
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"displayName": "▶︎ Set devcontainer to CMK v2", | ||
"command": "cp .devcontainer/devcontainer{_v2,}.json", | ||
"displayName": "▶︎ Create dummyhost", | ||
"command": "bash /workspaces/robotmk/.devcontainer/create_dummyhost.sh", | ||
"version": "2.0.0", | ||
"type": "shell", | ||
"problemMatcher": [], | ||
"chooserIndex": 2 | ||
"chooserIndex": 3 | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/usr/bin/env python3 | ||
# (c) 2020 Simon Meggle <[email protected]> | ||
# (c) 2021 Simon Meggle <[email protected]> | ||
|
||
# This file is part of Robotmk, a module for the integration of Robot | ||
# framework test results into Checkmk. | ||
|
@@ -20,7 +20,7 @@ | |
|
||
try: | ||
# Import the main Robotmk functions from the same directory (Windows) | ||
from robotmk import robotmk, RMKPlugin, RMKrunner, test_for_modules | ||
from robotmk import * | ||
except ImportError: | ||
# If the import fails, try to import robotmk form the parent directory (Linux) | ||
# This is the case when the runner gets scheduled asynchronously on Linux where | ||
|
@@ -35,7 +35,7 @@ def main(): | |
RMKPlugin.get_args() | ||
rmk = RMKrunner() | ||
cmdline_suites='all' # TBD: start suites from cmdline | ||
rmk.start_suites(cmdline_suites) | ||
rmk.run_suites(cmdline_suites) | ||
rmk.loginfo("... Quitting Runner, bye. ---") | ||
# It is important to write at least one byte to the agent so that it can save this | ||
# as a state with a cache_time. | ||
|
Oops, something went wrong.