Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

Commit

Permalink
build(COOKIECUTTER): Initial Generation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 21, 2022
0 parents commit 05d1b31
Show file tree
Hide file tree
Showing 68 changed files with 5,108 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .aspell.pws
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
personal_ws-1.1 en 87
api
asdf
aspell
autodetect
autosummary
builtins
changelog
checkin
ci
cli
cmd
cmds
coc
commitizen
conf
config
cookiecutter
cov
cve
darglint
dedent
dependabot
dev
disto
distro
dockerfile
docstrings
encodings
env
fixup
fixups
fmt
fn
formatters
github
gitignore
gitlabflow
gitleaks
hadolint
hardcoded
hostmachine
init
isort
jinja
json
jsonschema
linter
lockfile
md
mislabelled
mixins
mypy
patchbay
pib
pipenv
pre
pws
py
pydocstyle
pylint
pypi
pyproject
pytest
readme
readthedocs
rgx
rst
sectest
shellcheck
shellchecked
svs
targetted
testcase
toc
toml
tomll
trufflehog
unittest
unittests
unpatched
untracked
validator
whitespace
wip
yaml
yamllint
yapf
yml
31 changes: 31 additions & 0 deletions .cookiecutter/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"_GITHUB_ANCHORE_SCAN_ACTION": "anchore/scan-action@v3",
"_GITHUB_CODEQL_ACTION_UPLOAD_SARIF": "github/codeql-action/upload-sarif@v2",
"_GITHUB_DOCKER_BUILDX_ACTION": "docker/setup-buildx-action@v2",
"_GITHUB_DOCKER_BUILD_PUSH_ACTION": "docker/build-push-action@v3",
"_GITHUB_DOCKER_LOGIN_ACTION": "docker/login-action@v2",
"_GITHUB_HADOLINT_ACTION": "hadolint/hadolint-action@v3.0.0",
"_GITHUB_MARKDOWN_LINK_CHECK_ACTION": "gaurav-nelson/github-action-markdown-link-check@1.0.13",
"_GITHUB_PUSH_ACTION": "ad-m/github-push-action@v0.6.0",
"_GITHUB_TRUFFLEHOG_ACTION": "trufflesecurity/trufflehog@v3.20.0",
"_GITHUB_YAMLLINT_ACTION": "ibiqlik/action-yamllint@v3",
"_output_dir": "/home/runner/work/python-in-a-box/python-in-a-box",
"_pib_cli_version": "^1.2.0",
"_template": "template/",
"author": "Niall Byrne",
"description": "Not the evil tracking type.",
"email": "niall@niallbyrne.ca",
"formatting": "PEP8",
"git_base_branch": "main",
"git_username": "niall-byrne",
"include_gitconfig": "false",
"include_gitconfig_global": "false",
"include_lock_file": "true",
"include_ssh_keys": "false",
"optional_docstring_linting": "true",
"optional_sphinx_support": "true",
"optional_typing_support": "true",
"project_name": "Mmmm Cookies",
"project_slug": "mmmm_cookies",
"python_version": "3.7"
}
4 changes: 4 additions & 0 deletions .darglint
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[darglint]
docstring_style=sphinx
ignore=
strictness=full
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./assets/*.env
!./assets/local.env
7 changes: 7 additions & 0 deletions .github/config/markdown.link.check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ignorePatterns": [
{
"pattern": "^https://docs.github.com/"
}
]
}
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
version: 2
updates:
- package-ecosystem: "pip"
target-branch: "main"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
reviewers:
- "niall-byrne"
46 changes: 46 additions & 0 deletions .github/markdown/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

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

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers 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, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at niall@niallbyrne.ca. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
3 changes: 3 additions & 0 deletions .github/markdown/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contribution Guide

[Code of Conduct](./CODE_OF_CONDUCT.md)
15 changes: 15 additions & 0 deletions .github/markdown/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#### What's going wrong?

#### How can the Mmmm Cookies team reproduce the problem?

<!-- Please add a complete description of how to reproduce the problem -->

#### Is this a problem with a fresh install of the project?

- [ ] Yes
- [ ] No

<!--
- Participation in this open source project is subject to the Code of Conduct:
[Code of Conduct](./CODE_OF_CONDUCT.md)
-->
1 change: 1 addition & 0 deletions .github/markdown/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Closes # for release #.
21 changes: 21 additions & 0 deletions .github/scripts/build_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# .github/scripts/build_container.sh
# Builds the container to a specific Python version.

# 1: The docker-compose file to use, defaults to "docker-compose.yaml"
# PYTHON_VERSION: The version of Python to build the container with.

# CI only script.

set -eo pipefail
COMPOSE_FILE=${1-docker-compose.yml}

main() {

docker-compose -f "${COMPOSE_FILE}" build --build-arg BUILD_ARG_PYTHON_VERSION="${PYTHON_VERSION}"
docker-compose -f "${COMPOSE_FILE}" up -d

}

main "$@"
28 changes: 28 additions & 0 deletions .github/scripts/changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# .github/scripts/changelog.sh
# Generates a changelog based off the diff between $TAG and the previous sequential tag.

# TAG: The new git tag the changelog is being generated for.

# CI only script

set -eo pipefail

main() {

echo "{}" > package.json
TAG="$(git tag | sort --version-sort | tail -n 2 | head -n 1)"
CHANGE_LOG_CONTENT="$(npx -q generate-changelog -f - -t "${TAG}")"

{
echo "CHANGE_LOG_CONTENT<<EOF"
echo "${CHANGE_LOG_CONTENT}"
echo "EOF"
} >> "$GITHUB_ENV"

rm package.json

}

main
16 changes: 16 additions & 0 deletions .github/scripts/lint_shellcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# .github/scripts/lint_shellcheck.sh
# Runs shellcheck on all scripts.

# CI only script

set -eo pipefail

main() {

find . -name "*.sh" -print0 | xargs --null shellcheck

}

main "$@"
19 changes: 19 additions & 0 deletions .github/scripts/notifications.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# .github/scripts/notifications.sh
# Sends a notification to slack.

# 1: The branch information to display.
# 2: The notification message to send.
# WEBHOOK_URL: The slack webhook url to use.

# CI only script.

main() {

[[ -z ${WEBHOOK_URL} ]] && exit 0
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"${1}: ${2}\"}" "${WEBHOOK_URL}"

}

main "$@"
40 changes: 40 additions & 0 deletions .github/scripts/pushed_commit_range.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# .github/scripts/pushed_commit_range.sh
# Retrieves the range of the commits in a push, and sets the PUSHED_COMMIT_RANGE environment variables.

# GITHUB_CONTEXT: The github action context object as an environment variable.

# CI only script

set -eo pipefail


get_all_commits() {
git rev-list --max-parents=0 HEAD
}


main() {

PUSHED_COMMIT_RANGE="HEAD~$(echo "$GITHUB_CONTEXT" | jq '.event.commits | length')"

if [[ "${PUSHED_COMMIT_RANGE}" == "HEAD~0" ]]; then
PUSHED_COMMIT_RANGE="$(get_all_commits)"
fi

set +e
if ! git rev-parse "${PUSHED_COMMIT_RANGE}"; then
PUSHED_COMMIT_RANGE="$(get_all_commits)"
fi
set -e

{
echo "PUSHED_COMMIT_RANGE<<EOF"
echo "${PUSHED_COMMIT_RANGE}"
echo "EOF"
} >> "$GITHUB_ENV"

}

main "$@"
22 changes: 22 additions & 0 deletions .github/scripts/release_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# .github/scripts/release_docker.sh
# Sets environment content for the Docker CD workflows.

# DOCKER_TOKEN: An API token for DockerHub set as a Github Secret.

# CI only script.

set -eo pipefail

main() {

if [[ -n "${DOCKER_TOKEN}" ]]; then

echo "CD_DOCKER_REPO_ENABLED=true" >> "$GITHUB_ENV"

fi

}

main "$@"
Loading

0 comments on commit 05d1b31

Please sign in to comment.