Skip to content

Commit

Permalink
Add script for generating instance repository (#130)
Browse files Browse the repository at this point in the history
* Add script to generate the testing instance repo

* Add some documentations on testing

* Fix documentation
  • Loading branch information
oncleben31 committed Jan 24, 2021
1 parent cb34c28 commit a8a9452
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
17 changes: 15 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,24 @@ from your development version:
How to test the project
-----------------------

TBD
You can manually test the generated integration with different tools implemented in Github workflows.

At least you should ensure the integration generated is working in Home Assistant
This template repository is linked to a generated `instance repository`_ for testing purpose.
You can generate this instance by using the following command:

.. parsed-literal::
$ ./scripts/gen_instance
You will be able to use the GitHub workflow if you push the generated repository on GitHub.
You can run pre-commit or pytest suite manually
and you can ensure the integration generated is working in Home Assistant
when launched by Visual Studio Code in a devcontainer.

Plese refere to generated project ``CONTRIBUTING.rst`` file for detailed instructions on testing.

.. _instance repository: https://github.com/oncleben31/cookiecutter-homeassistant-custom-component-instance

How to submit changes
---------------------

Expand Down
9 changes: 9 additions & 0 deletions scripts/gen_instance
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Generate instance project from template for testing on GitHub.

# Stop on errors
set -e

cd "$(dirname "$0")/../.."

cookiecutter -f cookiecutter-homeassistant-custom-component --config-file cookiecutter-homeassistant-custom-component/scripts/instance_settings.yaml --no-input
8 changes: 8 additions & 0 deletions scripts/instance_settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
default_context:
class_name_prefix: CcHaCci
domain_name: cc_ha_cci
friendly_name: Cookiecutter Home Assistant Custom Component Instance
github_user: oncleben31
project_name: cookiecutter-homeassistant-custom-component-instance
test_suite: yes
version: 0.0.0

0 comments on commit a8a9452

Please sign in to comment.