Skip to content

Commit

Permalink
Improve Contributing documentation (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
dariofaccin authored Oct 16, 2023
1 parent 0e5a4f5 commit d6d70e0
Showing 1 changed file with 33 additions and 17 deletions.
50 changes: 33 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,47 @@
# Contributing
To make contributions to this charm, you'll need a working Juju development setup.

To make contributions to this charm, you'll need a working [Juju development setup](https://juju.is/docs/sdk/dev-setup).
## Prerequisites
Install Charmcraft and LXD:
```shell
sudo snap install --classic charmcraft
sudo snap install lxd
sudo adduser $USER lxd
newgrp lxd
lxd init --auto
```

Install MicroK8s:
```shell
sudo snap install microk8s --channel=1.27-strict/stable
sudo usermod -a -G snap_microk8s $USER
newgrp snap_microk8s
sudo microk8s enable hostpath-storage
```

You can use the environments created by `tox` for development:
Install Juju and bootstrap a controller on the MicroK8S instance:
```shell
sudo snap install juju --channel=3.1/stable
juju bootstrap microk8s
```

Install `pip` and `tox`:
```shell
sudo apt install python3-pip
python3 -m pip install "tox>=4.0.0"
```

## Development
Activate the virtual environment created by `tox` for development:
```shell
tox --notest -e unit
source .tox/unit/bin/activate
```

## Testing
This project uses `tox` for managing test environments.

This project uses `tox` for managing test environments. There are some pre-configured environments
There are some pre-configured environments
that can be used for linting and formatting code when you're preparing contributions to the charm:

```shell
Expand All @@ -22,21 +52,7 @@ tox -e integration # integration tests
```

## Build

Building charms is done using charmcraft (official documentation [here](https://juju.is/docs/sdk/publishing)). You can install charmcraft using `snap`:

```bash
sudo snap install charmcraft --channel=classic
```

Initialize LXD:

```bash
lxd init --auto
```

Go to the charm directory and run:

```bash
charmcraft pack
```

0 comments on commit d6d70e0

Please sign in to comment.