-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from brigade-automation/develop
v1.0.0
- Loading branch information
Showing
242 changed files
with
6,161 additions
and
9,127 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,8 @@ | ||
# This is an example .flake8 config, used when developing *Black* itself. | ||
# Keep in sync with setup.cfg which is used for source packages. | ||
|
||
[flake8] | ||
ignore = E266, E501, W503 | ||
max-line-length = 80 | ||
max-complexity = 15 | ||
select = B,C,E,F,W,T4,B9 |
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
How to contribute to Brigade | ||
============================ | ||
|
||
First of all, thank you for conidering to contribute to this project! | ||
|
||
Several ways to contribute | ||
-------------------------- | ||
|
||
There are several things you can do to help the project. | ||
|
||
- Spread the word about Brigade | ||
- Suggest great features | ||
- Report bugs | ||
- Fix typos | ||
- Write documentation | ||
- Contribute your plugins | ||
- Improve the Brigade core | ||
|
||
Spread the word about Brigade | ||
----------------------------- | ||
|
||
Even if you aren't in the position that you can contribute your time to this project, it still helps us if you spread the word about the project. It could be just a short notice in social media or a discussion you have with your friends. As more people become aware of the project there's a better chance that we reach people who are able to contribute. So, even if you can't directly contribute yourself, someone you refer to us might. | ||
|
||
Suggesting new features | ||
----------------------- | ||
|
||
It could be that you are aware of something that would be great to have in Brigade and we are always welcoming feature requests. Make sure you explain in what scenario your suggested feature would be useful. | ||
|
||
Reporting bugs | ||
-------------- | ||
|
||
When you are `reporting bugs <https://github.com/brigade-automation/brigade/issues>`_, make sure that you give a explaination about the outcome that you expect and what you are seeing. The bugs which are hardest to fix are the ones which we are unable to reproduce. For this reason it's important that you describe what you did and show us how we can reproduce the bug in another environment. | ||
|
||
Fix typos | ||
--------- | ||
|
||
While we try to take care, getting all the works correct can be.. differcult. Typos are the easiest things to fix and if you find any you can help us from looking silly. You can find more typos to fix by looking in the `Brigade source code <https://github.com/brigade-automation/brigade/tree/develop/brigade>`_ or by visiting the `Brigade documentation <https://brigade.readthedocs.io>`_. | ||
|
||
Writing documentation | ||
--------------------- | ||
|
||
Documentation is another great way to help if you don't want to contribute actual code. The documentation of Brigade is divided into different sections. | ||
|
||
- Tutorials: Aims to help people learn Brigade with a lot of handholding, the user might not end up with something useful after following the tutorial. The goal is for people to learn how to use Brigade. | ||
- How-to guides: This sections goal is to help people solve a specific task with Brigade | ||
- Reference guides: This section describe the Brigade API and plugins. Most of the content in this area is generated from the source code itself. | ||
|
||
Contributions to the documentation can be small fixes such as changing scentences to make the text more clear, or it could be new guides. | ||
|
||
Contributing plugins | ||
-------------------- | ||
|
||
If you have written your custom plugin for Brigade there's a good chance that it can be useful for others as well. General guidelines when writing plugins are: | ||
|
||
- Make them as generic as possible, it doesn't help others if they only work in your environment | ||
- Make sure that it's possible to have unit tests which automatically test that the plugins are working | ||
|
||
|
||
Contributing to the Brigade core | ||
-------------------------------- | ||
|
||
When you are contributing code to the core of Brigade make sure that the existing tests are passing, and add tests to the code you have added. Having your tests in place ensures that other won't accidentally brake it in the future. | ||
|
||
Before you make any significant code changes to the core it's recommended that you open an issue to discuss your ideas before writing the code. | ||
|
||
Setting up your environment | ||
--------------------------- | ||
|
||
In order to run tests locally you need to have `Docker <https://docs.docker.com/install/>`_ and `Pandoc <https://pandoc.org/installing.html>`_ installed. Docker is used to test the Brigade plugins and Pandoc is required for building the documentation provided by `Sphinx <http://www.sphinx-doc.org/>`_. After those are installed you can go ahead and install the needed Python dependencies. | ||
|
||
.. code-block:: bash | ||
pip -r requirements-dev.txt | ||
Running tests | ||
------------- | ||
|
||
While the automated tests will be triggered when you submit a new pull request it can still save you time to run the tests locally first. | ||
|
||
.. code-block:: bash | ||
make tests | ||
The test above will run the tests against the Brigade code and documentation. | ||
|
||
|
||
Coding style | ||
------------ | ||
|
||
Brigade uses `Black <https://github.com/ambv/black>`_, the the uncompromising Python code formatter. Black makes it easy for you to format your code as you can do so automatically after installing it. Note that Python 3.6 is required to run Black. | ||
|
||
.. code-block:: bash | ||
make format | ||
The Black GitHub repo has information about how you can integrate Black in your editor. |
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 +1,2 @@ | ||
include requirements* | ||
include README.md |
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,17 @@ | ||
|
||
.PHONY: format | ||
format: | ||
black . | ||
|
||
.PHONY: start_nsot | ||
start_nsot: | ||
docker run -v $(PWD)/tests/inventory_data/nsot/nsot.sqlite3:/nsot.sqlite3 -p 8990:8990 -d --name=nsot nsot/nsot start --noinput | ||
cp $(PWD)/tests/inventory_data/nsot/nsot.sqlite3 $(PWD)/tests/inventory_data/nsot/nsot-docker.sqlite3 | ||
docker run -v $(PWD)/tests/inventory_data/nsot/nsot-docker.sqlite3:/nsot.sqlite3 -p 8990:8990 -d --name=nsot nsot/nsot start --noinput | ||
|
||
.PHONY: stop_nsot | ||
stop_nsot: | ||
docker rm -f nsot | ||
|
||
.PHONY: tests | ||
tests: | ||
tox |
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,4 +1,48 @@ | ||
[![Build Status](https://travis-ci.org/brigade-automation/brigade.svg?branch=develop)](https://travis-ci.org/brigade-automation/brigade) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) [![Coverage Status](https://coveralls.io/repos/github/brigade-automation/brigade/badge.svg?branch=develop)](https://coveralls.io/github/brigade-automation/brigade?branch=develop) | ||
|
||
|
||
Brigade | ||
======= | ||
Brigade is a pure Python automation framework intented to be used directly from Python. While most automation frameworks use their own DSL which you use to describe what you want to have done, Brigade lets you control everything from Python. | ||
|
||
One of the benefits we want to highlight with this approach is the ease of troubleshooting, if something goes wrong you can just use your existing debug tools directly from Python (just add a line of `import pdb` & `pdb.set_trace()` and you're good to go). Doing the same using a DSL can be quite time consuming. | ||
|
||
What Brigade brings to the table is that it takes care of dealing with your inventory and manages the job of dispatching the tasks you want to run against your nodes and devices. The framework provides a very simple way to write plugins if you aren't happy with the ones we ship. Of course if you have written a plugin you think can be useful to others, please send us your code and test cases as a [pull request](https://github.com/brigade-automation/brigade/pulls). | ||
|
||
|
||
Install | ||
======= | ||
|
||
While Brigade still supports Python 2.7 the recommended version is 3.6. Install it with pip. | ||
|
||
``` | ||
pip install brigade | ||
``` | ||
|
||
Documentation | ||
============= | ||
|
||
Read the [Brigade documentation](https://brigade.readthedocs.io/) online or review it's [code here](https://github.com/brigade-automation/brigade/tree/develop/docs) | ||
|
||
Examples | ||
======== | ||
|
||
You can find some examples and already made tools [here](https://github.com/brigade-automation/brg-tools/) | ||
|
||
|
||
Bugs & New features | ||
=================== | ||
|
||
If you think you have bug or would like to request a new feature, please register a GitHub account and [open an issue](https://github.com/brigade-automation/brigade/issues). | ||
|
||
|
||
Contact & Support | ||
================= | ||
|
||
While we are happy to help, the [GitHub issues](<https://github.com/brigade-automation/brigade/issues>) are intended for bugs and discussions about new features. If are struggling to get something to work but don't believe its due to a bug in Brigade, the place to ask questions is in the #brigade channel in the [networktoCode Slack team](https://networktocode.herokuapp.com/). | ||
|
||
|
||
Contributing to Brigade | ||
======================= | ||
|
||
See [docs](https://brigade.readthedocs.io). | ||
If you want to help the project, the [Contribution Guidelines](https://brigade.readthedocs.io/en/develop/contributing/index.html) is the best place to 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import pkg_resources | ||
|
||
try: | ||
__version__ = pkg_resources.get_distribution('brigade').version | ||
__version__ = pkg_resources.get_distribution("brigade").version | ||
except pkg_resources.DistributionNotFound: | ||
__version__ = "Not installed" |
Oops, something went wrong.