Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Add a contributing guide.
Browse files Browse the repository at this point in the history
And move testing out of the home page to it.

fixes: #6862
  • Loading branch information
mikedep333 committed May 29, 2020
1 parent faa4791 commit ebc5127
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 76 deletions.
1 change: 1 addition & 0 deletions CHANGES/6862.doc
@@ -0,0 +1 @@
Added a contributing guide, and moved testing out of the home page to it.
107 changes: 107 additions & 0 deletions docs/contributing.md
@@ -0,0 +1,107 @@
Contributing
============

Pull Request Checklist
------------------------
1. Make sure your change does not break idempotency tests. See [Testing](#Testing)
(or let CI run the tests for you if you are certain it is idempotent.)
If a task cannot be made idempotent, add the tag [molecule-idempotence-notest](https://github.com/ansible-community/molecule/issues/816#issuecomment-573319053).
2. Unless a change is small or doesn't affect users, create an issue on
https://pulp.plan.io/projects/pulp . Set the Category to "Installer".
3. Add [a changelog update.](https://docs.pulpproject.org/contributing/git.html#changelog-update)
4. Write an excellent [Commit Message.](https://docs.pulpproject.org/contributing/git.html#commit-message)
Make sure you reference and link to the issue.
5. Push your branch to your fork and open a [Pull request across forks.](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)
6. Add GitHub labels as appropriate.

Testing
-------

The tests can be run as they are on travis with **tox**, or they can run with various options using
**molecule** directly.

**Requirements:**
Install Docker, and add yourself to the group that is authorized to
administer containers, and log out and back in to make the permissions change
take effect. The authorized group is typically the "docker" group:

```bash
gpasswd --add "$(whoami)" docker
```

**NOTE:** Docker containers can differ from bare-metal or VM OS installs.
They can have different packages installed, they can run different kernels,
and so on.

**Using Tox:**

1. Install [tox](https://tox.readthedocs.io/en/latest/). This can be done
through the system package manager or into a virtualenv:

```bash
python3 -m venv ~/.venvs/pulp_installer
pip install --upgrade pip
pip install tox
```
2. Install at least one of the Python interpreters listed in tox.ini. These are
currently Python 2.7 and 3.6.
**WARNING:** Anyone added to the docker group is root equivalent. More
information [here](https://github.com/docker/docker/issues/9976) and
[here](https://docs.docker.com/engine/security/security/).

4. Run `tox`. If you only have a subset of the supported Python interpreters
available, specify which environments to exercise:

```bash
tox -e py36
```

**Using Molecule:**

1. Install [molecule](https://molecule.readthedocs.io/en/latest/),
[molecule-inspec](https://github.com/ansible-community/molecule-inspec),
and [ansible-lint](https://docs.ansible.com/ansible-lint/).


It is recommended that you do so with `pip` in a virtualenv.
2. Run molecule commands.

Test all scenarios on all hosts.
```bash
molecule test --all
```

Test a specific scenario.
```bash
molecule test --scenario-name source
```

Use debug for increased verbosity.
```bash
molecule --debug test --all
```

Create and provision, but don't run tests or destroy.
```bash
molecule converge --all
```

Docs Testing
------------

On Fedora:
```
sudo dnf install mkdocs python3-pymdown-extensions
```

Cross-platform:
```
pip install mkdocs pymdown-extensions
```

Then:
```
`mkdocs serve`
```
Click the link it outputs. As you save changes to files modified in your editor,
the browser will automatically show the new content.
77 changes: 2 additions & 75 deletions docs/index.md
Expand Up @@ -41,7 +41,7 @@ the minimal set of required variables.


Ansible Boilerplate
-----------------
-------------------

These roles can be used against any managed node and are highly configurable. Knowledge of
[ansible basics](https://docs.ansible.com/ansible/2.5/user_guide/intro_getting_started.html) will
Expand Down Expand Up @@ -80,81 +80,8 @@ ansible-playbook playbooks/example-use/playbook.yml -u <managed_node_username> -
To configure a custom install, you will need to set configuration variables. In the simplest case,
they can be set in the playbook. See the ansible docs for more flexible idiomatic alternatives.


Testing
-------

The tests can be run as they are on travis with **tox**, or they can run with various options using
**molecule** directly.

**Requirements:**
Install Docker, and add yourself to the group that is authorized to
administer containers, and log out and back in to make the permissions change
take effect. The authorized group is typically the "docker" group:

```bash
gpasswd --add "$(whoami)" docker
```

**NOTE:** Docker containers can differ from bare-metal or VM OS installs.
They can have different packages installed, they can run different kernels,
and so on.

**Using Tox:**

1. Install [tox](https://tox.readthedocs.io/en/latest/). This can be done
through the system package manager or into a virtualenv:

```bash
python3 -m venv ~/.venvs/pulp_installer
pip install --upgrade pip
pip install tox
```
2. Install at least one of the Python interpreters listed in tox.ini. These are
currently Python 2.7 and 3.6.
**WARNING:** Anyone added to the docker group is root equivalent. More
information [here](https://github.com/docker/docker/issues/9976) and
[here](https://docs.docker.com/engine/security/security/).

4. Run `tox`. If you only have a subset of the supported Python interpreters
available, specify which environments to exercise:

```bash
tox -e py36
```

**Using Molecule:**

1. Install [molecule](https://molecule.readthedocs.io/en/latest/),
[molecule-inspec](https://github.com/ansible-community/molecule-inspec),
and [ansible-lint](https://docs.ansible.com/ansible-lint/).


It is recommended that you do so with `pip` in a virtualenv.
2. Run molecule commands.

Test all scenarios on all hosts.
```bash
molecule test --all
```

Test a specific scenario.
```bash
molecule test --scenario-name source
```

Use debug for increased verbosity.
```bash
molecule --debug test --all
```

Create and provision, but don't run tests or destroy.
```bash
molecule converge --all
```

Roles
-------
-----

pulp_installer is equipped with the following roles:

Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
@@ -1,12 +1,13 @@
site_name: Pulp Installer
site_description: Pipelines for Generating and Releasing Documentation
site_description: Pulp 3 Ansible Installer
site_author: Pulp Team
site_url: https://pulp-installer.readthedocs.io/
repo_name: pulp/pulp_installer
repo_url: https://github.com/pulp/pulp_installer
theme: readthedocs
nav:
- Home: index.md
- contributing.md
- Roles:
- Pulp: roles/pulp.md
- Pulp Content: roles/pulp_content.md
Expand Down

0 comments on commit ebc5127

Please sign in to comment.