refactor: update documentation for Taskfile container workflow, rename log-prompt to commit-prompt, and improve site descriptions

This commit is contained in:
Janik von Rotz committed 2026-10-05 21:41:54 +02:00
1 parent e451bb244d
commit 2ce33d6273
9 files changed
+61 -328

No files matched your search

+2 -2
View File
@@ -27,10 +27,10 @@ The naming of functions is important. There are basically two styles:
The Taskfile functions use the first style. The name of the function starts with an action followed by an object. The object name can be singular or plural.
<button id="generate-function-names">Generate Function Names</button> <ul id="function-names"> <!-- Random function names will be inserted here by JS --> </ul>
**Examples for actions**: <span id="actions">activate, install, dev, develop, init, build, start, update, remove, delete, enable, disable, template, convert, create, edit, change, get, set, patch, fetch, generate, push, pull, import, export, list, publish, release, test, setup, prepare, restart, stop, store, restore, translate, upgrade, zip, visualize, sync, switch, run, reset, load, dump, checkout, commit, drop, deploy, handle, trigger, render, lint, uninstall, split, parse, fix, refactor, transform, cat, ls, rm, serve, help, show, filter, login, logout, encrypt, decrypt, upload, download, analyse, transpile, compile, minify, copy</span>
**Examples for objects**: <span id="objects">env, venv, submodule, container, database, snippet, model, module, repo, mail, doc, dependency, view, user, vault, file, host, node, log, password, hash, script, requirement, part, component, system, workspace, image, process, state, platform, dir, folder, readme, overview, lang, level, request, response, result, worker, server, proxy, workflow, volume, network, package, field, value, secret, chart, node, edge, function, method, firewall, html, css, image, svg, style, query, native, group, notebook</span>
**Objects can be tools**: <span id="object-tools">odoo, vupress, nodejs, zsh, bash, fish, podman, kind, minikube, helm, nvim, docker, podman, rust, python, tmux, vim, helix, system, git, pass, llm, sql, dotenv, javascript, vue, vite, astro, typescript, turbo, pnpm, eslint, jenkins, k8s, nextcloud, postgres, metabase, ansible, prometheus, grafana, hugo, deno, bun, babel, panda, gulp, grunt, electron, react, express, mongodb, angular, ionic, meteor, webpack, bower, jupyter</span>
<button id="generate-function-names">Generate Function Names</button> <ul id="function-names"> <!-- Random function names will be inserted here by JS --> </ul>
+2 -2
View File
@@ -1,6 +1,6 @@
# Examples
Checkout these implementations of the Taskfile standard:
Checkout implementations of the Taskfile standard:
- [Mint-System/Ansible-Build](https://github.com/Mint-System/Ansible-Build/blob/main/task)
- [Mint-System/Kubernetes-Build](https://github.com/Mint-System/Kubernetes-Build/blob/main/task)
@@ -12,4 +12,4 @@ Checkout these implementations of the Taskfile standard:
- [janikvonrotz/encrypt.casa](https://codeberg.org/janikvonrotz/encrypt.casa/src/main/task)
- [janikvonrotz/python.casa](https://codeberg.org/janikvonrotz/python.casa/src/main/task)
This website is built with a `task` file. Here is the source: [Mint-System/taskfile.build](https://codeberg.org/Mint-System/taskfile.build/src/branch/main/task)
Infact this website was built with a Taskfile. Here is the source: [Mint-System/taskfile.build](https://codeberg.org/Mint-System/taskfile.build/src/branch/main/task)
+3 -3
View File
@@ -2,7 +2,7 @@
[![Docker pulls](https://img.shields.io/docker/pulls/mintsystem/taskfile.build)](https://hub.docker.com/r/mintsystem/taskfile.build/)
The Taskfile Build Docker image runs any project.
The Taskfile container runs every project with a Taskfile.
Source: <https://git.taskfile.build/src/branch/main/image>
@@ -12,7 +12,7 @@ Setup environment variables:
```bash
export GIT_URL="https://git.taskfile.build"
export TASK_COMMANDS="install,build"
export TASK_COMMANDS="install,build-docs"
export CADDY_ROOT="site"
```
@@ -38,4 +38,4 @@ run-container() {
}
```
The entrypoint script of the container will clone the project from `GIT_URL` to `/app/repo`. If the project is already cloned it will pull from origin. Afterwards it runs each `TASK_COMMANDS` in the root of the cloned repository with the Taskfile `./task <command>`. Finally by default the Caddy webserver is started that serves static content from the `CADDY_ROOT` path.
The `entrypoint.sh` script of the container will clone the project from `GIT_URL` to `/app/repo`. If the project is already cloned it will pull from origin. Afterwards it runs each `TASK_COMMANDS` in the root of the cloned repository with the Taskfile `./task <command>`. Finally, if not other command is given a Caddy webserver that serves static content from the `CADDY_ROOT` path is started.
+19 -16
View File
@@ -6,46 +6,45 @@ The standalone Makefile.
---
The Taskfile is a simple bash script and standardized interface for any software project.
The Taskfile is a simple bash script and interface for any software project.
It is to be understood as a software development pattern to standardize the installation, configuration and execution of different software frameworks.
It is to be understood as a software development practice to standardize the installation, configuration and execution of different software frameworks.
- 🛠️ **Configuration**: Install and configure software and tools with ease.
- 🐳 **Docker Build**: Build and publish Docker images for your project.
- 🔑 **KeePass / Pass**: Store and load secrets from KeePass and pass.
- 📄 **.env / dotenv**: Manage multiple dotenv files for your projects.
- 🛠️ **Installation**: Setup and configure software and tools with ease.
- 🔄 **CI Pipelines**: Simplify CI pipelines by making the executed task reproducible.
- 📚 **Library commands**: A collection of reusable commands for common scripting tasks.
## Specification
The specification is a short guide to set up a Taskfile for a Python project.
The specification of the Taskfile is a short guide to setup a Python project.
Create a file `task` in your project.
You start by creating a `task` file in your project.
```bash
touch task
```
Ensure it is executable.
Make it executable.
```bash
chmod +x task
```
First add the bash shebang.
Open it in an editor and add the bash shebang:
```bash
#!/usr/bin/env bash
```
Then append the abort on error setting.
This is the only dependency a Taskfile has.
Next append the abort on error setting:
```bash
set -e
```
Next add the dynamic width help table function.
The Taskfile generates a help table. You simply append new help entries and the `help-table` functions generates a beautiful table.
```bash
help-table() {
@@ -115,7 +114,9 @@ help-table() {
}
```
And the help function that shows and filters the table.
The help table also supports separator.
The default command to show the table is `help`:
```bash
help() {
@@ -135,7 +136,9 @@ help() {
}
```
Implement the actual command functions.
Until here the parts of the Taskfile look more or less the same.
Depending on the software project implement the required commands:
```bash
install() {
@@ -157,7 +160,7 @@ version() {
}
```
Finish the Taskfile with command switch cases.
Finish the Taskfile with a command switch case.
```bash
if [[ "$1" == *","* ]]; then
@@ -191,7 +194,7 @@ else
fi
```
These are the main parts of every Taskfile script.
We have covered the main parts of every Taskfile.
Now see [usage](/usage) on how to use the Taskfile.
+16 -25
View File
@@ -1,6 +1,6 @@
# Library
In your Taskfile import all commands from the taskfile library.
In your Taskfile source commands from the taskfile.build library by adding:
```bash
if [[ -d "$HOME/taskfile.build/bin" ]]; then
@@ -12,16 +12,11 @@ if [[ -d "$HOME/taskfile.build/bin" ]]; then
fi
```
These commands create folder in the directory of the Taskfile and the home directory. Here is an overview of these folders:
- `$PWD/tmp`: Temporary directory for the task commands.
- `$PWD/.prompt`: LLM prompts stored as markdown files.
- `$HOME/.config/taskfile.build`: Default path for storing dotenv files.
- `$HOME/.docker/$CONTAINER_REGISTRY`: Default path for storing container registry credentials.
With these instructions you have access to all commands documented on this page.
## Aliases
Every command in the library has an alias derived from the first letters of each word. For example, `commit-with-llm` can also be invoked as `cwl`.
Every command in the library also set an alias derived from the first letters of each word. For example, `commit-with-llm` can also be invoked as `cwl`.
Aliases are appended to each script and pass through arguments:
@@ -33,15 +28,9 @@ cwl() {
If two commands would map to the same alias, the alias is extended with additional letters from the first conflicting word until it is unique. Aliases that would shadow standard shell commands (e.g. `cd`, `ls`, `cp`) are also extended to avoid collisions.
### Alias Map
Run `list-taskfile-aliases` to list all command aliases.
Run `task list-taskfile-aliases` to list all aliases.
```bash
list-taskfile-aliases
```
```
av='activate-venv'
agf='add-git-folder'
agm='add-git-merge'
@@ -51,7 +40,7 @@ aggf='aggregate-git-folders'
## Task
Configure the task enviroment.
Most commands can be configured by setting enviroment vars.
```bash
OPEN_BROWSER=False # Default: True
@@ -72,12 +61,6 @@ rows+=("clone-taskfile||Clone the taskfile.build repo.")
rows+=("init-project||Setup a taskfile project in the current directory.")
```
### init-config-dir
```bash
rows+=("init-dotenv-dir||Setup task dotenv dir.")
```
### template-dotenv
```bash
@@ -190,7 +173,7 @@ rows+=("run-jupyter-notebook|<path>[env]|Execute notebook with papermill.")
## Environment
Manage `.env` files in the task config folder.
Manage `.env` files in the task dotenv dir.
```bash
TASK_DOTENV_DIR="$HOME/Odoo-Build/config" # Default: "$HOME/.config/taskfile.build"
@@ -262,7 +245,7 @@ rows+=("restore-dotenv-files|<path>|Extract and copy .env files from backup file
## LLM
Commands that integrate the `llm` cli.
Commands that integrate the [llm](https://llm.datasette.io) cli.
<!-- ===LLM=== -->
@@ -286,6 +269,14 @@ The last parameter can be either a direct prompt string or a path to a text file
rows+=("update-changelog-with-llm|[num_lines]|Update CHANGELOG.md with changes from staged git diff using LLM.")
```
<!-- ===LLM=== -->
## Prompt
Create and track `prompt.md` files.
<!-- ===Prompt=== -->
### init-prompt-log
```bash
@@ -340,7 +331,7 @@ rows+=("delete-prompt|[commit][repo-path]|Delete prompt from prompt-log.")
rows+=("convert-prompts-folder-to-prompt-log|[repo-path]|Convert prompts folder to prompt-log branch.")
```
<!-- ===LLM=== -->
<!-- ===Prompt=== -->
## Logging
+1 -53
View File
@@ -1,6 +1,6 @@
# Patterns
The Taskfile from the specification is very basic. Commands can also have parameters and call each other.
The Taskfile from the specification is very simple. Commands can also have parameters or call each other.
The following is a collection of advanced Taskfile patterns.
@@ -143,11 +143,6 @@ start() {
docker compose up -d db
fi
if [[ "$1" =~ 'admin' ]]; then
docker compose up -d admin
echo 'Open http://localhost:8000 url in your browser.'
fi
if [[ "$1" =~ 'odoo' ]]; then
docker compose up -d odoo
echo 'Open http://localhost:8069 url in your browser.'
@@ -247,53 +242,6 @@ convert-vault-file() {
}
```
## Process data
This pattern tries to match the worklow of a jupyter notebook. Create a folder with the data processing scripts:
```
scripts
├── 01_import-mail-data
├── 02_transform-mail-data
└── 03_export-mail-data
```
The following function lists the scripts and asks for the number of scripts to run. Every script until the entered number is concatenated and executed.
```bash
process-data() {
while true; do
local scripts=($(ls scripts))
echo -e "Available scripts:\n"
for index in "${!scripts[@]}"; do
echo "$((index+1)): ${scripts[$index]}"
done
echo ""
read -p "Enter the number of scripts to run (or 'q' to quit): " user_input
if [[ "$user_input" = "q" ]]; then
break
fi
local temp_file=$(mktemp)
for index in "${!scripts[@]}"; do
if (( $user_input >= $((index+1)) )); then
cat "scripts/${scripts[$index]}" >> "$temp_file"
echo >> "$temp_file"
fi
done
clear
echo -e "\nPython Output:\n\n---"
python "$temp_file"
local exit_code=$?
echo -e "---\n"
echo -e "Exit code: $exit_code\n"
rm "$temp_file"
done
}
```
## Check commands
Add the following statements to check if the required commands is available:
-166
View File
@@ -1,169 +1,3 @@
nav,
nav ul {
flex-direction: column;
}
/* Reduce spacing in mobile navigation - more specific selectors */
@media (max-width: 767px) {
main .container nav ul {
gap: 0.125rem !important; /* Further reduce gap between navigation items on mobile */
}
main .container nav ul li {
margin: 0.125rem 0 !important; /* Further reduce vertical spacing of list items */
padding: calc(var(--pico-nav-element-spacing-vertical) * 0.25)
var(--pico-nav-element-spacing-horizontal) !important;
}
}
@media (min-width: 768px) {
nav,
nav ul {
flex-direction: row;
}
}
.content-wrapper {
display: flex;
flex-direction: column;
gap: 2rem;
}
@media (min-width: 1024px) {
.container {
max-width: 1200px;
}
.content-wrapper {
flex-direction: row;
}
.main-content {
flex: 1;
min-width: 0; /* Allows flex item to shrink below content size */
}
.sidebar {
flex: 0 0 250px;
position: sticky;
top: 2rem;
align-self: flex-start;
}
}
#scrollToTop {
position: fixed;
bottom: 1rem;
right: 1rem;
display: none;
z-index: 1000;
}
/* Table of Contents Styles */
.sidebar {
padding: 1rem;
border-radius: var(--pico-border-radius);
}
/* Container for main content and TOC */
.main-content-wrapper {
display: flex;
flex-direction: column;
gap: 2rem;
}
/* Mobile: TOC appears after navigation, before content */
@media (max-width: 767px) {
.main-content-wrapper {
order: 2; /* Place content wrapper after TOC on mobile */
}
.sidebar {
order: 1; /* Place sidebar before content on mobile */
margin: 1rem 0;
}
.main-content {
order: 2;
}
}
/* Desktop: TOC appears as sidebar next to content */
@media (min-width: 768px) {
.main-content-wrapper {
flex-direction: row;
gap: 2rem;
}
.sidebar {
display: block;
flex: 0 0 250px;
position: sticky;
top: 2rem;
align-self: flex-start;
order: 2; /* Show sidebar after content in flex order on desktop */
max-height: calc(100vh - 4rem); /* Account for top spacing */
overflow-y: auto; /* Make sidebar scrollable */
}
.main-content {
flex: 1;
min-width: 0;
order: 1;
}
}
.sidebar .toc-list {
list-style: none !important;
padding-left: 0 !important;
margin: 0 !important;
}
.sidebar .toc-item {
margin-bottom: 0.25rem !important;
}
.sidebar .toc-level-1 {
font-weight: bold !important;
margin-top: 0.5rem !important;
margin-left: 0 !important;
}
.sidebar .toc-level-2 {
margin-left: 0.75rem !important;
font-size: 0.9em !important;
}
.sidebar .toc-level-3 {
margin-left: 1.5rem !important;
font-size: 0.85em !important;
}
.sidebar .toc-item a {
text-decoration: none !important;
display: block !important;
padding: 0.1rem 0 !important;
}
.sidebar .toc-item a:hover {
text-decoration: underline !important;
}
/* Override Pico CSS defaults for sidebar */
.sidebar ul,
.sidebar ol,
.sidebar li {
list-style: none !important;
margin: 0 !important;
padding: 0 !important;
}
/* Invert logo colors in dark mode */
[data-md-color-scheme="slate"] .md-logo img,
[data-md-color-scheme="slate"] .md-nav__button.md-logo img {
filter: invert(1);
}
/* Style the generate function names button */
#generate-function-names {
display: inline-block;
+18 -20
View File
@@ -1,10 +1,8 @@
# Usage
It is recommended to use simple shell alias to run the Taskfile: `alias task='./task'`
It is recommended to use a shell alias to run the Taskfile. Setup this alias: `alias task='./task'`
Start with showing the available commands: `task help`
You should get an output like this:
Remember the `help` function? Open a terminal and type `task help`. You should get an output like this:
```bash
@@ -21,15 +19,17 @@ commands:
```
You can now run a task command with `task install`.
This command produces the help table.
It is also possible to run multiple commands without parameters: `task install,lint`
Choose a task and run it with `task <command> [option]`.
With the command switch case is also possible to run multiple commands: `task install,lint`
## Commands
The specification provides the skeleton to implement new commands. Simply add a bash function and help table entry to extend the Taskfile.
The specification provides a skeleton to implement new commands. Add a bash function and help table entry to extend the Taskfile.
When developing new commands it's worth to have a look at the [patterns](/patterns) page. It gives you an idea of the bash structures that can be used and applied.
When developing new commands it's worth to have a look at the [patterns](/patterns) page. It gives you an idea of what bash structures can be used and applied.
## Library
@@ -41,15 +41,13 @@ Clone the repository into your home folder:
git clone https://git.taskfile.build "$HOME/taskfile.build"
```
See [library](/library) for more details on how to import and use the available commands.
And then see [library](/library) on how to import and use these commands.
### Global default
Instead of setting up a Taskfile for every ptoject, you can also setup one file and add a fallback to a Taskfile in the `$PWD`.
Instead of setting up a Taskfile for every project, you can also setup one Taskfile and set Taskfile in `$PWD` as fallback.
First create symlink from your shell bin folder to the Taskfile template. It is recommended to use the `$HOME/.local/bin/` folder.
Create the symlink:
To do so create symlink from the bin folder of your shell to the Taskfile template:
```bash
ln -sf "$HOME/taskfile.build/task.template" "$HOME/.local/bin/task"
@@ -69,13 +67,13 @@ task() {
}
```
Remove the `alias task='./task'` alias from your profile. It is no longer required.
Remove the `alias task='./task'` alias from your profile, it is no longer required.
### Completion
With the output of `task help` the task commands can be auto-completed.
With the output of `task help` commands can be auto-completed.
To set up shell completion, setup the global default and proceed with these instructions:
To get shell completion setup the global default and proceed with these instructions:
For bash:
@@ -114,13 +112,13 @@ See [taskfile.build/image](/image) for details.
## Integration
The Taskfile is intended to be integrated into every shell interaction. Whenever an application uses a domain specific language (DSL) ensure that the DSL-implementation calls a Taskfile command. Most often you will see DSLs in build pipelines such as the following.
Whenever an application uses a domain specific language (DSL) ensure that the DSL-implementation calls a Taskfile command.
### GitHub Actions
Running Taskfile commands in GitHub Actions is highly recommended. This way you can run the same CI/CD procedures in the GitHub runner as you do on your localhost.
Running Taskfile commands in GitHub Actions is highly recommended. This way you can run the same CI/CD procedures in the GitHub runner as you would on your localhost.
The GitHub Actions config is simple: `.github/workflows/build.yml `
Here is an example for `.github/workflows/build.yml`:
```yml
on:
@@ -150,7 +148,7 @@ jobs:
### Jenkins
Run Taskfile commands in Jenkins: `Jenkinsfile`
Run Taskfile commands in a `Jenkinsfile`:
```groovy
pipeline {
-41
View File
@@ -1,41 +0,0 @@
# [Taskfile Build](https://taskfile.build/image)
[![Docker pulls](https://img.shields.io/docker/pulls/mintsystem/taskfile.build)](https://hub.docker.com/r/mintsystem/taskfile.build/)
The Taskfile Build Docker image runs any project.
Source: <https://git.taskfile.build/src/branch/main/image>
## Usage
Setup environment variables:
```bash
export GIT_URL="https://git.taskfile.build"
export TASK_COMMANDS="install,build"
export CADDY_ROOT="_site"
```
Run the Taskfile Build image:
```bash
run-container() {
container_name="taskfile-build"
image_tag="mintsystem/taskfile.build:latest"
docker pull "$image_tag"
docker rm -f "$container_name"
docker volume rm "$container_name"
echo "Open http://localhost:8080 in your browser"
docker run -p 8080:80 -d \
--name "$container_name" \
-e GIT_URL="https://git.taskfile.build" \
-e TASK_COMMANDS="install,build-11ty" \
-e CADDY_ROOT="_site" \
-v "$container_name":/app \
"$image_tag"
}
```
The entrypoint script of the container will clone the project from `GIT_URL` to `/app/repo`. If the project is already cloned it will pull from origin. Afterwards it runs each `TASK_COMMANDS` in the root of the cloned repository with the Taskfile `./task <command>`. Finally by default the Caddy webserver is started that serves static content from the `CADDY_ROOT` path.