Skip to content

Commit

Permalink
chore: add makefile
Browse files Browse the repository at this point in the history
ref: 26
  • Loading branch information
jon-nfc committed Aug 18, 2024
1 parent 0c7873a commit 81d2ef7
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"streetsidesoftware.code-spell-checker-australian-english",
"streetsidesoftware.code-spell-checker",
"github.vscode-github-actions",
"jebbs.markdown-extended"
"jebbs.markdown-extended",
"njpwerner.autodocstring",
"ms-python.python",
"ms-python.debugpy"
]
}
32 changes: 30 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
# Contirbution Guide
# Contribution Guide

We welcome contributions.


## Makefile

!!! tip "TL;DR"
Common make commands are `make prepare` then `make docs` and `make lint`

Included within the root of the repository is a makefile that can be used during development to check/run different items as is required during development. The following make targets are available:

- `prepare`

_prepare the repository. init's all git submodules and sets up a python virtual env_

- `docs`

_builds the docs and places them within a directory called build, which can be viewed within a web browser_

- `lint`

_conducts all required linting_

- ansible-lint

_lints ansible directories/files only. should only be used when you only want to check Ansible formatting._

- `clean`

_cleans up build artifacts and removes the python virtual environment_


## Inventory Plugin

``` bash

# to test use
ansible-inventory -i nofusscomputing.itsm.centurion --list -vvv
ansible-inventory -i nofusscomputing.centurion.centurion --list -vvv

```
43 changes: 43 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.ONESHELL:

PATH_VENV := /tmp/ansible_collection_centurion

ACTIVATE_VENV :=. ${PATH_VENV}/bin/activate

.PHONY: clean prepare docs ansible-lint lint


prepare:
git submodule update --init
git submodule foreach git submodule update --init
python3 -m venv ${PATH_VENV}
${ACTIVATE_VENV}
pip install -r website-template/gitlab-ci/mkdocs/requirements.txt
pip install -r gitlab-ci/lint/requirements.txt


docs:
${ACTIVATE_VENV}
mkdocs build --clean


ansible-lint-galaxy:
${ACTIVATE_VENV}
ansible-lint galaxy.yml


ansible-lint-dirs:
${ACTIVATE_VENV}
ansible-lint meta/ playbooks/ roles/


ansible-lint: ansible-lint-galaxy ansible-lint-dirs


lint: ansible-lint


clean:
rm -rf ${PATH_VENV}
rm -rf pages
rm -rf build

0 comments on commit 81d2ef7

Please sign in to comment.