Skip to content

Commit

Permalink
Merge pull request #114 from memes/fix/112_update_repo
Browse files Browse the repository at this point in the history
Update repo to standard
  • Loading branch information
memes authored Sep 12, 2024
2 parents eff06b8 + 42d809b commit c821f23
Show file tree
Hide file tree
Showing 13 changed files with 293 additions and 36 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
# These github actions will update Terraform section(s) of README(s), and
# perform linting using pre-commit.
# These github actions will perform linting using pre-commit.
# yamllint disable rule:line-length
# spell-checker: disable
---
name: pre-commit

# yamllint disable-line rule:truthy
on:
pull_request:
push:
branches: [main]
branches-ignore:
- main

permissions:
contents: read
pull-requests: read

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install terraform-docs
run: |
sudo curl -sL --output - https://github.com/terraform-docs/terraform-docs/releases/download/v0.16.0/terraform-docs-v0.16.0-linux-amd64.tar.gz | tar xzf - -C /usr/local/bin
sudo chmod 0755 /usr/local/bin/terraform-docs
- uses: actions/checkout@v4
- name: install talisman
run: |
sudo curl -sLo /usr/local/bin/talisman https://github.com/thoughtworks/talisman/releases/download/v1.29.4/talisman_linux_amd64
sudo curl -sLo /usr/local/bin/talisman https://github.com/thoughtworks/talisman/releases/download/v1.32.0/talisman_linux_amd64
sudo chmod 0755 /usr/local/bin/talisman
- uses: actions/[email protected]
- name: Install terraform-docs
run: |
sudo sh -c 'curl -sL https://github.com/terraform-docs/terraform-docs/releases/download/v0.18.0/terraform-docs-v0.18.0-linux-amd64.tar.gz | tar xzf - -C /usr/local/bin'
sudo chmod 0755 /usr/local/bin/terraform-docs
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: pre-commit/[email protected].0
python-version: '3.12'
- uses: pre-commit/[email protected].1
23 changes: 23 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# spell-checker: disable
---
name: release-please

# yamllint disable-line rule:truthy
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Release Please
uses: GoogleCloudPlatform/[email protected]
with:
release-type: simple
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Stale issue and PR workflow
---
name: stale

# yamllint disable-line rule:truthy
on:
schedule:
- cron: '30 1 * * *'

permissions:
issues: write
pull-requests: write

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
days-before-stale: 30
days-before-close: 7
days-before-pr-close: -1
stale-issue-message: >
This issue has been automatically marked as stale because it has not
had recent activity. It will be closed if no further activity
occurs.
Thank you for your contributions.
close-issue-label: wontfix
close-issue-message: >
This issue has been automatically closed because it has been marked
as stale for 7 days with no activity. Thank you for your
contributions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ kubeconfig*

# Ignore any pytest caches
.pytest_cache
__pycache__
33 changes: 24 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,51 @@
---
repos:
- repo: https://github.com/adrienverge/yamllint
rev: v1.31.0
rev: v1.35.1
hooks:
- id: yamllint
files: \.(yml|yaml|talismanrc)$
types: [file, yaml]
types:
- file
- yaml
entry: yamllint --strict
- repo: https://github.com/ansible/ansible-lint
rev: v6.15.0
rev: v24.9.0
hooks:
- id: ansible-lint
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.77.3
rev: v1.95.0
hooks:
- id: terraform_fmt
- id: terraform_docs
args: ['--args=--sort-by=required --hide=providers']
args:
- '--args=--sort-by=required --hide=providers'
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
hooks:
- id: conventional-pre-commit
stages:
- commit-msg
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: detect-private-key
- id: end-of-file-fixer
- id: pretty-format-json
args: [--autofix]
- id: no-commit-to-branch
args:
- -b
- main
- id: trailing-whitespace
- repo: https://github.com/thoughtworks/talisman
rev: 'v1.30.2'
rev: v1.32.0
hooks:
- id: talisman-commit
entry: cmd --githook pre-commit
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"dpkg",
"dvswitch",
"elrepo",
"endfor",
"esxi",
"fileignoreconfig",
"firewalld",
Expand All @@ -36,7 +37,9 @@
"gpgkey",
"hashi",
"hashicorp",
"hostvars",
"hugepages",
"ifname",
"ignoreerrors",
"ipaddr",
"ipmi",
Expand Down Expand Up @@ -85,6 +88,7 @@
"rpcbind",
"runc",
"sbin",
"selectattr",
"selinux",
"smbd",
"storageclass",
Expand All @@ -102,7 +106,8 @@
"vmgmt",
"vmware",
"vnet",
"vsphere"
"vsphere",
"wontfix"
],
"yaml.schemas": {
"https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible-lint-config.json": "/.ansible-lint"
Expand Down
Empty file added CHANGELOG.md
Empty file.
132 changes: 132 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# How to contribute

Contributions are welcome to this repo, but we do have a few guidelines for
contributors.

## Open an issue and pull request for changes

All submissions, including those from project members, are required to go through
review. We use [GitHub Pull Requests](https://help.github.com/articles/about-pull-requests/)
for this workflow, which should be linked with an issue for tracking purposes.
A GitHub action will be run against your PR to ensure code standards have been
applied.

[pre-commit] is used to ensure that all files have consistent formatting and to
avoid committing secrets.

1. Install [pre-commit] in a virtual python environment or globally: see [instructions](https://pre-commit.com/#installation)
2. Fork and clone this repo
3. Install pre-commit hook to git

E.g.

```shell
pip install -r requirements-dev.txt
pre-commit install --hook-type commit-msg --hook-type pre-commit
```

4. Create a new branch for changes
5. Commit and push changes for PR

The hook will ensure that `pre-commit` will be run against all staged changes
during `git commit`.

[pre-commit]: https://pre-commit.com/
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# lab-config

![GitHub release](https://img.shields.io/github/v/release/memes/lab-config?sort=semver)
![Maintenance](https://img.shields.io/maintenance/yes/2024)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)

The scripts and playbooks I use for lab setup.

> TODO @memes - add content
Loading

0 comments on commit c821f23

Please sign in to comment.