Merge pull request #6 from ruzickap/feature/documentation_update+fixes
Documentation and TravisCI fixes
diff --git a/README.rst b/README.rst
index 0b4377d..4942758 100644
--- a/README.rst
+++ b/README.rst
@@ -51,7 +51,20 @@
.. code-block:: bash
- MY_NEW_SALT_FORMULA_DIR="my_new_salt_formula"
+ MY_NEW_SALT_FORMULA_DIR="watchdog"
mkdir $MY_NEW_SALT_FORMULA_DIR
git clone https://github.com/salt-formulas/cookiecutter-salt-formula.git
docker run --rm -it -u $(id -u):$(id -g) --env HOME=/$MY_NEW_SALT_FORMULA_DIR -v $PWD/$MY_NEW_SALT_FORMULA_DIR:/$MY_NEW_SALT_FORMULA_DIR -v $PWD/cookiecutter-salt-formula:/cookiecutter-salt-formula:ro cookiecutter/cookiecutter /cookiecutter-salt-formula --output-dir /$MY_NEW_SALT_FORMULA_DIR
+ service_name [some_service]: watchdog
+ role_name [server]:
+ initial_version [2018.1]:
+ copyright_year [2018]:
+ copyright_holder [Your Name et al.]: Mirantis, Inc.
+ author_name [John Doe]: Petr Ruzicka
+ author_contact [jdoe@domain.com]: pruzicka@mirantis.com
+ homepage [https://github.com/salt-formulas]:
+ debian_version [xenial]:
+ kitchen_driver [docker]:
+ kitchen_verifier [inspec]:
+ kitchen_formula [watchdog]:
+ kitchen_suites []: server
diff --git a/cookiecutter.json b/cookiecutter.json
index ac6cdce..3a6eb08 100644
--- a/cookiecutter.json
+++ b/cookiecutter.json
@@ -8,7 +8,7 @@
"author_contact": "jdoe@domain.com",
"homepage": "https://github.com/salt-formulas",
- "debian_version": "trusty",
+ "debian_version": "xenial",
"kitchen_driver": "docker",
"kitchen_verifier": "inspec",
diff --git "a/\173\173cookiecutter.service_name\175\175/README.rst" "b/\173\173cookiecutter.service_name\175\175/README.rst"
index c37bfbb..6474c57 100644
--- "a/\173\173cookiecutter.service_name\175\175/README.rst"
+++ "b/\173\173cookiecutter.service_name\175\175/README.rst"
@@ -1,6 +1,6 @@
==================================
-{{cookiecutter.service_name}} Formula
+{{cookiecutter.service_name|capfirst}} Formula
==================================
Service {{cookiecutter.service_name}} description
diff --git "a/\173\173cookiecutter.service_name\175\175/tests/pip_requirements.txt" "b/\173\173cookiecutter.service_name\175\175/tests/pip_requirements.txt"
deleted file mode 100644
index 8fad73f..0000000
--- "a/\173\173cookiecutter.service_name\175\175/tests/pip_requirements.txt"
+++ /dev/null
@@ -1 +0,0 @@
-+jsonschema
diff --git "a/\173\173cookiecutter.service_name\175\175/tests/run_tests.sh" "b/\173\173cookiecutter.service_name\175\175/tests/run_tests.sh"
index f5bd64c..cf3dfa7 100755
--- "a/\173\173cookiecutter.service_name\175\175/tests/run_tests.sh"
+++ "b/\173\173cookiecutter.service_name\175\175/tests/run_tests.sh"
@@ -2,7 +2,8 @@
###
# Script requirments:
-# apt-get install -y python-yaml virtualenv git
+#apt-get install -y python-yaml virtualenv git
+
set -e
[ -n "$DEBUG" ] && set -x
@@ -42,6 +43,7 @@
setup_virtualenv() {
log_info "Setting up Python virtualenv"
+ dependency_check virtualenv
virtualenv $VENV_DIR
source ${VENV_DIR}/bin/activate
pip install salt${PIP_SALT_VERSION}
@@ -109,6 +111,7 @@
dep_root="${DEPSDIR}/$(basename $dep_source .git)"
dep_metadata="${dep_root}/metadata.yml"
+ dependency_check git
[ -d $dep_root ] && { log_info "Dependency $dep_name already fetched"; return 0; }
log_info "Fetching dependency $dep_name"
@@ -219,6 +222,14 @@
fi
}
+dependency_check() {
+ local DEPENDENCY_COMMANDS=$*
+
+ for DEPENDENCY_COMMAND in $DEPENDENCY_COMMANDS; do
+ which $DEPENDENCY_COMMAND > /dev/null || ( log_err "Command \"$DEPENDENCY_COMMAND\" can not be found in default path."; exit 1; )
+ done
+}
+
_atexit() {
RETVAL=$?
trap true INT TERM EXIT
diff --git "a/\173\173cookiecutter.service_name\175\175/\173\173cookiecutter.service_name\175\175/schemas/\173\173cookiecutter.role_name\175\175.yaml" "b/\173\173cookiecutter.service_name\175\175/\173\173cookiecutter.service_name\175\175/schemas/\173\173cookiecutter.role_name\175\175.yaml"
new file mode 100644
index 0000000..74b4f84
--- /dev/null
+++ "b/\173\173cookiecutter.service_name\175\175/\173\173cookiecutter.service_name\175\175/schemas/\173\173cookiecutter.role_name\175\175.yaml"
@@ -0,0 +1,17 @@
+%YAML 1.1
+---
+"$schema": "http://json-schema.org/draft-06/schema#"
+title: {{cookiecutter.service_name}} daemon role
+description: |
+ {{cookiecutter.service_name|capfirst}} daemon, server role
+type: object
+additionalProperties: false
+
+required:
+ - enabled
+
+properties:
+ enabled:
+ description: |
+ Enables {{cookiecutter.service_name}} daemon service
+ type: boolean