From 7ba64953d561e4a6e8f941f0a1722e81fe00a255 Mon Sep 17 00:00:00 2001 From: Luis Mayta Date: Sun, 29 Dec 2024 23:09:56 -0500 Subject: [PATCH] build(docs): generate docs (#2) --- README.md | 153 +++++++++++++++++++++++++++++++++++++++++++++++++- docs/usage.md | 2 + 2 files changed, 153 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 19a6a94..73277b5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,9 @@ # tasks -tasks for project +# 📦 Taskfile Templates Repository + +This repository contains reusable **Taskfile templates** to standardize and simplify common tasks like running pre-commit hooks, generating changelogs, creating GitHub releases, and more. ## Requirements @@ -28,7 +30,154 @@ This is a list of plugins that need to be installed previously to enjoy all the ## Usage -# How to use this project +# 🚀 How to use this project + +## Add the Remote Taskfiles + +To use the Taskfile templates in your project, include the remote Taskfiles in your project's `Taskfile.yaml`: + +```yaml +version: "3" +includes: + pre-commit: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/pre-commit/Taskfile.yaml" + github: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/github/Taskfile.yaml" + changelog: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/changelog/Taskfile.yaml" + confluence: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/confluence/Taskfile.yaml" + python: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/python/Taskfile.yaml" + git: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/git/Taskfile.yaml" + docs: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/docs/Taskfile.yaml" + docker: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/docker/Taskfile.yaml" + version: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/version/Taskfile.yaml" + plantuml: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/plantuml/Taskfile.yaml" + prettier: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/prettier/Taskfile.yaml" + sonar: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/sonar/Taskfile.yaml" + diagrams: + taskfile: "https://raw.githubusercontent.com/hadenlabs/tasks/main/diagrams/Taskfile.yaml" + +env: + DOCKER: + sh: docker --version 2> /dev/null || echo "not exist" + PYTHON: + sh: python --version 2> /dev/null || echo "not exist" + GO: + sh: go version 2> /dev/null || echo "not exist" + NODE: + sh: node --version 2> /dev/null || echo "not exist" + APP_TAG: + sh: git describe --tags $(git rev-list --tags --max-count=1) 2> /dev/null || echo "0.0.0" + README_YAML: provision/generators/README.yaml + README_TEMPLATE: provision/templates/README.tpl.md + README_INCLUDES: file:// + +vars: + PROJECT_NAME: { { project } } + GROUP_NAME: hadenlabs + ORGANIZATION: hadenlabs + DOCKER_PLATFORM: linux/amd64 + REVIEWERS: luismayta + PYTHON_VERSION: 3.11.5 + NODE_VERSION: 18.18.2 + TERRAFORM_VERSION: 1.8.4 + GIT_IGNORES: python,node,go,zsh,sonar,java,maven,intellij+all,terraform,linux + GOLANGCI_VERSION: 1.42.0 + README_FILE: README.md + GIT_IGNORES_CUSTOM: | + bin + .scannerwork + .secrets + public + TMP_CHANGELOG.md + .task + .terraform.lock.hcl + *.lock.hcl + *.zip + .external_modules + vendor + +dotenv: + - .env + +tasks: + default: + deps: + - task: check + cmds: + - cmd: echo Application {{.PROJECT_NAME}} + silent: true + - task: version:default + - task: summary + - cmd: task -l + silent: true + + summary: + desc: "Summary information" + cmds: + - echo Go available {{.GO}} + - echo Python available {{.PYTHON}} + - echo Docker available {{.DOCKER}} + - echo Node available {{.NODE}} + silent: true + + check: + desc: "Check all dependencies" + deps: + - python:check + - changelog:check + - git:check + - docs:check + + readme: + run: once + desc: Generate Readme + silent: true + cmds: + - >- + gomplate --file {{.README_TEMPLATE}} --out {{.README_FILE}} --datasource config={{.README_YAML}} --datasource includes={{.README_INCLUDES}} + + + - task: prettier + + prettier: + run: once + desc: Execute prettier files + cmds: + - task: prettier:all + + upgrade: + run: once + desc: Execute upgrade packages + cmds: + - poetry update + - poetry run pre-commit autoupdate + + setup: + desc: Setup dependences of project + cmds: + - >- + [ -e ".env" ] || cp -rf .env.example .env + + + - task: python:setup + - task: python:precommit + - task: git:setup + + environment: + desc: Setup environment of project + cmds: + - task: python:environment +``` ## Examples diff --git a/docs/usage.md b/docs/usage.md index 6d2b96d..b801516 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -114,6 +114,7 @@ tasks: - >- gomplate --file {{.README_TEMPLATE}} --out {{.README_FILE}} --datasource config={{.README_YAML}} --datasource includes={{.README_INCLUDES}} + - task: prettier prettier: @@ -135,6 +136,7 @@ tasks: - >- [ -e ".env" ] || cp -rf .env.example .env + - task: python:setup - task: python:precommit - task: git:setup