Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script for generating instance repository #130

Merged
merged 3 commits into from
Jan 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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