-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
b9a8be4
commit ef2307a
Showing
23 changed files
with
858 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/Dockerfile | ||
/armhf.Dockerfile |
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,11 +1,17 @@ | ||
FROM alpine:3.8 | ||
|
||
RUN apk --update add python3 py3-tornado py3-argparse bash perl curl wget grep sed docker sudo mysql-client postgresql-client | ||
ADD ./app/ /app | ||
ADD ./entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
RUN apk --update add python3 bash perl curl wget grep sed docker sudo mysql-client postgresql-client make git | ||
ADD . /infracheck | ||
ADD .git /infracheck/ | ||
|
||
# tests | ||
RUN set -x && cd /app && ./test.sh | ||
RUN cd /infracheck \ | ||
&& git remote remove origin || true \ | ||
&& git remote add origin https://github.com/riotkit-org/infracheck.git \ | ||
&& make install \ | ||
&& make unit_test \ | ||
&& set -x && cd /infracheck/app && ./functional-test.sh \ | ||
&& rm -rf /infracheck/.git /infracheck/example /infracheck/tests \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& chmod +x /infracheck/entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
ENTRYPOINT ["/infracheck/entrypoint.sh"] |
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
File renamed without changes.
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,21 +1,26 @@ | ||
FROM balenalib/armv7hf-debian:buster | ||
|
||
ADD ./app/ /app | ||
ADD ./requirements.txt /app/ | ||
ADD ./entrypoint.sh /entrypoint.sh | ||
|
||
RUN [ "cross-build-start" ] | ||
|
||
RUN apt-get update \ | ||
&& apt-get install python3 python3-pip bash perl curl wget grep sed docker.io sudo mariadb-client netcat ca-certificates openssl \ | ||
&& apt-get clean \ | ||
&& pip3 install setuptools wheel --upgrade \ | ||
&& pip3 install -r /app/requirements.txt \ | ||
&& chmod +x /entrypoint.sh | ||
&& apt-get -y install python3 python3-pip bash perl curl wget grep sed docker.io \ | ||
sudo mariadb-client postgresql-client netcat ca-certificates \ | ||
git openssl make python3-setuptools \ | ||
&& apt-get clean | ||
RUN [ "cross-build-end" ] | ||
|
||
# tests | ||
RUN set -x && cd /app && ./test.sh | ||
ADD . /infracheck | ||
ADD .git /infracheck/ | ||
|
||
RUN [ "cross-build-start" ] | ||
RUN cd /infracheck \ | ||
&& git remote remove origin || true \ | ||
&& git remote add origin https://github.com/riotkit-org/infracheck.git \ | ||
&& make install \ | ||
&& make unit_test \ | ||
&& set -x && cd /infracheck/app && ./functional-test.sh \ | ||
&& rm -rf /infracheck/.git /infracheck/example /infracheck/tests \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& chmod +x /infracheck/entrypoint.sh | ||
RUN [ "cross-build-end" ] | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
ENTRYPOINT ["/infracheck/entrypoint.sh"] |
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 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
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 @@ | ||
sphinx-glpi-theme |
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
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,101 @@ | ||
project = 'Infra Check' | ||
copyright = '2019, RiotKit Team' | ||
author = 'Wesolowski' | ||
|
||
version = '' | ||
release = '2' | ||
|
||
extensions = [ | ||
'sphinx.ext.todo', | ||
'sphinx.ext.imgmath', | ||
'sphinx.ext.githubpages', | ||
] | ||
|
||
templates_path = ['_templates'] | ||
source_suffix = '.rst' | ||
master_doc = 'index' | ||
language = None | ||
exclude_patterns = [] | ||
pygments_style = None | ||
|
||
import sphinx_glpi_theme | ||
html_theme = 'glpi' | ||
html_theme_path = sphinx_glpi_theme.get_html_themes_path() | ||
|
||
html_static_path = ['_static'] | ||
htmlhelp_basename = 'InfraCheckdoc' | ||
|
||
|
||
latex_elements = { | ||
# The paper size ('letterpaper' or 'a4paper'). | ||
# | ||
# 'papersize': 'letterpaper', | ||
|
||
# The font size ('10pt', '11pt' or '12pt'). | ||
# | ||
# 'pointsize': '10pt', | ||
|
||
# Additional stuff for the LaTeX preamble. | ||
# | ||
# 'preamble': '', | ||
|
||
# Latex figure (float) alignment | ||
# | ||
# 'figure_align': 'htbp', | ||
} | ||
|
||
# Grouping the document tree into LaTeX files. List of tuples | ||
# (source start file, target name, title, | ||
# author, documentclass [howto, manual, or own class]). | ||
latex_documents = [ | ||
(master_doc, 'InfraCheck.tex', 'Infra Check Documentation', | ||
'Wolnosciowiec Team', 'manual'), | ||
] | ||
|
||
|
||
# -- Options for manual page output ------------------------------------------ | ||
|
||
# One entry per manual page. List of tuples | ||
# (source start file, name, description, authors, manual section). | ||
man_pages = [ | ||
(master_doc, 'infracheck', 'Infra Check Documentation', | ||
[author], 1) | ||
] | ||
|
||
|
||
# -- Options for Texinfo output ---------------------------------------------- | ||
|
||
# Grouping the document tree into Texinfo files. List of tuples | ||
# (source start file, target name, title, author, | ||
# dir menu entry, description, category) | ||
texinfo_documents = [ | ||
(master_doc, 'InfraCheck', 'Infra Check Documentation', | ||
author, 'InfraCheck', 'One line description of project.', | ||
'Miscellaneous'), | ||
] | ||
|
||
|
||
# -- Options for Epub output ------------------------------------------------- | ||
|
||
# Bibliographic Dublin Core info. | ||
epub_title = project | ||
|
||
# The unique identifier of the text. This can be a ISBN number | ||
# or the project homepage. | ||
# | ||
# epub_identifier = '' | ||
|
||
# A unique identification for the text. | ||
# | ||
# epub_uid = '' | ||
|
||
# A list of files that should not be packed into the epub file. | ||
epub_exclude_files = ['search.html'] | ||
|
||
|
||
# -- Extension configuration ------------------------------------------------- | ||
|
||
# -- Options for todo extension ---------------------------------------------- | ||
|
||
# If true, `todo` and `todoList` produce output, else they produce nothing. | ||
todo_include_todos = True |
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,25 @@ | ||
Writing custom checks | ||
===================== | ||
|
||
Infracheck provides very basic scripts for health checking, you may probably want to write your own. | ||
It's really simple. | ||
|
||
1. "check" scripts are in **"checks" directory** of your project structure, here you can add a **new check script** | ||
2. Your script needs to take **uppercase environment variables as input** | ||
3. It is considered a good practice to validate environment variables presence in scripts | ||
4. Your script needs to return a valid exit code when: | ||
- Any of environment variables is missing or has invalid value | ||
- The check fails | ||
- The check success | ||
|
||
That's all! | ||
|
||
A few examples: | ||
|
||
.. literalinclude:: ../../app/checks/dir-present | ||
:language: bash | ||
:linenos: | ||
|
||
.. literalinclude:: ../../app/checks/replication-running | ||
:language: bash | ||
:linenos: |
Oops, something went wrong.