docs: migrate website to vitepress (#2359)
Co-authored-by: Pete Davison <pd93.uk@outlook.com> Co-authored-by: Andrey Nering <andreynering@users.noreply.github.com>
@@ -8,6 +8,6 @@ charset = utf-8
|
|||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
[*.{md,mdx,yml,yaml,json,toml,htm,html,js,ts,css,svg,sh,bash,fish}]
|
[*.{md,mdx,yml,yaml,json,toml,htm,html,js,ts,vue,css,svg,sh,bash,fish}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
33
.github/workflows/lint.yml
vendored
@@ -40,35 +40,4 @@ jobs:
|
|||||||
run: python -m pip install 'check-jsonschema==0.27.3'
|
run: python -m pip install 'check-jsonschema==0.27.3'
|
||||||
|
|
||||||
- name: check-jsonschema (metaschema)
|
- name: check-jsonschema (metaschema)
|
||||||
run: check-jsonschema --check-metaschema website/static/schema.json
|
run: check-jsonschema --check-metaschema website/src/public/schema.json
|
||||||
check_doc:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Get changed files in the docs folder
|
|
||||||
id: changed-files-specific
|
|
||||||
uses: tj-actions/changed-files@v46
|
|
||||||
with:
|
|
||||||
files: website/versioned_docs/**
|
|
||||||
|
|
||||||
- uses: actions/github-script@v7
|
|
||||||
if: steps.changed-files-specific.outputs.any_changed == 'true'
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
core.setFailed('website/versioned_docs has changed. Instead you need to update the docs in the website/docs folder.')
|
|
||||||
check_schema:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Get changed files in the docs folder
|
|
||||||
id: changed-files-specific
|
|
||||||
uses: tj-actions/changed-files@v46
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
website/static/schema.json
|
|
||||||
website/static/schema-taskrc.json
|
|
||||||
- uses: actions/github-script@v7
|
|
||||||
if: steps.changed-files-specific.outputs.any_changed == 'true'
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
core.setFailed('schema.json or schema-taskrc.json has changed. Instead you need to update next-schema.json or next-schema-taskrc.json.')
|
|
||||||
|
17
.github/workflows/release.yml
vendored
@@ -19,6 +19,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: 1.24.x
|
go-version: 1.24.x
|
||||||
|
|
||||||
|
- name: Install Task
|
||||||
|
uses: arduino/setup-task@v2
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
|
||||||
|
- name: Install Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '22.x'
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v6
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
@@ -28,3 +40,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{secrets.GH_PAT}}
|
GITHUB_TOKEN: ${{secrets.GH_PAT}}
|
||||||
GORELEASER_KEY: ${{secrets.GORELEASER_KEY}}
|
GORELEASER_KEY: ${{secrets.GORELEASER_KEY}}
|
||||||
|
|
||||||
|
- name: Deploy Website
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
task website:deploy:prod
|
||||||
|
@@ -9,21 +9,14 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Masterminds/semver/v3"
|
"github.com/Masterminds/semver/v3"
|
||||||
"github.com/otiai10/copy"
|
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
|
|
||||||
"github.com/go-task/task/v3/errors"
|
"github.com/go-task/task/v3/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
changelogSource = "CHANGELOG.md"
|
changelogSource = "CHANGELOG.md"
|
||||||
changelogTarget = "website/docs/changelog.mdx"
|
changelogTarget = "website/docs/changelog.md"
|
||||||
docsSource = "website/docs"
|
|
||||||
docsTarget = "website/versioned_docs/version-latest"
|
|
||||||
schemaSource = "website/static/next-schema.json"
|
|
||||||
schemaTarget = "website/static/schema.json"
|
|
||||||
schemaTaskrcSource = "website/static/next-schema-taskrc.json"
|
|
||||||
schemaTaskrcTarget = "website/static/schema-taskrc.json"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -83,14 +76,6 @@ func release() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := docs(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := schema(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,23 +158,3 @@ func setJSONVersion(fileName string, version *semver.Version) error {
|
|||||||
// Write the JSON file
|
// Write the JSON file
|
||||||
return os.WriteFile(fileName, []byte(new), 0o644)
|
return os.WriteFile(fileName, []byte(new), 0o644)
|
||||||
}
|
}
|
||||||
|
|
||||||
func docs() error {
|
|
||||||
if err := os.RemoveAll(docsTarget); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := copy.Copy(docsSource, docsTarget); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func schema() error {
|
|
||||||
if err := copy.Copy(schemaSource, schemaTarget); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := copy.Copy(schemaTaskrcSource, schemaTaskrcTarget); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
18
website/.gitignore
vendored
@@ -1,21 +1,9 @@
|
|||||||
# Dependencies
|
# Dependencies
|
||||||
/node_modules
|
/node_modules
|
||||||
|
|
||||||
# Production
|
|
||||||
/build
|
|
||||||
|
|
||||||
# Generated files
|
|
||||||
.docusaurus
|
|
||||||
.cache-loader
|
|
||||||
i18n
|
|
||||||
|
|
||||||
# Misc
|
|
||||||
.DS_Store
|
|
||||||
.env.local
|
|
||||||
.env.development.local
|
|
||||||
.env.test.local
|
|
||||||
.env.production.local
|
|
||||||
|
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
.vitepress/cache
|
||||||
|
.vitepress/dist
|
||||||
|
.task/
|
||||||
|
1
website/.prettierignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pnpm-lock.yaml
|
5
website/.vitepress/components.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
declare module '*.vue' {
|
||||||
|
import type { DefineComponent } from 'vue';
|
||||||
|
const component: DefineComponent<{}, {}, any>;
|
||||||
|
export default component;
|
||||||
|
}
|
97
website/.vitepress/components/AuthorCard.vue
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
<template>
|
||||||
|
<div class="author-compact" v-if="author">
|
||||||
|
<img :src="author.avatar" :alt="author.name" class="author-avatar" />
|
||||||
|
<div class="author-info">
|
||||||
|
<div class="author-name-line">
|
||||||
|
<span class="author-name">{{ author.name }}</span>
|
||||||
|
|
||||||
|
<div class="author-socials">
|
||||||
|
<a
|
||||||
|
v-for="{ link, icon } in author.links"
|
||||||
|
:key="link"
|
||||||
|
:href="link"
|
||||||
|
target="_blank"
|
||||||
|
class="social-link"
|
||||||
|
>
|
||||||
|
<span :class="`vpi-social-${icon}`"></span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span class="author-bio">{{ author.title }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { team } from '../team.ts';
|
||||||
|
import { computed } from 'vue';
|
||||||
|
const props = defineProps({
|
||||||
|
author: String
|
||||||
|
});
|
||||||
|
|
||||||
|
const author = computed(() => {
|
||||||
|
return team.find((m) => m.slug === props.author) || null;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.author-compact {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
margin: 1.5rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.author-avatar {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
border-radius: 50%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.author-info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.1rem;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.author-name-line {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.author-name {
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--vp-c-text-1);
|
||||||
|
font-size: 0.95rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.author-bio {
|
||||||
|
color: var(--vp-c-text-2);
|
||||||
|
font-size: 0.85rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.author-socials {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-link {
|
||||||
|
color: var(--vp-c-text-2);
|
||||||
|
transition: color 0.2s;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-link:hover {
|
||||||
|
color: var(--vp-c-brand-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.author-compact {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
182
website/.vitepress/components/BlogPost.vue
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
<template>
|
||||||
|
<article class="blog-post">
|
||||||
|
<div class="post-header">
|
||||||
|
<h3 class="post-title">
|
||||||
|
<a :href="url">{{ title }}</a>
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div class="post-meta">
|
||||||
|
<time :datetime="date" class="post-date">
|
||||||
|
{{ formatDate(date) }}
|
||||||
|
</time>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="post-content">
|
||||||
|
<div class="post-image" v-if="image">
|
||||||
|
<img :src="image" :alt="title" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="post-text">
|
||||||
|
<AuthorCard :author="author" />
|
||||||
|
|
||||||
|
<p class="post-description">{{ description }}</p>
|
||||||
|
|
||||||
|
<div class="post-footer">
|
||||||
|
<div class="post-tags" v-if="tags?.length">
|
||||||
|
<strong>Tags:</strong>
|
||||||
|
<code v-for="tag in tags" :key="tag" class="post-tag">{{
|
||||||
|
tag
|
||||||
|
}}</code>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a :href="url" class="read-more"> Read more → </a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import AuthorCard from './AuthorCard.vue';
|
||||||
|
const props = defineProps({
|
||||||
|
title: String,
|
||||||
|
url: String,
|
||||||
|
date: String,
|
||||||
|
author: String,
|
||||||
|
description: String,
|
||||||
|
tags: Array,
|
||||||
|
image: String
|
||||||
|
});
|
||||||
|
|
||||||
|
function formatDate(date) {
|
||||||
|
return new Date(date).toLocaleDateString('en-US', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
day: 'numeric'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.blog-post {
|
||||||
|
border-bottom: 1px solid var(--vp-c-divider);
|
||||||
|
padding-bottom: 2rem;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blog-post:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-title {
|
||||||
|
margin: 0 0 0.5rem 0;
|
||||||
|
font-size: 1.8rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-title a {
|
||||||
|
transition: color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-title a:hover {
|
||||||
|
color: var(--vp-c-brand-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-date {
|
||||||
|
color: var(--vp-c-text-2);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-content {
|
||||||
|
display: flex;
|
||||||
|
gap: 2rem;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-image {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-image img {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
border-radius: 8px;
|
||||||
|
object-fit: cover;
|
||||||
|
aspect-ratio: 16 / 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-text {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-description {
|
||||||
|
color: var(--vp-c-text-2);
|
||||||
|
line-height: 1.6;
|
||||||
|
margin: 1.5rem 0;
|
||||||
|
font-size: 1.05rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-end;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-tags {
|
||||||
|
color: var(--vp-c-text-2);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-tag {
|
||||||
|
background: var(--vp-c-default-soft);
|
||||||
|
color: var(--vp-c-text-2);
|
||||||
|
padding: 0.25rem 0.5rem;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
font-family: var(--vp-font-family-mono);
|
||||||
|
}
|
||||||
|
|
||||||
|
.read-more {
|
||||||
|
color: var(--vp-c-brand-1);
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: 500;
|
||||||
|
transition: all 0.2s;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
border: 1px solid var(--vp-c-brand-1);
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.read-more:hover {
|
||||||
|
background: var(--vp-c-brand-1);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.post-content {
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-image {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-title {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-footer {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
20
website/.vitepress/components/HomePage.vue
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { VPHomeSponsors } from 'vitepress/theme';
|
||||||
|
import { sponsors } from '../sponsors';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="content">
|
||||||
|
<div class="content-container">
|
||||||
|
<main class="main">
|
||||||
|
<VPHomeSponsors
|
||||||
|
v-if="sponsors"
|
||||||
|
message="Task is free and open source, made possible by wonderful sponsors."
|
||||||
|
:data="sponsors"
|
||||||
|
/>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped></style>
|
245
website/.vitepress/components/VPTeamMembersItem.vue
Normal file
@@ -0,0 +1,245 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { DefaultTheme } from 'vitepress/theme';
|
||||||
|
import VPLink from 'vitepress/dist/client/theme-default/components/VPLink.vue';
|
||||||
|
import VPSocialLinks from 'vitepress/dist/client/theme-default/components/VPSocialLinks.vue';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
size?: 'small' | 'medium';
|
||||||
|
member: TeamMember;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TeamMember extends DefaultTheme.TeamMember {
|
||||||
|
icon?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
withDefaults(defineProps<Props>(), {
|
||||||
|
size: 'medium'
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<article class="VPTeamMembersItem" :class="[size]">
|
||||||
|
<div class="profile">
|
||||||
|
<figure class="avatar">
|
||||||
|
<img class="avatar-img" :src="member.avatar" :alt="member.name" />
|
||||||
|
</figure>
|
||||||
|
<div class="data">
|
||||||
|
<h1 class="name">
|
||||||
|
<img :src="member.icon" alt="profile-icon" />
|
||||||
|
{{ member.name }}
|
||||||
|
</h1>
|
||||||
|
<p v-if="member.title || member.org" class="affiliation">
|
||||||
|
<span v-if="member.title" class="title">
|
||||||
|
{{ member.title }}
|
||||||
|
</span>
|
||||||
|
<span v-if="member.title && member.org" class="at"> @ </span>
|
||||||
|
<VPLink
|
||||||
|
v-if="member.org"
|
||||||
|
class="org"
|
||||||
|
:class="{ link: member.orgLink }"
|
||||||
|
:href="member.orgLink"
|
||||||
|
no-icon
|
||||||
|
>
|
||||||
|
{{ member.org }}
|
||||||
|
</VPLink>
|
||||||
|
</p>
|
||||||
|
<p v-if="member.desc" class="desc" v-html="member.desc" />
|
||||||
|
<div v-if="member.links" class="links">
|
||||||
|
<VPSocialLinks :links="member.links" :me="false" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="member.sponsor" class="sp">
|
||||||
|
<VPLink class="sp-link" :href="member.sponsor" no-icon>
|
||||||
|
<span class="vpi-heart sp-icon" /> {{ member.actionText || 'Sponsor' }}
|
||||||
|
</VPLink>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.VPTeamMembersItem {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2px;
|
||||||
|
border-radius: 12px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.small .profile {
|
||||||
|
padding: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.small .data {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.small .avatar {
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.small .name {
|
||||||
|
line-height: 24px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.small .affiliation {
|
||||||
|
padding-top: 4px;
|
||||||
|
line-height: 20px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.small .desc {
|
||||||
|
padding-top: 12px;
|
||||||
|
line-height: 20px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.small .links {
|
||||||
|
margin: 0 -16px -20px;
|
||||||
|
padding: 10px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.medium .profile {
|
||||||
|
padding: 48px 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.medium .data {
|
||||||
|
padding-top: 24px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.medium .avatar {
|
||||||
|
width: 96px;
|
||||||
|
height: 96px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.medium .name {
|
||||||
|
letter-spacing: 0.15px;
|
||||||
|
line-height: 28px;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.medium .affiliation {
|
||||||
|
padding-top: 4px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.medium .desc {
|
||||||
|
padding-top: 16px;
|
||||||
|
max-width: 288px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem.medium .links {
|
||||||
|
margin: 0 -16px -12px;
|
||||||
|
padding: 16px 12px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem .profile .name {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.VPTeamMembersItem .profile .name img {
|
||||||
|
display: inline-block;
|
||||||
|
height: 22px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile {
|
||||||
|
flex-grow: 1;
|
||||||
|
background-color: var(--vp-c-bg-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
.data {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
position: relative;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin: 0 auto;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: var(--vp-shadow-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-img {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
border-radius: 50%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.name {
|
||||||
|
margin: 0;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.affiliation {
|
||||||
|
margin: 0;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--vp-c-text-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.org.link {
|
||||||
|
color: var(--vp-c-text-2);
|
||||||
|
transition: color 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.org.link:hover {
|
||||||
|
color: var(--vp-c-brand-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc :deep(a) {
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--vp-c-brand-1);
|
||||||
|
text-decoration-style: dotted;
|
||||||
|
transition: color 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.links {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
height: 56px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-link {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
padding: 16px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--vp-c-sponsor);
|
||||||
|
background-color: var(--vp-c-bg-soft);
|
||||||
|
transition:
|
||||||
|
color 0.25s,
|
||||||
|
background-color 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp .sp-link.link:hover,
|
||||||
|
.sp .sp-link.link:focus {
|
||||||
|
outline: none;
|
||||||
|
color: var(--vp-c-white);
|
||||||
|
background-color: var(--vp-c-sponsor);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-icon {
|
||||||
|
margin-right: 8px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
7
website/.vitepress/components/Version.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { VPBadge } from 'vitepress/theme';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VPBadge type="info"> <slot />+ </VPBadge>
|
||||||
|
</template>
|
298
website/.vitepress/config.ts
Normal file
@@ -0,0 +1,298 @@
|
|||||||
|
import { defineConfig } from 'vitepress';
|
||||||
|
import githubLinksPlugin from './plugins/github-links';
|
||||||
|
import { readFileSync } from 'fs';
|
||||||
|
import { resolve } from 'path';
|
||||||
|
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs';
|
||||||
|
import {
|
||||||
|
groupIconMdPlugin,
|
||||||
|
groupIconVitePlugin
|
||||||
|
} from 'vitepress-plugin-group-icons';
|
||||||
|
import { team } from './team.ts';
|
||||||
|
import { ogUrl, taskDescription, taskName } from './meta.ts';
|
||||||
|
import { fileURLToPath, URL } from 'node:url';
|
||||||
|
|
||||||
|
const version = readFileSync(
|
||||||
|
resolve(__dirname, '../../internal/version/version.txt'),
|
||||||
|
'utf8'
|
||||||
|
).trim();
|
||||||
|
|
||||||
|
const urlVersion =
|
||||||
|
process.env.NODE_ENV === 'development'
|
||||||
|
? {
|
||||||
|
current: 'https://taskfile.dev/',
|
||||||
|
next: 'http://localhost:3002/'
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
current: 'https://taskfile.dev/',
|
||||||
|
next: 'https://next.taskfile.dev/'
|
||||||
|
};
|
||||||
|
|
||||||
|
// https://vitepress.dev/reference/site-config
|
||||||
|
export default defineConfig({
|
||||||
|
title: taskName,
|
||||||
|
description: taskDescription,
|
||||||
|
lang: 'en-US',
|
||||||
|
head: [
|
||||||
|
[
|
||||||
|
'link',
|
||||||
|
{
|
||||||
|
rel: 'icon',
|
||||||
|
type: 'image/x-icon',
|
||||||
|
href: '/img/favicon.icon',
|
||||||
|
sizes: '48x48'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'link',
|
||||||
|
{
|
||||||
|
rel: 'icon',
|
||||||
|
sizes: 'any',
|
||||||
|
type: 'image/svg+xml',
|
||||||
|
href: '/img/logo.svg'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'link',
|
||||||
|
{
|
||||||
|
rel: 'canonical',
|
||||||
|
href: 'https://taskfile.dev/'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'meta',
|
||||||
|
{ name: 'author', content: `${team.map((c) => c.name).join(', ')}` }
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'meta',
|
||||||
|
{
|
||||||
|
name: 'keywords',
|
||||||
|
content:
|
||||||
|
'task runner, build tool, taskfile, yaml build tool, go task runner, make alternative, cross-platform build tool, makefile alternative, automation tool, ci cd pipeline, developer productivity, build automation, command line tool, go binary, yaml configuration'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
['meta', { property: 'og:title', content: taskName }],
|
||||||
|
['meta', { property: 'og:description', content: taskDescription }],
|
||||||
|
['meta', { property: 'og:type', content: 'website' }],
|
||||||
|
['meta', { property: 'og:site_name', content: taskName }],
|
||||||
|
['meta', { property: 'og:url', content: ogUrl }],
|
||||||
|
['meta', { property: 'twitter:card', content: 'summary_large_image' }],
|
||||||
|
['meta', { property: 'twitter:title', content: taskName }],
|
||||||
|
['meta', { property: 'twitter:description', content: taskDescription }]
|
||||||
|
],
|
||||||
|
srcDir: 'src',
|
||||||
|
cleanUrls: true,
|
||||||
|
markdown: {
|
||||||
|
config: (md) => {
|
||||||
|
md.use(githubLinksPlugin, {
|
||||||
|
baseUrl: 'https://github.com',
|
||||||
|
repo: 'go-task/task'
|
||||||
|
});
|
||||||
|
md.use(tabsMarkdownPlugin);
|
||||||
|
md.use(groupIconMdPlugin);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
vite: {
|
||||||
|
plugins: [groupIconVitePlugin()],
|
||||||
|
resolve: {
|
||||||
|
alias: [
|
||||||
|
{
|
||||||
|
find: /^.*\/VPTeamMembersItem\.vue$/,
|
||||||
|
replacement: fileURLToPath(
|
||||||
|
new URL('./components/VPTeamMembersItem.vue', import.meta.url)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
themeConfig: {
|
||||||
|
logo: '/img/logo.svg',
|
||||||
|
carbonAds: {
|
||||||
|
code: 'CESI65QJ',
|
||||||
|
placement: 'taskfiledev'
|
||||||
|
},
|
||||||
|
search: {
|
||||||
|
provider: 'local'
|
||||||
|
// options: {
|
||||||
|
// appId: '...',
|
||||||
|
// apiKey: '...',
|
||||||
|
// indexName: '...'
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
nav: [
|
||||||
|
{ text: 'Home', link: '/' },
|
||||||
|
{
|
||||||
|
text: 'Docs',
|
||||||
|
link: '/docs/guide',
|
||||||
|
activeMatch: '^/docs'
|
||||||
|
},
|
||||||
|
{ text: 'Blog', link: '/blog', activeMatch: '^/blog' },
|
||||||
|
{ text: 'Donate', link: '/donate' },
|
||||||
|
{ text: 'Team', link: '/team' },
|
||||||
|
{
|
||||||
|
text: process.env.NODE_ENV === 'development' ? 'Next' : `v${version}`,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: `v${version}`,
|
||||||
|
link: urlVersion.current
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Next',
|
||||||
|
link: urlVersion.next
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
sidebar: {
|
||||||
|
'/blog/': [
|
||||||
|
{
|
||||||
|
text: '2024',
|
||||||
|
collapsed: false,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: 'Any Variables',
|
||||||
|
link: '/blog/any-variables'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '2023',
|
||||||
|
collapsed: false,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: 'Introducing Experiments',
|
||||||
|
link: '/blog/task-in-2023'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'/': [
|
||||||
|
{
|
||||||
|
text: 'Installation',
|
||||||
|
link: '/docs/installation'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Getting Started',
|
||||||
|
link: '/docs/getting-started'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Guide',
|
||||||
|
link: '/docs/guide'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Reference',
|
||||||
|
collapsed: true,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: 'CLI',
|
||||||
|
link: '/docs/reference/cli'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Schema',
|
||||||
|
link: '/docs/reference/schema'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Templating',
|
||||||
|
link: '/docs/reference/templating'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Package API',
|
||||||
|
link: '/docs/reference/package'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Experiments',
|
||||||
|
collapsed: true,
|
||||||
|
link: '/docs/experiments/',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: 'Env Precedence (#1038)',
|
||||||
|
link: '/docs/experiments/env-precedence'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Gentle Force (#1200)',
|
||||||
|
link: '/docs/experiments/gentle-force'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Remote Taskfiles (#1317)',
|
||||||
|
link: '/docs/experiments/remote-taskfiles'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Deprecations',
|
||||||
|
collapsed: true,
|
||||||
|
link: '/docs/deprecations/',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: 'Completion Scripts',
|
||||||
|
link: '/docs/deprecations/completion-scripts'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Template Functions',
|
||||||
|
link: '/docs/deprecations/template-functions'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Version 2 Schema (#1197)',
|
||||||
|
link: '/docs/deprecations/version-2-schema'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Taskfile Versions',
|
||||||
|
link: '/docs/taskfile-versions'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Integrations',
|
||||||
|
link: '/docs/integrations'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Community',
|
||||||
|
link: '/docs/community'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Style Guide',
|
||||||
|
link: '/docs/styleguide'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Contributing',
|
||||||
|
link: '/docs/contributing'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Releasing',
|
||||||
|
link: '/docs/releasing'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Changelog',
|
||||||
|
link: '/docs/changelog'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'FAQ',
|
||||||
|
link: '/docs/faq'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// Hacky to disable sidebar for these pages
|
||||||
|
'/donate': [],
|
||||||
|
'/team': []
|
||||||
|
},
|
||||||
|
|
||||||
|
socialLinks: [
|
||||||
|
{ icon: 'github', link: 'https://github.com/go-task/task' },
|
||||||
|
{ icon: 'discord', link: 'https://discord.gg/6TY36E39UK' },
|
||||||
|
{ icon: 'x', link: 'https://twitter.com/taskfiledev' },
|
||||||
|
{ icon: 'bluesky', link: 'https://bsky.app/profile/taskfile.dev' },
|
||||||
|
{ icon: 'mastodon', link: 'https://fosstodon.org/@task' }
|
||||||
|
],
|
||||||
|
|
||||||
|
footer: {
|
||||||
|
message:
|
||||||
|
'Built with <a target="_blank" href="https://www.netlify.com">Netlify</a>'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
5
website/.vitepress/meta.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export const taskName = 'Task';
|
||||||
|
export const taskDescription =
|
||||||
|
'A fast, cross-platform build tool inspired by Make, designed for modern workflows.';
|
||||||
|
|
||||||
|
export const ogUrl = 'https://taskfile.dev/';
|
63
website/.vitepress/plugins/github-links.ts
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import type MarkdownIt from 'markdown-it';
|
||||||
|
|
||||||
|
interface PluginOptions {
|
||||||
|
repo: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
function githubLinksPlugin(
|
||||||
|
md: MarkdownIt,
|
||||||
|
options: PluginOptions = {} as PluginOptions
|
||||||
|
): void {
|
||||||
|
const baseUrl = 'https://github.com';
|
||||||
|
const { repo } = options;
|
||||||
|
|
||||||
|
md.core.ruler.after('inline', 'github-links', (state): void => {
|
||||||
|
const tokens = state.tokens;
|
||||||
|
|
||||||
|
for (let i = 0; i < tokens.length; i++) {
|
||||||
|
if (tokens[i].type === 'inline' && tokens[i].children) {
|
||||||
|
const inlineTokens = tokens[i].children!;
|
||||||
|
|
||||||
|
for (let j = 0; j < inlineTokens.length; j++) {
|
||||||
|
if (inlineTokens[j].type === 'text') {
|
||||||
|
let text: string = inlineTokens[j].content!;
|
||||||
|
|
||||||
|
const protectedRefs: string[] = [];
|
||||||
|
let protectIndex: number = 0;
|
||||||
|
|
||||||
|
text = text.replace(
|
||||||
|
/[\w.-]+\/[\w.-]+#(\d+)/g,
|
||||||
|
(match: string): string => {
|
||||||
|
const placeholder: string = `__PROTECTED_${protectIndex}__`;
|
||||||
|
protectedRefs[protectIndex] = match;
|
||||||
|
protectIndex++;
|
||||||
|
return placeholder;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
text = text.replace(
|
||||||
|
/#(\d+)/g,
|
||||||
|
`<a href="${baseUrl}/${repo}/issues/$1" target="_blank" class="github-pr-link">#$1</a>`
|
||||||
|
);
|
||||||
|
|
||||||
|
text = text.replace(
|
||||||
|
/@([a-zA-Z0-9_-]+)(?![\w@.])/g,
|
||||||
|
`<a href="${baseUrl}/$1" target="_blank" class="github-user-mention">@$1</a>`
|
||||||
|
);
|
||||||
|
|
||||||
|
protectedRefs.forEach((ref: string, index: number): void => {
|
||||||
|
text = text.replace(`__PROTECTED_${index}__`, ref);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (text !== inlineTokens[j].content) {
|
||||||
|
inlineTokens[j].content = text;
|
||||||
|
inlineTokens[j].type = 'html_inline';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export default githubLinksPlugin;
|
13
website/.vitepress/sponsors.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
export const sponsors = [
|
||||||
|
{
|
||||||
|
tier: 'Gold Sponsors',
|
||||||
|
size: 'big',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
name: 'devowl',
|
||||||
|
url: 'https://devowl.io/',
|
||||||
|
img: '/img/devowl.io.svg'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
45
website/.vitepress/team.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
export const team = [
|
||||||
|
{
|
||||||
|
slug: 'andreynering',
|
||||||
|
avatar: 'https://www.github.com/andreynering.png',
|
||||||
|
name: 'Andrey Nering',
|
||||||
|
icon: '/img/flag-brazil.svg',
|
||||||
|
title: 'Creator & Maintainer',
|
||||||
|
sponsor: 'https://github.com/sponsors/andreynering',
|
||||||
|
links: [
|
||||||
|
{ icon: 'github', link: 'https://github.com/andreynering' },
|
||||||
|
{ icon: 'discord', link: 'https://discord.com/users/310141681926275082' },
|
||||||
|
{ icon: 'x', link: 'https://x.com/andreynering' },
|
||||||
|
{
|
||||||
|
icon: 'bluesky',
|
||||||
|
link: 'https://bsky.app/profile/andreynering.bsky.social'
|
||||||
|
},
|
||||||
|
{ icon: 'mastodon', link: 'https://mastodon.social/@andreynering' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
slug: 'pd93',
|
||||||
|
avatar: 'https://www.github.com/pd93.png',
|
||||||
|
name: 'Pete Davison',
|
||||||
|
icon: '/img/flag-wales.svg',
|
||||||
|
title: 'Maintainer',
|
||||||
|
sponsor: 'https://github.com/sponsors/pd93',
|
||||||
|
links: [
|
||||||
|
{ icon: 'github', link: 'https://github.com/pd93' },
|
||||||
|
{ icon: 'bluesky', link: 'https://bsky.app/profile/pd93.uk' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
slug: 'vmaerten',
|
||||||
|
avatar: 'https://www.github.com/vmaerten.png',
|
||||||
|
name: 'Valentin Maerten',
|
||||||
|
icon: '/img/flag-france.svg',
|
||||||
|
title: 'Maintainer',
|
||||||
|
sponsor: 'https://github.com/sponsors/vmaerten',
|
||||||
|
links: [
|
||||||
|
{ icon: 'github', link: 'https://github.com/vmaerten' },
|
||||||
|
{ icon: 'x', link: 'https://x.com/v_maerten' },
|
||||||
|
{ icon: 'bluesky', link: 'https://bsky.app/profile/vmaerten.bsky.social' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
142
website/.vitepress/theme/custom.css
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
:root {
|
||||||
|
--ifm-color-primary: #43aba2;
|
||||||
|
--vp-home-hero-name-color: var(--ifm-color-primary);
|
||||||
|
--vp-c-brand-1: var(--ifm-color-primary);
|
||||||
|
--vp-c-brand-2: var(--ifm-color-primary);
|
||||||
|
--vp-c-brand-3: var(--ifm-color-primary);
|
||||||
|
|
||||||
|
--vp-icon-info: #3b82f6;
|
||||||
|
--vp-icon-tip: #10b981;
|
||||||
|
--vp-icon-warning: #f59e0b;
|
||||||
|
--vp-icon-danger: #ef4444;
|
||||||
|
--vp-icon-details: #6b7280;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark {
|
||||||
|
--vp-icon-info: #93c5fd;
|
||||||
|
--vp-icon-tip: #34d399;
|
||||||
|
--vp-icon-warning: #fbbf24;
|
||||||
|
--vp-icon-danger: #f87171;
|
||||||
|
--vp-icon-details: #9ca3af;
|
||||||
|
}
|
||||||
|
|
||||||
|
img[src*='shields.io'] {
|
||||||
|
display: inline;
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
}
|
||||||
|
img[src*='custom-icon-badges.demolab.com'] {
|
||||||
|
display: inline;
|
||||||
|
height: 1em;
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
.github-user-mention {
|
||||||
|
font-weight: 700 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vp-doc .blog-post:first-of-type {
|
||||||
|
margin-top: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blog-post {
|
||||||
|
animation: fadeInUp 0.6s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInUp {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(20px);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.blog-post:nth-of-type(1) {
|
||||||
|
animation-delay: 0.1s;
|
||||||
|
}
|
||||||
|
.blog-post:nth-of-type(2) {
|
||||||
|
animation-delay: 0.2s;
|
||||||
|
}
|
||||||
|
.blog-post:nth-of-type(3) {
|
||||||
|
animation-delay: 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-block .custom-block-title::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
margin-right: 8px;
|
||||||
|
vertical-align: middle;
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
-webkit-mask-repeat: no-repeat;
|
||||||
|
-webkit-mask-position: center;
|
||||||
|
-webkit-mask-size: contain;
|
||||||
|
mask-repeat: no-repeat;
|
||||||
|
mask-position: center;
|
||||||
|
mask-size: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-block.info .custom-block-title::before {
|
||||||
|
background-color: var(--vp-icon-info);
|
||||||
|
-webkit-mask-image: url('./icons/info.svg');
|
||||||
|
mask-image: url('./icons/info.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-block.tip .custom-block-title::before {
|
||||||
|
background-color: var(--vp-icon-tip);
|
||||||
|
-webkit-mask-image: url('./icons/tip.svg');
|
||||||
|
mask-image: url('./icons/tip.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-block.warning .custom-block-title::before {
|
||||||
|
background-color: var(--vp-icon-warning);
|
||||||
|
-webkit-mask-image: url('./icons/warning.svg');
|
||||||
|
mask-image: url('./icons/warning.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-block.danger .custom-block-title::before {
|
||||||
|
background-color: var(--vp-icon-danger);
|
||||||
|
-webkit-mask-image: url('./icons/danger.svg');
|
||||||
|
mask-image: url('./icons/danger.svg');
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-block.details[open] summary::before {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-block .custom-block-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
@supports not (mask-image: none) {
|
||||||
|
.custom-block .custom-block-title::before,
|
||||||
|
.custom-block.details summary::before {
|
||||||
|
font-size: 18px;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
background: none !important;
|
||||||
|
-webkit-mask: none !important;
|
||||||
|
mask: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-block.info .custom-block-title::before {
|
||||||
|
content: 'ℹ️';
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-block.tip .custom-block-title::before {
|
||||||
|
content: '💡';
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-block.warning .custom-block-title::before {
|
||||||
|
content: '⚠️';
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-block.danger .custom-block-title::before {
|
||||||
|
content: '🔥';
|
||||||
|
}
|
||||||
|
}
|
3
website/.vitepress/theme/icons/danger.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor">
|
||||||
|
<path d="M7.998 14.5c2.832 0 5-1.98 5-4.5 0-1.463-.68-2.19-1.879-3.383l-.036-.037c-1.013-1.008-2.3-2.29-2.834-4.434-.322.256-.63.579-.864.953-.432.696-.621 1.58-.046 2.73.473.947.67 2.284-.278 3.232-.61.61-1.545.84-2.403.633a2.788 2.788 0 0 1-1.436-.874A3.21 3.21 0 0 0 3 10c0 2.53 2.164 4.5 4.998 4.5zM9.533.753C9.496.34 9.16.009 8.77.146 7.035.75 4.34 3.187 5.997 6.5c.344.689.285 1.218.003 1.5-.419.419-1.54.487-2.04-.832-.173-.454-.659-.762-1.035-.454C2.036 7.44 1.5 8.702 1.5 10c0 3.512 2.998 6 6.498 6s6.5-2.5 6.5-6c0-2.137-1.128-3.26-2.312-4.438-1.19-1.184-2.436-2.425-2.653-4.81z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 681 B |
3
website/.vitepress/theme/icons/info.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor">
|
||||||
|
<path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 350 B |
3
website/.vitepress/theme/icons/tip.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor">
|
||||||
|
<path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 796 B |
3
website/.vitepress/theme/icons/warning.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor">
|
||||||
|
<path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 405 B |
24
website/.vitepress/theme/index.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import DefaultTheme from 'vitepress/theme';
|
||||||
|
import type { Theme } from 'vitepress';
|
||||||
|
import './custom.css';
|
||||||
|
import HomePage from '../components/HomePage.vue';
|
||||||
|
import AuthorCard from '../components/AuthorCard.vue';
|
||||||
|
import BlogPost from '../components/BlogPost.vue';
|
||||||
|
import Version from '../components/Version.vue';
|
||||||
|
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client';
|
||||||
|
import { h } from 'vue';
|
||||||
|
import 'virtual:group-icons.css';
|
||||||
|
export default {
|
||||||
|
extends: DefaultTheme,
|
||||||
|
Layout() {
|
||||||
|
return h(DefaultTheme.Layout, null, {
|
||||||
|
'home-features-after': () => h(HomePage)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
enhanceApp({ app }) {
|
||||||
|
app.component('AuthorCard', AuthorCard);
|
||||||
|
app.component('BlogPost', BlogPost);
|
||||||
|
app.component('Version', Version);
|
||||||
|
enhanceAppWithTabs(app);
|
||||||
|
}
|
||||||
|
} satisfies Theme;
|
@@ -1,29 +1,35 @@
|
|||||||
version: "3"
|
version: '3'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
yarn:install:
|
install:
|
||||||
desc: Setup Docusaurus locally
|
desc: Setup VitePress locally
|
||||||
cmds:
|
cmds:
|
||||||
- yarn install
|
- pnpm install
|
||||||
sources:
|
sources:
|
||||||
- package.json
|
- package.json
|
||||||
- yarn.lock
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
default:
|
default:
|
||||||
desc: Start website
|
desc: Start website
|
||||||
deps: [yarn:install]
|
deps: [install]
|
||||||
aliases: [s, start]
|
aliases: [s, start]
|
||||||
vars:
|
vars:
|
||||||
HOST: '{{default "0.0.0.0" .HOST}}'
|
HOST: '{{default "0.0.0.0" .HOST}}'
|
||||||
PORT: '{{default "3001" .PORT}}'
|
PORT: '{{default "3001" .PORT}}'
|
||||||
cmds:
|
cmds:
|
||||||
- npx docusaurus start --no-open --host={{.HOST}} --port={{.PORT}}
|
- pnpm dev --host={{.HOST}} --port={{.PORT}}
|
||||||
|
|
||||||
|
lint:
|
||||||
|
desc: Lint website
|
||||||
|
deps: [install]
|
||||||
|
cmds:
|
||||||
|
- pnpm lint
|
||||||
|
|
||||||
build:
|
build:
|
||||||
desc: Build website
|
desc: Build website
|
||||||
deps: [yarn:install]
|
deps: [install]
|
||||||
cmds:
|
cmds:
|
||||||
- npx docusaurus build
|
- pnpm build
|
||||||
|
|
||||||
preview:
|
preview:
|
||||||
desc: Preview Website
|
desc: Preview Website
|
||||||
@@ -33,20 +39,21 @@ tasks:
|
|||||||
HOST: '{{default "localhost" .HOST}}'
|
HOST: '{{default "localhost" .HOST}}'
|
||||||
PORT: '{{default "3001" .PORT}}'
|
PORT: '{{default "3001" .PORT}}'
|
||||||
cmds:
|
cmds:
|
||||||
- npx docusaurus serve --no-open --host={{.HOST}} --port={{.PORT}}
|
- pnpm preview --host={{.HOST}} --port={{.PORT}}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
desc: Clean temp directories
|
desc: Clean temp directories
|
||||||
cmds:
|
cmds:
|
||||||
- rm -rf ./build
|
- rm -rf ./vitepress/dist
|
||||||
|
|
||||||
deploy:
|
deploy:next:
|
||||||
desc: Build and deploy Docusaurus
|
deps: [build]
|
||||||
summary: Requires GIT_USER and GIT_PASS envs to be previous set
|
desc: Build and deploy next.taskfile.dev
|
||||||
cmds:
|
cmds:
|
||||||
- npx docusaurus deploy
|
- pnpm netlify deploy --prod --site=4e13dfcf-fc0d-4bec-ad60-b918a8dc3942
|
||||||
|
|
||||||
upgrade:
|
deploy:prod:
|
||||||
desc: Upgrade Docusaurus
|
deps: [build]
|
||||||
|
desc: Build and deploy taskfile.dev
|
||||||
cmds:
|
cmds:
|
||||||
- yarn upgrade @docusaurus/core@latest @docusaurus/preset-classic@latest @docusaurus/module-type-aliases@latest @docusaurus/tsconfig@latest @docusaurus/types@latest
|
- pnpm netlify deploy --prod --site=e625bc6a-1cd3-465d-ad30-7bbddaeb4f31
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
export default {
|
|
||||||
presets: ['@docusaurus/core/lib/babel/preset'],
|
|
||||||
};
|
|
@@ -1,10 +0,0 @@
|
|||||||
andreynering:
|
|
||||||
name: Andrey Nering
|
|
||||||
title: Maintainer of Task
|
|
||||||
url: https://github.com/andreynering
|
|
||||||
image_url: https://github.com/andreynering.png
|
|
||||||
pd93:
|
|
||||||
name: Pete Davison
|
|
||||||
title: Maintainer of Task
|
|
||||||
url: https://github.com/pd93
|
|
||||||
image_url: https://github.com/pd93.png
|
|
@@ -1,7 +0,0 @@
|
|||||||
export const GITHUB_URL = 'https://github.com/go-task/task';
|
|
||||||
export const TWITTER_URL = 'https://twitter.com/taskfiledev';
|
|
||||||
export const BLUESKY_URL = 'https://bsky.app/profile/taskfile.dev';
|
|
||||||
export const MASTODON_URL = 'https://fosstodon.org/@task';
|
|
||||||
export const DISCORD_URL = 'https://discord.gg/6TY36E39UK';
|
|
||||||
export const STACK_OVERFLOW = 'https://stackoverflow.com/questions/tagged/taskfile';
|
|
||||||
export const ANSWER_OVERFLOW = 'https://www.answeroverflow.com/c/974121106208354339';
|
|
@@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /deprecations/completion-scripts/
|
|
||||||
---
|
|
||||||
|
|
||||||
# Completion Scripts
|
|
||||||
|
|
||||||
:::warning
|
|
||||||
|
|
||||||
This deprecation breaks the following functionality:
|
|
||||||
|
|
||||||
- Any direct references to the completion scripts in the Task git repository
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
Direct use of the completion scripts in the `completion/*` directory of the
|
|
||||||
[github.com/go-task/task][task] Git repository is deprecated. Any shell
|
|
||||||
configuration that directly refers to these scripts will potentially break in
|
|
||||||
the future as the scripts may be moved or deleted entirely. Any configuration
|
|
||||||
should be updated to use the [new method for generating shell
|
|
||||||
completions][completions] instead.
|
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[completions]: ../installation.mdx#setup-completions
|
|
||||||
[task]: https://github.com/go-task/task
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /deprecations/
|
|
||||||
sidebar_position: 8
|
|
||||||
---
|
|
||||||
|
|
||||||
# Deprecations
|
|
||||||
|
|
||||||
As Task evolves, it occasionally outgrows some of its functionality. This can be
|
|
||||||
because they are no longer useful, because another feature has replaced it or
|
|
||||||
because of a change in the way that Task works internally.
|
|
||||||
|
|
||||||
When this happens, we mark the functionality as deprecated. This means that it
|
|
||||||
will be removed in a future version of Task. This functionality will continue to
|
|
||||||
work until that time, but we strongly recommend that you do not implement this
|
|
||||||
functionality in new Taskfiles and make a plan to migrate away from it as soon
|
|
||||||
as possible.
|
|
||||||
|
|
||||||
You can view a full list of active deprecations in the "Deprecations" section of
|
|
||||||
the sidebar.
|
|
@@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
# This is a template for an experiments documentation
|
|
||||||
# Copy this page and fill in the details as necessary
|
|
||||||
title: '--- Template ---'
|
|
||||||
sidebar_position: -1 # Always push to the top
|
|
||||||
draft: true # Hide in production
|
|
||||||
---
|
|
||||||
|
|
||||||
# \{Name of Deprecated Feature\} (#\{Issue\})
|
|
||||||
|
|
||||||
:::warning
|
|
||||||
|
|
||||||
This deprecation breaks the following functionality:
|
|
||||||
|
|
||||||
- \{list any existing functionality that will be broken by this deprecation\}
|
|
||||||
- \{if there are no breaking changes, remove this admonition\}
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
\{Short description of the feature/behavior and why it is being deprecated\}
|
|
||||||
|
|
||||||
\{Short explanation of any replacement features/behaviors and how users should
|
|
||||||
migrate to it\}
|
|
@@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /deprecations/template-functions/
|
|
||||||
---
|
|
||||||
|
|
||||||
# Template Functions
|
|
||||||
|
|
||||||
:::warning
|
|
||||||
|
|
||||||
This deprecation breaks the following functionality:
|
|
||||||
|
|
||||||
- A small set of templating functions
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
The following templating functions are deprecated. Any replacement functions are
|
|
||||||
listed besides the function being removed.
|
|
||||||
|
|
||||||
| Deprecated function | Replaced by |
|
|
||||||
| ------------------- | ----------- |
|
|
||||||
| `IsSH` | - |
|
|
||||||
| `FromSlash` | `fromSlash` |
|
|
||||||
| `ToSlash` | `toSlash` |
|
|
||||||
| `ExeExt` | `exeExt` |
|
|
@@ -1,33 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /deprecations/version-2-schema/
|
|
||||||
---
|
|
||||||
|
|
||||||
# Version 2 Schema (#1197)
|
|
||||||
|
|
||||||
:::warning
|
|
||||||
|
|
||||||
This deprecation breaks the following functionality:
|
|
||||||
|
|
||||||
- Any Taskfiles that use the version 2 schema
|
|
||||||
- `Taskvar.yml` files
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
The Taskfile version 2 schema was introduced in March 2018 and replaced by
|
|
||||||
version 3 in August 2019. In May 2023 [we published a deprecation
|
|
||||||
notice][deprecation-notice] for the version 2 schema on the basis that the vast
|
|
||||||
majority of users had already upgraded to version 3 and removing support for
|
|
||||||
version 2 would allow us to tidy up the codebase and focus on new functionality
|
|
||||||
instead.
|
|
||||||
|
|
||||||
In December 2023, the final version of Task that supports the version 2 schema
|
|
||||||
([v3.33.0][v3.33.0]) was published and all legacy code was removed from Task's
|
|
||||||
main branch. To use a more recent version of Task, you will need to ensure that
|
|
||||||
your Taskfile uses the version 3 schema instead. A list of changes between
|
|
||||||
version 2 and version 3 are available in the [Task v3 Release Notes][v3.0.0].
|
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[v3.0.0]: https://github.com/go-task/task/releases/tag/v3.0.0
|
|
||||||
[v3.33.0]: https://github.com/go-task/task/releases/tag/v3.33.0
|
|
||||||
[deprecation-notice]: https://github.com/go-task/task/issues/1197
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,74 +0,0 @@
|
|||||||
---
|
|
||||||
slug: '/experiments/env-precedence'
|
|
||||||
---
|
|
||||||
|
|
||||||
# Env Precedence (#1038)
|
|
||||||
|
|
||||||
:::caution
|
|
||||||
|
|
||||||
All experimental features are subject to breaking changes and/or removal _at any
|
|
||||||
time_. We strongly recommend that you do not use these features in a production
|
|
||||||
environment. They are intended for testing and feedback only.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
:::warning
|
|
||||||
|
|
||||||
This experiment breaks the following functionality:
|
|
||||||
|
|
||||||
- environment variable will take precedence over OS environment variables
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
:::info
|
|
||||||
|
|
||||||
To enable this experiment, set the environment variable:
|
|
||||||
`TASK_X_ENV_PRECEDENCE=1`. Check out [our guide to enabling
|
|
||||||
experiments][enabling-experiments] for more information.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
Before this experiment, the OS variable took precedence over the task
|
|
||||||
environment variable. This experiment changes the precedence to make the task
|
|
||||||
environment variable take precedence over the OS variable.
|
|
||||||
|
|
||||||
Consider the following example:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
default:
|
|
||||||
env:
|
|
||||||
KEY: 'other'
|
|
||||||
cmds:
|
|
||||||
- echo "$KEY"
|
|
||||||
```
|
|
||||||
Running `KEY=some task` before this experiment, the output would be `some`, but
|
|
||||||
after this experiment, the output would be `other`.
|
|
||||||
|
|
||||||
If you still want to get the OS variable, you can use the template function env
|
|
||||||
like follow : `{{env "OS_VAR"}}`.
|
|
||||||
|
|
||||||
```yml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
default:
|
|
||||||
env:
|
|
||||||
KEY: 'other'
|
|
||||||
cmds:
|
|
||||||
- echo "$KEY"
|
|
||||||
- echo {{env "KEY"}}
|
|
||||||
```
|
|
||||||
Running `KEY=some task`, the output would be `other` and `some`.
|
|
||||||
|
|
||||||
Like other variables/envs, you can also fall back to a given value using the
|
|
||||||
default template function:
|
|
||||||
```yml
|
|
||||||
MY_ENV: '{{.MY_ENV | default "fallback"}}'
|
|
||||||
```
|
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[enabling-experiments]: ./experiments.mdx#enabling-experiments
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,151 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /experiments/
|
|
||||||
sidebar_position: 7
|
|
||||||
---
|
|
||||||
|
|
||||||
import Tabs from '@theme/Tabs';
|
|
||||||
import TabItem from '@theme/TabItem';
|
|
||||||
|
|
||||||
# Experiments
|
|
||||||
|
|
||||||
:::caution
|
|
||||||
|
|
||||||
All experimental features are subject to breaking changes and/or removal _at any
|
|
||||||
time_. We strongly recommend that you do not use these features in a production
|
|
||||||
environment. They are intended for testing and feedback only.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
In order to allow Task to evolve quickly, we sometimes roll out breaking changes
|
|
||||||
to minor versions behind experimental flags. This allows us to gather feedback
|
|
||||||
on breaking changes before committing to a major release. This process can also
|
|
||||||
be used to gather feedback on important non-breaking features before their
|
|
||||||
design is completed. This document describes the
|
|
||||||
[experiment workflow](#workflow) and how you can get involved.
|
|
||||||
|
|
||||||
You can view the full list of active experiments in the sidebar submenu to the
|
|
||||||
left of the page and click on each one to find out more about it.
|
|
||||||
|
|
||||||
## Enabling Experiments
|
|
||||||
|
|
||||||
Task uses environment variables to detect whether or not an experiment is
|
|
||||||
enabled. All of the experiment variables will begin with the same `TASK_X_`
|
|
||||||
prefix followed by the name of the experiment. You can find the exact name for
|
|
||||||
each experiment on their respective pages in the sidebar. If the variable is set
|
|
||||||
`=1` then it will be enabled. Some experiments may have multiple proposals, in
|
|
||||||
which case, you will need to set the variable equal to the number of the
|
|
||||||
proposal that you want to enable (`=2`, `=3` etc).
|
|
||||||
|
|
||||||
There are three main ways to set the environment variables for an experiment.
|
|
||||||
Which method you use depends on how you intend to use the experiment:
|
|
||||||
|
|
||||||
1. Prefixing your task commands with the relevant environment variable(s). For
|
|
||||||
example, `TASK_X_{FEATURE}=1 task {my-task}`. This is intended for one-off
|
|
||||||
invocations of Task to test out experimental features.
|
|
||||||
2. Adding the relevant environment variable(s) in your "dotfiles" (e.g.
|
|
||||||
`.bashrc`, `.zshrc` etc.). This will permanently enable experimental features
|
|
||||||
for your personal environment.
|
|
||||||
|
|
||||||
```shell title="~/.bashrc"
|
|
||||||
export TASK_X_FEATURE=1
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Creating a `.env` or a `.taskrc.yml` file in the same directory as
|
|
||||||
your root Taskfile.\
|
|
||||||
The `.env` file should contain the relevant environment
|
|
||||||
variable(s), while the `.taskrc.yml` file should use a YAML format
|
|
||||||
where each experiment is defined as a key with a corresponding value.
|
|
||||||
|
|
||||||
This allows you to enable an experimental feature at a project level. If you
|
|
||||||
commit this file to source control, then other users of your project will
|
|
||||||
also have these experiments enabled.
|
|
||||||
|
|
||||||
If both files are present, the values in the `.taskrc.yml` file
|
|
||||||
will take precedence.
|
|
||||||
|
|
||||||
<Tabs values={[ {label: '.taskrc.yml', value: 'yaml'}, {label: '.env', value: 'env'}]}>
|
|
||||||
<TabItem value="yaml">
|
|
||||||
```yaml title=".taskrc.yml"
|
|
||||||
experiments:
|
|
||||||
FEATURE: 1
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
|
|
||||||
<TabItem value="env">
|
|
||||||
```shell title=".env"
|
|
||||||
TASK_X_FEATURE=1
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
## Workflow
|
|
||||||
|
|
||||||
Experiments are a way for us to test out new features in Task before committing
|
|
||||||
to them in a major release. Because this concept is built around the idea of
|
|
||||||
feedback from our community, we have built a workflow for the process of
|
|
||||||
introducing these changes. This ensures that experiments are given the attention
|
|
||||||
and time that they need and that we are getting the best possible results out of
|
|
||||||
them.
|
|
||||||
|
|
||||||
The sections below describe the various stages that an experiment must go
|
|
||||||
through from its proposal all the way to being released in a major version of
|
|
||||||
Task.
|
|
||||||
|
|
||||||
### 1. Proposal
|
|
||||||
|
|
||||||
All experimental features start with a proposal in the form of a GitHub issue.
|
|
||||||
If the maintainers decide that an issue has enough support and is a breaking
|
|
||||||
change or is complex/controversial enough to require user feedback, then the
|
|
||||||
issue will be marked with the `status: proposal` label. At this point, the issue
|
|
||||||
becomes a proposal and a period of consultation begins. During this period, we
|
|
||||||
request that users provide feedback on the proposal and how it might effect
|
|
||||||
their use of Task. It is up to the discretion of the maintainers to decide how
|
|
||||||
long this period lasts.
|
|
||||||
|
|
||||||
### 2. Draft
|
|
||||||
|
|
||||||
Once a proposal's consultation ends, a contributor may pick up the work and
|
|
||||||
begin the initial implementation. Once a PR is opened, the maintainers will
|
|
||||||
ensure that it meets the requirements for an experimental feature (i.e. flags
|
|
||||||
are in the right format etc) and merge the feature. Once this code is released,
|
|
||||||
the status will be updated via the `status: draft` label. This indicates that an
|
|
||||||
implementation is now available for use in a release and the experiment is open
|
|
||||||
for feedback.
|
|
||||||
|
|
||||||
:::note
|
|
||||||
|
|
||||||
During the draft period, major changes to the implementation may be made based
|
|
||||||
on the feedback received from users. There are _no stability guarantees_ and
|
|
||||||
experimental features may be abandoned _at any time_.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
### 3. Candidate
|
|
||||||
|
|
||||||
Once an acceptable level of consensus has been reached by the community and
|
|
||||||
feedback/changes are less frequent/significant, the status may be updated via
|
|
||||||
the `status: candidate` label. This indicates that a proposal is _likely_ to
|
|
||||||
accepted and will enter a period for final comments and minor changes.
|
|
||||||
|
|
||||||
### 4. Stable
|
|
||||||
|
|
||||||
Once a suitable amount of time has passed with no changes or feedback, an
|
|
||||||
experiment will be given the `status: stable` label. At this point, the
|
|
||||||
functionality will be treated like any other feature in Task and any changes
|
|
||||||
_must_ be backward compatible. This allows users to migrate to the new
|
|
||||||
functionality without having to worry about anything breaking in future
|
|
||||||
releases. This provides the best experience for users migrating to a new major
|
|
||||||
version.
|
|
||||||
|
|
||||||
### 5. Released
|
|
||||||
|
|
||||||
When making a new major release of Task, all experiments marked as `status:
|
|
||||||
stable` will move to `status: released` and their behaviors will become the new
|
|
||||||
default in Task. Experiments in an earlier stage (i.e. not stable) cannot be
|
|
||||||
released and so will continue to be experiments in the new version.
|
|
||||||
|
|
||||||
### Abandoned / Superseded
|
|
||||||
|
|
||||||
If an experiment is unsuccessful at any point then it will be given the `status:
|
|
||||||
abandoned` or `status: superseded` labels depending on which is more suitable.
|
|
||||||
These experiments will be removed from Task.
|
|
@@ -1,290 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /experiments/remote-taskfiles/
|
|
||||||
---
|
|
||||||
|
|
||||||
import Tabs from '@theme/Tabs';
|
|
||||||
import TabItem from '@theme/TabItem';
|
|
||||||
|
|
||||||
# Remote Taskfiles (#1317)
|
|
||||||
|
|
||||||
:::caution
|
|
||||||
|
|
||||||
All experimental features are subject to breaking changes and/or removal _at any
|
|
||||||
time_. We strongly recommend that you do not use these features in a production
|
|
||||||
environment. They are intended for testing and feedback only.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
:::info
|
|
||||||
|
|
||||||
To enable this experiment, set the environment variable:
|
|
||||||
`TASK_X_REMOTE_TASKFILES=1`. Check out [our guide to enabling experiments
|
|
||||||
][enabling-experiments] for more information.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
:::danger
|
|
||||||
Never run remote Taskfiles from sources that you do not trust.
|
|
||||||
:::
|
|
||||||
|
|
||||||
This experiment allows you to use Taskfiles which are stored in remote
|
|
||||||
locations. This applies to both the root Taskfile (aka. Entrypoint) and also
|
|
||||||
when including Taskfiles.
|
|
||||||
|
|
||||||
Task uses "nodes" to reference remote Taskfiles. There are a few different types
|
|
||||||
of node which you can use:
|
|
||||||
|
|
||||||
<Tabs groupId="method" queryString>
|
|
||||||
<TabItem value="http" label="HTTP/HTTPS">
|
|
||||||
|
|
||||||
`https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml`
|
|
||||||
|
|
||||||
This is the most basic type of remote node and works by downloading the file
|
|
||||||
from the specified URL. The file must be a valid Taskfile and can be of any
|
|
||||||
name. If a file is not found at the specified URL, Task will append each of the
|
|
||||||
[supported file names][supported-file-names] in turn until it finds a valid
|
|
||||||
file. If it still does not find a valid Taskfile, an error is returned.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="git-http" label="Git over HTTP">
|
|
||||||
|
|
||||||
`https://github.com/go-task/task.git//website/static/Taskfile.yml?ref=main`
|
|
||||||
|
|
||||||
This type of node works by downloading the file from a Git repository over
|
|
||||||
HTTP/HTTPS. The first part of the URL is the base URL of the Git repository.
|
|
||||||
This is the same URL that you would use to clone the repo over HTTP.
|
|
||||||
|
|
||||||
- You can optionally add the path to the Taskfile in the repository by appending
|
|
||||||
`//<path>` to the URL.
|
|
||||||
- You can also optionally specify a branch or tag to use by appending
|
|
||||||
`?ref=<ref>` to the end of the URL. If you omit a reference, the default branch
|
|
||||||
will be used.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="git-ssh" label="Git over SSH">
|
|
||||||
|
|
||||||
`git@github.com/go-task/task.git//website/static/Taskfile.yml?ref=main`
|
|
||||||
|
|
||||||
This type of node works by downloading the file from a Git repository over SSH.
|
|
||||||
The first part of the URL is the user and base URL of the Git repository. This
|
|
||||||
is the same URL that you would use to clone the repo over SSH.
|
|
||||||
|
|
||||||
To use Git over SSH, you need to make sure that your SSH agent has your private
|
|
||||||
SSH keys added so that they can be used during authentication.
|
|
||||||
|
|
||||||
- You can optionally add the path to the Taskfile in the repository by appending
|
|
||||||
`//<path>` to the URL.
|
|
||||||
- You can also optionally specify a branch or tag to use by appending
|
|
||||||
`?ref=<ref>` to the end of the URL. If you omit a reference, the default branch
|
|
||||||
will be used.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
Task has an [example remote Taskfile][example-remote-taskfile] in our repository
|
|
||||||
that you can use for testing and that we will use throughout this document:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
default:
|
|
||||||
cmds:
|
|
||||||
- task: hello
|
|
||||||
|
|
||||||
hello:
|
|
||||||
cmds:
|
|
||||||
- echo "Hello Task!"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Specifying a remote entrypoint
|
|
||||||
|
|
||||||
By default, Task will look for one of the [supported file
|
|
||||||
names][supported-file-names] on your local filesystem. If you want to use a
|
|
||||||
remote file instead, you can pass its URI into the `--taskfile`/`-t` flag just
|
|
||||||
like you would to specify a different local file. For example:
|
|
||||||
|
|
||||||
<Tabs groupId="method" queryString>
|
|
||||||
<TabItem value="http" label="HTTP/HTTPS">
|
|
||||||
```shell
|
|
||||||
$ task --taskfile https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml
|
|
||||||
task: [hello] echo "Hello Task!"
|
|
||||||
Hello Task!
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="git-http" label="Git over HTTP">
|
|
||||||
```shell
|
|
||||||
$ task --taskfile https://github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
|
||||||
task: [hello] echo "Hello Task!"
|
|
||||||
Hello Task!
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="git-ssh" label="Git over SSH">
|
|
||||||
```shell
|
|
||||||
$ task --taskfile git@github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
|
||||||
task: [hello] echo "Hello Task!"
|
|
||||||
Hello Task!
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
## Including remote Taskfiles
|
|
||||||
|
|
||||||
Including a remote file works exactly the same way that including a local file
|
|
||||||
does. You just need to replace the local path with a remote URI. Any tasks in
|
|
||||||
the remote Taskfile will be available to run from your main Taskfile.
|
|
||||||
|
|
||||||
<Tabs groupId="method" queryString>
|
|
||||||
<TabItem value="http" label="HTTP/HTTPS">
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
includes:
|
|
||||||
my-remote-namespace: https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="git-http" label="Git over HTTP">
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
includes:
|
|
||||||
my-remote-namespace: https://github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="git-ssh" label="Git over SSH">
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
includes:
|
|
||||||
my-remote-namespace: git@github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ task my-remote-namespace:hello
|
|
||||||
task: [hello] echo "Hello Task!"
|
|
||||||
Hello Task!
|
|
||||||
```
|
|
||||||
|
|
||||||
### Authenticating using environment variables
|
|
||||||
|
|
||||||
The Taskfile location is processed by the templating system, so you can
|
|
||||||
reference environment variables in your URL if you need to add authentication.
|
|
||||||
For example:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
includes:
|
|
||||||
my-remote-namespace: https://{{.TOKEN}}@raw.githubusercontent.com/my-org/my-repo/main/Taskfile.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
## Security
|
|
||||||
|
|
||||||
### Automatic checksums
|
|
||||||
|
|
||||||
Running commands from sources that you do not control is always a potential
|
|
||||||
security risk. For this reason, we have added some automatic checks when using
|
|
||||||
remote Taskfiles:
|
|
||||||
|
|
||||||
1. When running a task from a remote Taskfile for the first time, Task will
|
|
||||||
print a warning to the console asking you to check that you are sure that you
|
|
||||||
trust the source of the Taskfile. If you do not accept the prompt, then Task
|
|
||||||
will exit with code `104` (not trusted) and nothing will run. If you accept
|
|
||||||
the prompt, the remote Taskfile will run and further calls to the remote
|
|
||||||
Taskfile will not prompt you again.
|
|
||||||
2. Whenever you run a remote Taskfile, Task will create and store a checksum of
|
|
||||||
the file that you are running. If the checksum changes, then Task will print
|
|
||||||
another warning to the console to inform you that the contents of the remote
|
|
||||||
file has changed. If you do not accept the prompt, then Task will exit with
|
|
||||||
code `104` (not trusted) and nothing will run. If you accept the prompt, the
|
|
||||||
checksum will be updated and the remote Taskfile will run.
|
|
||||||
|
|
||||||
Sometimes you need to run Task in an environment that does not have an
|
|
||||||
interactive terminal, so you are not able to accept a prompt. In these cases you
|
|
||||||
are able to tell task to accept these prompts automatically by using the `--yes`
|
|
||||||
flag. Before enabling this flag, you should:
|
|
||||||
|
|
||||||
1. Be sure that you trust the source and contents of the remote Taskfile.
|
|
||||||
2. Consider using a pinned version of the remote Taskfile (e.g. A link
|
|
||||||
containing a commit hash) to prevent Task from automatically accepting a
|
|
||||||
prompt that says a remote Taskfile has changed.
|
|
||||||
|
|
||||||
### Manual checksum pinning
|
|
||||||
|
|
||||||
Alternatively, if you expect the contents of your remote files to be a constant
|
|
||||||
value, you can pin the checksum of the included file instead:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
includes:
|
|
||||||
included:
|
|
||||||
taskfile: https://taskfile.dev
|
|
||||||
checksum: c153e97e0b3a998a7ed2e61064c6ddaddd0de0c525feefd6bba8569827d8efe9
|
|
||||||
```
|
|
||||||
|
|
||||||
This will disable the automatic checksum prompts discussed above. However, if
|
|
||||||
the checksums do not match, Task will exit immediately with an error. When
|
|
||||||
setting this up for the first time, you may not know the correct value of the
|
|
||||||
checksum. There are a couple of ways you can obtain this:
|
|
||||||
|
|
||||||
1. Add the include normally without the `checksum` key. The first time you run
|
|
||||||
the included Taskfile, a `.task/remote` temporary directory is created. Find
|
|
||||||
the correct set of files for your included Taskfile and open the file that
|
|
||||||
ends with `.checksum`. You can copy the contents of this file and paste it
|
|
||||||
into the `checksum` key of your include. This method is safest as it allows
|
|
||||||
you to inspect the downloaded Taskfile before you pin it.
|
|
||||||
2. Alternatively, add the include with a temporary random value in the
|
|
||||||
`checksum` key. When you try to run the Taskfile, you will get an error that
|
|
||||||
will report the incorrect expected checksum and the actual checksum. You can
|
|
||||||
copy the actual checksum and replace your temporary random value.
|
|
||||||
|
|
||||||
### TLS
|
|
||||||
|
|
||||||
Task currently supports both `http` and `https` URLs. However, the `http`
|
|
||||||
requests will not execute by default unless you run the task with the
|
|
||||||
`--insecure` flag. This is to protect you from accidentally running a remote
|
|
||||||
Taskfile that is downloaded via an unencrypted connection. Sources that are not
|
|
||||||
protected by TLS are vulnerable to [man-in-the-middle
|
|
||||||
attacks][man-in-the-middle-attacks] and should be avoided unless you know what
|
|
||||||
you are doing.
|
|
||||||
|
|
||||||
## Caching & Running Offline
|
|
||||||
|
|
||||||
Whenever you run a remote Taskfile, the latest copy will be downloaded from the
|
|
||||||
internet and cached locally. This cached file will be used for all future
|
|
||||||
invocations of the Taskfile until the cache expires. Once it expires, Task will
|
|
||||||
download the latest copy of the file and update the cache. By default, the cache
|
|
||||||
is set to expire immediately. This means that Task will always fetch the latest
|
|
||||||
version. However, the cache expiry duration can be modified by setting the
|
|
||||||
`--expiry` flag.
|
|
||||||
|
|
||||||
If for any reason you lose access to the internet or you are running Task in
|
|
||||||
offline mode (via the `--offline` flag or `TASK_OFFLINE` environment variable),
|
|
||||||
Task will run the any available cached files _even if they are expired_. This
|
|
||||||
means that you should never be stuck without the ability to run your tasks as
|
|
||||||
long as you have downloaded a remote Taskfile at least once.
|
|
||||||
|
|
||||||
By default, Task will timeout requests to download remote files after 10 seconds
|
|
||||||
and look for a cached copy instead. This timeout can be configured by setting
|
|
||||||
the `--timeout` flag and specifying a duration. For example, `--timeout 5s` will
|
|
||||||
set the timeout to 5 seconds.
|
|
||||||
|
|
||||||
By default, the cache is stored in the Task temp directory, represented by the
|
|
||||||
`TASK_TEMP_DIR` [environment variable](../reference/environment.mdx) You can
|
|
||||||
override the location of the cache by setting the `TASK_REMOTE_DIR` environment
|
|
||||||
variable. This way, you can share the cache between different projects.
|
|
||||||
|
|
||||||
You can force Task to ignore the cache and download the latest version
|
|
||||||
by using the `--download` flag.
|
|
||||||
|
|
||||||
You can use the `--clear-cache` flag to clear all cached remote files.
|
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[enabling-experiments]: ./experiments.mdx#enabling-experiments
|
|
||||||
[man-in-the-middle-attacks]: https://en.wikipedia.org/wiki/Man-in-the-middle_attack
|
|
||||||
[supported-file-names]: https://taskfile.dev/usage/#supported-file-names
|
|
||||||
[example-remote-taskfile]: https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,143 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /getting-started/
|
|
||||||
sidebar_position: 3
|
|
||||||
---
|
|
||||||
|
|
||||||
# Getting Started
|
|
||||||
|
|
||||||
The following guide will help introduce you to the basics of Task. We'll cover
|
|
||||||
how to create a Taskfile, how to write a basic task and how to call it. If you
|
|
||||||
haven't installed Task yet, head over to our [installation
|
|
||||||
guide][installation].
|
|
||||||
|
|
||||||
## Creating your first Taskfile
|
|
||||||
|
|
||||||
Once Task is installed, you can create your first Taskfile by running:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
task --init
|
|
||||||
```
|
|
||||||
|
|
||||||
This will create a file called `Taskfile.yml` in the current directory. If you
|
|
||||||
want to create the file in another directory, you can pass an absolute or
|
|
||||||
relative path to the directory into the command:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
task --init ./subdirectory
|
|
||||||
```
|
|
||||||
|
|
||||||
Or if you want the Taskfile to have a specific name, you can pass in the name of
|
|
||||||
the file:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
task --init Custom.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
This will create a Taskfile that looks something like this:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
vars:
|
|
||||||
GREETING: Hello, World!
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
default:
|
|
||||||
cmds:
|
|
||||||
- echo "{{.GREETING}}"
|
|
||||||
silent: true
|
|
||||||
```
|
|
||||||
|
|
||||||
As you can see, all Taskfiles are written in [YAML format][yaml]. The `version`
|
|
||||||
attribute specifies the minimum version of Task that can be used to run this
|
|
||||||
file. The `vars` attribute is used to define variables that can be used in
|
|
||||||
tasks. In this case, we are creating a string variable called `GREETING` with a
|
|
||||||
value of `Hello, World!`.
|
|
||||||
|
|
||||||
Finally, the `tasks` attribute is used to define the tasks that can be run. In
|
|
||||||
this case, we have a task called `default` that echoes the value of the
|
|
||||||
`GREETING` variable. The `silent` attribute is set to `true`, which means that
|
|
||||||
the task metadata will not be printed when the task is run - only the output of
|
|
||||||
the commands.
|
|
||||||
|
|
||||||
## Calling a task
|
|
||||||
|
|
||||||
To call the task, invoke `task` followed by the name of the task you want to
|
|
||||||
run. In this case, the name of the task is `default`, so you should run:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
task default
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that we don't have to specify the name of the Taskfile. Task will
|
|
||||||
automatically look for a file called `Taskfile.yml` (or any of Task's [supported
|
|
||||||
file names][supported-file-names]) in the current directory. Additionally, tasks
|
|
||||||
with the name `default` are special. They can also be run without specifying the
|
|
||||||
task name.
|
|
||||||
|
|
||||||
If you created a Taskfile in a different directory, you can run it by passing
|
|
||||||
the absolute or relative path to the directory as an argument using the `--dir`
|
|
||||||
flag:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
task --dir ./subdirectory
|
|
||||||
```
|
|
||||||
|
|
||||||
Or if you created a Taskfile with a different name, you can run it by passing
|
|
||||||
the name of the Taskfile as an argument using the `--taskfile` flag:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
task --taskfile Custom.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
## Adding a build task
|
|
||||||
|
|
||||||
Let's create a task to build a program in Go. Start by adding a new task called
|
|
||||||
`build` below the existing `default` task. We can then add a `cmds` attribute
|
|
||||||
with a single command to build the program.
|
|
||||||
|
|
||||||
Task uses [mvdan/sh][mvdan/sh], a native Go sh interpreter. So you can write
|
|
||||||
sh/bash-like commands - even in environments where `sh` or `bash` are usually
|
|
||||||
not available (like Windows). Just remember any executables called must be
|
|
||||||
available as a built-in or in the system's `PATH`.
|
|
||||||
|
|
||||||
When you're done, it should look something like this:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
vars:
|
|
||||||
GREETING: Hello, World!
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
default:
|
|
||||||
cmds:
|
|
||||||
- echo "{{.GREETING}}"
|
|
||||||
silent: true
|
|
||||||
|
|
||||||
build:
|
|
||||||
cmds:
|
|
||||||
- go build ./cmd/main.go
|
|
||||||
```
|
|
||||||
|
|
||||||
Call the task by running:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
task build
|
|
||||||
```
|
|
||||||
|
|
||||||
That's about it for the basics, but there's _so much_ more that you can do with
|
|
||||||
Task. Check out the rest of the documentation to learn more about all the
|
|
||||||
features Task has to offer! We recommend taking a look at the [usage
|
|
||||||
guide][usage] next. Alternatively, you can check out our reference docs for the
|
|
||||||
[Taskfile schema][schema] and [CLI][cli].
|
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[yaml]: https://yaml.org/
|
|
||||||
[installation]: /installation/
|
|
||||||
[supported-file-names]: /usage/#supported-file-names
|
|
||||||
[mvdan/sh]: https://github.com/mvdan/sh
|
|
||||||
[usage]: /usage/
|
|
||||||
[schema]: /reference/schema/
|
|
||||||
[cli]: /reference/cli/
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,354 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /installation/
|
|
||||||
sidebar_position: 2
|
|
||||||
toc_max_heading_level: 4
|
|
||||||
---
|
|
||||||
|
|
||||||
import Tabs from '@theme/Tabs';
|
|
||||||
import TabItem from '@theme/TabItem';
|
|
||||||
|
|
||||||
# Installation
|
|
||||||
|
|
||||||
Task offers many installation methods. Check out the available methods below.
|
|
||||||
|
|
||||||
:::info
|
|
||||||
|
|
||||||
Some of the methods below are marked as ![Community][community]. This means they
|
|
||||||
are not maintained by the Task team and may not be up-to-date.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Package Managers
|
|
||||||
|
|
||||||
### [Homebrew][homebrew] ![][macos] ![][linux] \{#homebrew}
|
|
||||||
|
|
||||||
Task is available via our official Homebrew tap [[source](https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb)]:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
brew install go-task/tap/go-task
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively it can be installed from the official Homebrew
|
|
||||||
repository [[package](https://formulae.brew.sh/formula/go-task)]
|
|
||||||
[[source](https://github.com/Homebrew/homebrew-core/blob/master/Formula/g/go-task.rb)] by running:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
brew install go-task
|
|
||||||
```
|
|
||||||
|
|
||||||
### [Macports][macports] ![][macos] ![][community] \{#macports}
|
|
||||||
|
|
||||||
Task repository is tracked by Macports [[package](https://ports.macports.org/port/go-task/details/)] [[source](https://github.com/macports/macports-ports/blob/master/devel/go-task/Portfile)]:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
port install go-task
|
|
||||||
```
|
|
||||||
|
|
||||||
### [Snap][snapcraft] ![][macos] ![][linux] \{#snap}
|
|
||||||
|
|
||||||
Task is available on [Snapcraft][snapcraft] [[source](https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml)], but keep in mind that your Linux
|
|
||||||
distribution should allow classic confinement for Snaps to Task work correctly:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
sudo snap install task --classic
|
|
||||||
```
|
|
||||||
|
|
||||||
### [npm][npm] ![][macos] ![][linux] ![][windows] \{#npm}
|
|
||||||
|
|
||||||
Npm can be used as cross-platform way to install Task globally or as a
|
|
||||||
dependency of your project
|
|
||||||
[[package](https://www.npmjs.com/package/@go-task/cli)] [[source](https://github.com/go-task/task/blob/main/package.json)]:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm install -g @go-task/cli
|
|
||||||
```
|
|
||||||
|
|
||||||
### [pip][pip] ![][macos] ![][linux] ![][windows] ![][community] \{#pip}
|
|
||||||
|
|
||||||
Like npm, pip can be used as a cross-platform way to install Task
|
|
||||||
[[package](https://pypi.org/project/go-task-bin)] [[source](https://github.com/Bing-su/pip-binary-factory/tree/main/task)]:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
pip install go-task-bin
|
|
||||||
```
|
|
||||||
|
|
||||||
### [WinGet][winget] ![][windows] \{#winget}
|
|
||||||
|
|
||||||
Task is available via the [community repository](https://github.com/microsoft/winget-pkgs) [[source](https://github.com/microsoft/winget-pkgs/tree/master/manifests/t/Task/Task)]:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
winget install Task.Task
|
|
||||||
```
|
|
||||||
|
|
||||||
### [Chocolatey][choco] ![][windows] ![][community] \{#chocolatey}
|
|
||||||
|
|
||||||
[[package](https://community.chocolatey.org/packages/go-task)] [[source](https://github.com/Starz0r/ChocolateyPackagingScripts/blob/master/src/go-task_gh_build.py)]
|
|
||||||
|
|
||||||
```shell
|
|
||||||
choco install go-task
|
|
||||||
```
|
|
||||||
|
|
||||||
### [Scoop][scoop] ![][windows] ![][community] \{#scoop}
|
|
||||||
|
|
||||||
[[source](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json)]
|
|
||||||
|
|
||||||
```shell
|
|
||||||
scoop install task
|
|
||||||
```
|
|
||||||
|
|
||||||
### Arch ([pacman][pacman]) ![][arch] ![][community] \{#arch}
|
|
||||||
|
|
||||||
[[package](https://archlinux.org/packages/extra/x86_64/go-task/)] [[source](https://gitlab.archlinux.org/archlinux/packaging/packages/go-task)]
|
|
||||||
|
|
||||||
```shell
|
|
||||||
pacman -S go-task
|
|
||||||
```
|
|
||||||
|
|
||||||
### Fedora ([dnf][dnf]) ![][fedora] ![][community] \{#fedora}
|
|
||||||
|
|
||||||
[[package](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)] [[source](https://src.fedoraproject.org/rpms/golang-github-task)]
|
|
||||||
|
|
||||||
```shell
|
|
||||||
dnf install go-task
|
|
||||||
```
|
|
||||||
|
|
||||||
### FreeBSD ([Ports][freebsdports]) ![][freebsd] ![][community] \{#freebsd}
|
|
||||||
|
|
||||||
[[package](https://cgit.freebsd.org/ports/tree/devel/task)] [[source](https://cgit.freebsd.org/ports/tree/devel/task/Makefile)]
|
|
||||||
|
|
||||||
```shell
|
|
||||||
pkg install task
|
|
||||||
```
|
|
||||||
|
|
||||||
### NixOS ([nix][nix]) ![][nixos] ![][linux] ![][community] \{#nix}
|
|
||||||
|
|
||||||
[[source](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/go/go-task/package.nix)]
|
|
||||||
|
|
||||||
```shell
|
|
||||||
nix-env -iA nixpkgs.go-task
|
|
||||||
```
|
|
||||||
|
|
||||||
### [pacstall][pacstall] ![][debian] ![][ubuntu] ![][community] \{#pacstall}
|
|
||||||
|
|
||||||
[[package](https://pacstall.dev/packages/go-task-deb)] [[source](https://github.com/pacstall/pacstall-programs/blob/master/packages/go-task-deb/go-task-deb.pacscript)]
|
|
||||||
|
|
||||||
```shell
|
|
||||||
pacstall -I go-task-deb
|
|
||||||
```
|
|
||||||
|
|
||||||
### [pkgx][pkgx] ![][macos] ![][linux] ![][community] \{#pkgx}
|
|
||||||
|
|
||||||
[[package](https://pkgx.dev/pkgs/taskfile.dev)] [[source](https://github.com/pkgxdev/pantry/blob/main/projects/taskfile.dev/package.yml)]
|
|
||||||
|
|
||||||
```shell
|
|
||||||
pkgx task
|
|
||||||
```
|
|
||||||
|
|
||||||
or, if you have pkgx integration enabled:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
task
|
|
||||||
```
|
|
||||||
|
|
||||||
## Get The Binary
|
|
||||||
|
|
||||||
### Binary
|
|
||||||
|
|
||||||
You can download the binary from the [releases page on GitHub][releases] and add
|
|
||||||
to your `$PATH`.
|
|
||||||
|
|
||||||
DEB and RPM packages are also available.
|
|
||||||
|
|
||||||
The `task_checksums.txt` file contains the SHA-256 checksum for each file.
|
|
||||||
|
|
||||||
### Install Script
|
|
||||||
|
|
||||||
We also have an [install script][installscript] which is very useful in
|
|
||||||
scenarios like CI. Many thanks to [GoDownloader][godownloader] for enabling the
|
|
||||||
easy generation of this script.
|
|
||||||
|
|
||||||
By default, it installs on the `./bin` directory relative to the working
|
|
||||||
directory:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
|
|
||||||
```
|
|
||||||
|
|
||||||
It is possible to override the installation directory with the `-b` parameter.
|
|
||||||
On Linux, common choices are `~/.local/bin` and `~/bin` to install for the
|
|
||||||
current user or `/usr/local/bin` to install for all users:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
|
|
||||||
```
|
|
||||||
|
|
||||||
:::caution
|
|
||||||
|
|
||||||
On macOS and Windows, `~/.local/bin` and `~/bin` are not added to `$PATH` by
|
|
||||||
default.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
By default, it installs the latest version available.
|
|
||||||
You can also specify a tag (available in [releases](https://github.com/go-task/task/releases))
|
|
||||||
to install a specific version:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d v3.36.0
|
|
||||||
```
|
|
||||||
|
|
||||||
Parameters are order specific, to set both installation directory and version:
|
|
||||||
```shell
|
|
||||||
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin v3.42.1
|
|
||||||
```
|
|
||||||
|
|
||||||
### GitHub Actions
|
|
||||||
|
|
||||||
If you want to install Task in GitHub Actions you can try using
|
|
||||||
[this action](https://github.com/arduino/setup-task) by the Arduino team:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- name: Install Task
|
|
||||||
uses: arduino/setup-task@v2
|
|
||||||
with:
|
|
||||||
version: 3.x
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
```
|
|
||||||
|
|
||||||
This installation method is community owned.
|
|
||||||
|
|
||||||
## Build From Source
|
|
||||||
|
|
||||||
### Go Modules
|
|
||||||
|
|
||||||
Ensure that you have a supported version of [Go][go] properly installed and
|
|
||||||
setup. You can find the minimum required version of Go in the
|
|
||||||
[go.mod](https://github.com/go-task/task/blob/main/go.mod#L3) file.
|
|
||||||
|
|
||||||
You can then install the latest release globally by running:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
go install github.com/go-task/task/v3/cmd/task@latest
|
|
||||||
```
|
|
||||||
|
|
||||||
Or you can install into another directory:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest
|
|
||||||
```
|
|
||||||
|
|
||||||
:::tip
|
|
||||||
|
|
||||||
For CI environments we recommend using the [install script](#install-script)
|
|
||||||
instead, which is faster and more stable, since it'll just download the latest
|
|
||||||
released binary.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Setup completions
|
|
||||||
|
|
||||||
Some installation methods will automatically install completions too, but if
|
|
||||||
this isn't working for you or your chosen method doesn't include them, you can
|
|
||||||
run `task --completion <shell>` to output a completion script for any supported
|
|
||||||
shell. There are a couple of ways these completions can be added to your shell
|
|
||||||
config:
|
|
||||||
|
|
||||||
### Option 1. Load the completions in your shell's startup config (Recommended)
|
|
||||||
|
|
||||||
This method loads the completion script from the currently installed version of
|
|
||||||
task every time you create a new shell. This ensures that your completions are
|
|
||||||
always up-to-date.
|
|
||||||
|
|
||||||
<Tabs values={[ {label: 'bash', value: '1'}, {label: 'zsh', value: '2'},
|
|
||||||
{label: 'fish', value: '3'},
|
|
||||||
{label: 'powershell', value: '4'}
|
|
||||||
]}>
|
|
||||||
|
|
||||||
<TabItem value="1">
|
|
||||||
```shell title="~/.bashrc"
|
|
||||||
eval "$(task --completion bash)"
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
|
|
||||||
<TabItem value="2">
|
|
||||||
```shell title="~/.zshrc"
|
|
||||||
eval "$(task --completion zsh)"
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
|
|
||||||
<TabItem value="3">
|
|
||||||
```shell title="~/.config/fish/config.fish"
|
|
||||||
task --completion fish | source
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
|
|
||||||
<TabItem value="4">
|
|
||||||
```powershell title="$PROFILE\Microsoft.PowerShell_profile.ps1"
|
|
||||||
Invoke-Expression (&task --completion powershell | Out-String)
|
|
||||||
```
|
|
||||||
</TabItem></Tabs>
|
|
||||||
|
|
||||||
### Option 2. Copy the script to your shell's completions directory
|
|
||||||
|
|
||||||
This method requires you to manually update the completions whenever Task is
|
|
||||||
updated. However, it is useful if you want to modify the completions yourself.
|
|
||||||
|
|
||||||
<Tabs
|
|
||||||
values={[
|
|
||||||
{label: 'bash', value: '1'},
|
|
||||||
{label: 'zsh', value: '2'},
|
|
||||||
{label: 'fish', value: '3'}
|
|
||||||
]}>
|
|
||||||
|
|
||||||
<TabItem value="1">
|
|
||||||
```shell
|
|
||||||
task --completion bash > /etc/bash_completion.d/task
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
|
|
||||||
<TabItem value="2">
|
|
||||||
```shell
|
|
||||||
task --completion zsh > /usr/local/share/zsh/site-functions/_task
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
|
|
||||||
<TabItem value="3">
|
|
||||||
```shell
|
|
||||||
task --completion fish > ~/.config/fish/completions/task.fish
|
|
||||||
```
|
|
||||||
</TabItem></Tabs>
|
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[homebrew]: https://brew.sh
|
|
||||||
[macports]: https://macports.org
|
|
||||||
[snapcraft]: https://snapcraft.io/task
|
|
||||||
[winget]: https://github.com/microsoft/winget-cli
|
|
||||||
[choco]: https://chocolatey.org
|
|
||||||
[scoop]: https://scoop.sh
|
|
||||||
[pacman]: https://wiki.archlinux.org/title/Pacman
|
|
||||||
[dnf]: https://docs.fedoraproject.org/en-US/quick-docs/dnf
|
|
||||||
[nix]: https://nixos.org
|
|
||||||
[npm]: https://www.npmjs.com
|
|
||||||
[pip]: https://pip.pypa.io
|
|
||||||
[mise]: https://mise.jdx.dev
|
|
||||||
[aqua]: https://aquaproj.github.io
|
|
||||||
[pacstall]: https://github.com/pacstall/pacstall
|
|
||||||
[pkgx]: https://pkgx.sh
|
|
||||||
[freebsdports]: https://ports.freebsd.org/cgi/ports.cgi
|
|
||||||
|
|
||||||
[go]: https://golang.org
|
|
||||||
[godownloader]: https://github.com/goreleaser/godownloader
|
|
||||||
[releases]: https://github.com/go-task/task/releases
|
|
||||||
[installscript]: https://github.com/go-task/task/blob/main/install-task.sh
|
|
||||||
|
|
||||||
[community]: https://img.shields.io/badge/Community%20Owned-orange
|
|
||||||
[windows]: https://custom-icon-badges.demolab.com/badge/Windows-0078D6?logo=windows11&logoColor=white
|
|
||||||
[macos]: https://img.shields.io/badge/MacOS-000000?logo=apple&logoColor=F0F0F0
|
|
||||||
[linux]: https://img.shields.io/badge/Linux-FCC624?logo=linux&logoColor=black
|
|
||||||
[arch]: https://img.shields.io/badge/Arch%20Linux-1793D1?logo=arch-linux&logoColor=fff
|
|
||||||
[fedora]: https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=fff
|
|
||||||
[nixos]: https://img.shields.io/badge/NixOS-5277C3?logo=nixos&logoColor=fff
|
|
||||||
[debian]: https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=fff
|
|
||||||
[ubuntu]: https://img.shields.io/badge/Ubuntu-E95420?logo=ubuntu&logoColor=fff
|
|
||||||
[freebsd]: https://img.shields.io/badge/FreeBSD-990000?logo=freebsd&logoColor=fff
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,84 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /integrations/
|
|
||||||
sidebar_position: 9
|
|
||||||
---
|
|
||||||
|
|
||||||
# Integrations
|
|
||||||
|
|
||||||
## Visual Studio Code Extension
|
|
||||||
|
|
||||||
Task has an
|
|
||||||
[official extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=task.vscode-task).
|
|
||||||
The code for this project can be found
|
|
||||||
[here](https://github.com/go-task/vscode-task). To use this extension, you must
|
|
||||||
have Task v3.23.0+ installed on your system.
|
|
||||||
|
|
||||||
This extension provides the following features (and more):
|
|
||||||
|
|
||||||
- View tasks in the sidebar.
|
|
||||||
- Run tasks from the sidebar and command palette.
|
|
||||||
- Go to definition from the sidebar and command palette.
|
|
||||||
- Run last task command.
|
|
||||||
- Multi-root workspace support.
|
|
||||||
- Initialize a Taskfile in the current workspace.
|
|
||||||
|
|
||||||
To get autocompletion and validation for your Taskfile, see the
|
|
||||||
[Schema](#schema) section below.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Schema
|
|
||||||
|
|
||||||
This was initially created by @KROSF in
|
|
||||||
[this Gist](https://gist.github.com/KROSF/c5435acf590acd632f71bb720f685895) and
|
|
||||||
is now officially maintained in
|
|
||||||
[this file](https://github.com/go-task/task/blob/main/website/static/schema.json)
|
|
||||||
and made available at https://taskfile.dev/schema.json. This schema can be used
|
|
||||||
to validate Taskfiles and provide autocompletion in many code editors:
|
|
||||||
|
|
||||||
### Visual Studio Code
|
|
||||||
|
|
||||||
To integrate the schema into VS Code, you need to install the
|
|
||||||
[YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
|
|
||||||
by Red Hat. Any `Taskfile.yml` in your project should automatically be detected
|
|
||||||
and validation/autocompletion should work. If this doesn't work or you want to
|
|
||||||
manually configure it for files with a different name, you can add the following
|
|
||||||
to your `settings.json`:
|
|
||||||
|
|
||||||
```json
|
|
||||||
// settings.json
|
|
||||||
{
|
|
||||||
"yaml.schemas": {
|
|
||||||
"https://taskfile.dev/schema.json": [
|
|
||||||
"**/Taskfile.yml",
|
|
||||||
"./path/to/any/other/taskfile.yml"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also configure the schema directly inside of a Taskfile by adding the
|
|
||||||
following comment to the top of the file:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# yaml-language-server: $schema=https://taskfile.dev/schema.json
|
|
||||||
version: '3'
|
|
||||||
```
|
|
||||||
|
|
||||||
You can find more information on this in the
|
|
||||||
[YAML language server project](https://github.com/redhat-developer/yaml-language-server).
|
|
||||||
|
|
||||||
## Community Integrations
|
|
||||||
|
|
||||||
In addition to our official integrations, there is an amazing community of
|
|
||||||
developers who have created their own integrations for Task:
|
|
||||||
|
|
||||||
- [Sublime Text Plugin](https://packagecontrol.io/packages/Taskfile)
|
|
||||||
[[source](https://github.com/biozz/sublime-taskfile)] by @biozz
|
|
||||||
- [IntelliJ Plugin](https://plugins.jetbrains.com/plugin/17058-taskfile)
|
|
||||||
[[source](https://github.com/lechuckroh/task-intellij-plugin)] by @lechuckroh
|
|
||||||
- [mk](https://github.com/pycontribs/mk) command line tool recognizes Taskfiles
|
|
||||||
natively.
|
|
||||||
|
|
||||||
If you have made something that integrates with Task, please feel free to open a
|
|
||||||
PR to add it to this list.
|
|
@@ -1,68 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /
|
|
||||||
sidebar_position: 1
|
|
||||||
title: Home
|
|
||||||
hide_title: true
|
|
||||||
---
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
<img id="logo" src="/img/logo.svg" height="250px" width="250px" />
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
Task is a task runner / build tool that aims to be simpler and easier to use
|
|
||||||
than, for example, [GNU Make][make].
|
|
||||||
|
|
||||||
Since it's written in [Go][go], Task is just a single binary and has no other
|
|
||||||
dependencies, which means you don't need to mess with any complicated install
|
|
||||||
setups just to use a build tool.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- [Easy installation](/installation): just download a single binary, add to
|
|
||||||
`$PATH` and you're done! Or you can also install using [Homebrew][homebrew],
|
|
||||||
[Snapcraft][snapcraft], or [Scoop][scoop] if you want.
|
|
||||||
- Available on CIs: by adding
|
|
||||||
[this simple command](/installation#install-script) to install on your CI
|
|
||||||
script and you're ready to use Task as part of your CI pipeline;
|
|
||||||
- Truly cross-platform: while most build tools only work well on Linux or macOS,
|
|
||||||
Task also supports Windows thanks to [this shell interpreter for Go][sh].
|
|
||||||
- Great for code generation: you can easily
|
|
||||||
[prevent a task from running](/usage#prevent-unnecessary-work) if a given set
|
|
||||||
of files haven't changed since last run (based either on its timestamp or
|
|
||||||
content).
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
- If you're new to Task, we recommend taking a look at our [getting started
|
|
||||||
guide][getting-started] for an quick introduction.
|
|
||||||
- You can also browse our [usage documentation][usage] for more details on how
|
|
||||||
all the features work.
|
|
||||||
- Or use our quick reference documentation for the [Taskfile schema][schema] or
|
|
||||||
[CLI][cli].
|
|
||||||
|
|
||||||
## Gold Sponsors
|
|
||||||
|
|
||||||
<table class="gold-sponsors">
|
|
||||||
<tr>
|
|
||||||
<td align="center" valign="middle">
|
|
||||||
<a target="_blank" href="https://devowl.io">
|
|
||||||
<img src="/img/devowl.io.svg" height="100px" title="devowl.io" />
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[make]: https://www.gnu.org/software/make/
|
|
||||||
[go]: https://go.dev/
|
|
||||||
[yaml]: http://yaml.org/
|
|
||||||
[homebrew]: https://brew.sh/
|
|
||||||
[snapcraft]: https://snapcraft.io/
|
|
||||||
[scoop]: https://scoop.sh/
|
|
||||||
[sh]: https://github.com/mvdan/sh
|
|
||||||
[getting-started]: /getting-started/
|
|
||||||
[usage]: /usage/
|
|
||||||
[schema]: /reference/schema/
|
|
||||||
[cli]: /reference/cli/
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,2 +0,0 @@
|
|||||||
position: 5
|
|
||||||
label: Reference
|
|
@@ -1,121 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /reference/cli
|
|
||||||
sidebar_position: 1
|
|
||||||
---
|
|
||||||
|
|
||||||
# CLI Reference
|
|
||||||
|
|
||||||
Task CLI commands have the following syntax:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
task [--flags] [tasks...] [-- CLI_ARGS...]
|
|
||||||
```
|
|
||||||
|
|
||||||
:::tip
|
|
||||||
|
|
||||||
If `--` is given, all remaining arguments will be assigned to a special
|
|
||||||
`CLI_ARGS` variable
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Flags
|
|
||||||
|
|
||||||
| Short | Flag | Type | Default | Description |
|
|
||||||
| ----- | --------------------------- | -------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `-c` | `--color` | `bool` | `true` | Colored output. Enabled by default. Set flag to `false` or use `NO_COLOR=1` to disable. |
|
|
||||||
| `-C` | `--concurrency` | `int` | `0` | Limit number tasks to run concurrently. Zero means unlimited. |
|
|
||||||
| `-d` | `--dir` | `string` | Working directory | Sets the directory in which Task will execute and look for a Taskfile. |
|
|
||||||
| `-n` | `--dry` | `bool` | `false` | Compiles and prints tasks in the order that they would be run, without executing them. |
|
|
||||||
| `-x` | `--exit-code` | `bool` | `false` | Pass-through the exit code of the task command. |
|
|
||||||
| `-f` | `--force` | `bool` | `false` | Forces execution even when the task is up-to-date. |
|
|
||||||
| `-g` | `--global` | `bool` | `false` | Runs global Taskfile, from `$HOME/Taskfile.{yml,yaml}`. |
|
|
||||||
| `-h` | `--help` | `bool` | `false` | Shows Task usage. |
|
|
||||||
| `-i` | `--init` | `bool` | `false` | Creates a new Taskfile.yml in the current folder. |
|
|
||||||
| `-I` | `--interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
|
|
||||||
| `-l` | `--list` | `bool` | `false` | Lists tasks with description of current Taskfile. |
|
|
||||||
| `-a` | `--list-all` | `bool` | `false` | Lists tasks with or without a description. |
|
|
||||||
| | `--sort` | `string` | `default` | Changes the order of the tasks when listed.<br />`default` - Alphanumeric with root tasks first<br />`alphanumeric` - Alphanumeric<br />`none` - No sorting (As they appear in the Taskfile) |
|
|
||||||
| | `--json` | `bool` | `false` | See [JSON Output](#json-output) |
|
|
||||||
| `-o` | `--output` | `string` | Default set in the Taskfile or `interleaved` | Sets output style: [`interleaved`/`group`/`prefixed`]. |
|
|
||||||
| | `--output-group-begin` | `string` | | Message template to print before a task's grouped output. |
|
|
||||||
| | `--output-group-end` | `string` | | Message template to print after a task's grouped output. |
|
|
||||||
| | `--output-group-error-only` | `bool` | `false` | Swallow command output on zero exit code. |
|
|
||||||
| `-p` | `--parallel` | `bool` | `false` | Executes tasks provided on command line in parallel. |
|
|
||||||
| `-s` | `--silent` | `bool` | `false` | Disables echoing. |
|
|
||||||
| `-y` | `--yes` | `bool` | `false` | Assume "yes" as answer to all prompts. |
|
|
||||||
| | `--status` | `bool` | `false` | Exits with non-zero exit code if any of the given tasks is not up-to-date. |
|
|
||||||
| | `--summary` | `bool` | `false` | Show summary about a task. |
|
|
||||||
| `-t` | `--taskfile` | `string` | | Taskfile path to run.<br />Check the list of default filenames [here](../usage/#supported-file-names). |
|
|
||||||
| `-v` | `--verbose` | `bool` | `false` | Enables verbose mode. |
|
|
||||||
| | `--version` | `bool` | `false` | Show Task version. |
|
|
||||||
| `-w` | `--watch` | `bool` | `false` | Enables watch of the given task.
|
|
||||||
|
|
||||||
## Exit Codes
|
|
||||||
|
|
||||||
Task will sometimes exit with specific exit codes. These codes are split into
|
|
||||||
four groups with the following ranges:
|
|
||||||
|
|
||||||
- Success (0)
|
|
||||||
- General errors (1-99)
|
|
||||||
- Taskfile errors (100-199)
|
|
||||||
- Task errors (200-255)
|
|
||||||
|
|
||||||
A full list of the exit codes and their descriptions can be found below:
|
|
||||||
|
|
||||||
| Code | Description |
|
|
||||||
|------|---------------------------------------------------------------------|
|
|
||||||
| 0 | Success |
|
|
||||||
| 1 | An unknown error occurred |
|
|
||||||
| 100 | No Taskfile was found |
|
|
||||||
| 101 | A Taskfile already exists when trying to initialize one |
|
|
||||||
| 102 | The Taskfile is invalid or cannot be parsed |
|
|
||||||
| 103 | A remote Taskfile could not be downloaded |
|
|
||||||
| 104 | A remote Taskfile was not trusted by the user |
|
|
||||||
| 105 | A remote Taskfile was could not be fetched securely |
|
|
||||||
| 106 | No cache was found for a remote Taskfile in offline mode |
|
|
||||||
| 107 | No schema version was defined in the Taskfile |
|
|
||||||
| 200 | The specified task could not be found |
|
|
||||||
| 201 | An error occurred while executing a command inside of a task |
|
|
||||||
| 202 | The user tried to invoke a task that is internal |
|
|
||||||
| 203 | There a multiple tasks with the same name or alias |
|
|
||||||
| 204 | A task was called too many times |
|
|
||||||
| 205 | A task was cancelled by the user |
|
|
||||||
| 206 | A task was not executed due to missing required variables |
|
|
||||||
| 207 | A task was not executed due to a variable having an incorrect value |
|
|
||||||
|
|
||||||
These codes can also be found in the repository in
|
|
||||||
[`errors/errors.go`](https://github.com/go-task/task/blob/main/errors/errors.go).
|
|
||||||
|
|
||||||
:::info
|
|
||||||
|
|
||||||
When Task is run with the `-x`/`--exit-code` flag, the exit code of any failed
|
|
||||||
commands will be passed through to the user instead.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## JSON Output
|
|
||||||
|
|
||||||
When using the `--json` flag in combination with either the `--list` or
|
|
||||||
`--list-all` flags, the output will be a JSON object with the following
|
|
||||||
structure:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"tasks": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"task": "",
|
|
||||||
"desc": "",
|
|
||||||
"summary": "",
|
|
||||||
"up_to_date": false,
|
|
||||||
"location": {
|
|
||||||
"line": 54,
|
|
||||||
"column": 3,
|
|
||||||
"taskfile": "/path/to/Taskfile.yml"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// ...
|
|
||||||
],
|
|
||||||
"location": "/path/to/Taskfile.yml"
|
|
||||||
}
|
|
||||||
```
|
|
@@ -1,49 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /reference/environment
|
|
||||||
sidebar_position: 5
|
|
||||||
---
|
|
||||||
|
|
||||||
# Environment Reference
|
|
||||||
|
|
||||||
Task allows you to configure some behavior using environment variables. This
|
|
||||||
page lists all the environment variables that Task supports.
|
|
||||||
|
|
||||||
| ENV | Default | Description |
|
|
||||||
|-------------------|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `TASK_TEMP_DIR` | `.task` | Location of the temp dir. Can relative to the project like `tmp/task` or absolute like `/tmp/.task` or `~/.task`. |
|
|
||||||
| `TASK_REMOTE_DIR` | `TASK_TEMP_DIR` | Location of the remote temp dir (used for caching). Can relative to the project like `tmp/task` or absolute like `/tmp/.task` or `~/.task`. |
|
|
||||||
| `TASK_OFFLINE` | `false` | Set the `--offline` flag through the environment variable. Only for remote experiment. CLI flag `--offline` takes precedence over the env variable |
|
|
||||||
| `FORCE_COLOR` | | Force color output usage. |
|
|
||||||
|
|
||||||
## Custom Colors
|
|
||||||
|
|
||||||
| ENV | Default | Description |
|
|
||||||
|-----------------------------|---------|-------------------------|
|
|
||||||
| `TASK_COLOR_RESET` | `0` | Color used for white. |
|
|
||||||
| `TASK_COLOR_RED` | `31` | Color used for red. |
|
|
||||||
| `TASK_COLOR_GREEN` | `32` | Color used for green. |
|
|
||||||
| `TASK_COLOR_YELLOW` | `33` | Color used for yellow. |
|
|
||||||
| `TASK_COLOR_BLUE` | `34` | Color used for blue. |
|
|
||||||
| `TASK_COLOR_MAGENTA` | `35` | Color used for magenta. |
|
|
||||||
| `TASK_COLOR_CYAN` | `36` | Color used for cyan. |
|
|
||||||
| `TASK_COLOR_BRIGHT_RED` | `91` | Color used for red. |
|
|
||||||
| `TASK_COLOR_BRIGHT_GREEN` | `92` | Color used for green. |
|
|
||||||
| `TASK_COLOR_BRIGHT_YELLOW` | `93` | Color used for yellow. |
|
|
||||||
| `TASK_COLOR_BRIGHT_BLUE` | `94` | Color used for blue. |
|
|
||||||
| `TASK_COLOR_BRIGHT_MAGENTA` | `95` | Color used for magenta. |
|
|
||||||
| `TASK_COLOR_BRIGHT_CYAN` | `96` | Color used for cyan. |
|
|
||||||
|
|
||||||
All color variables are [ANSI color codes][ansi]. You can specify multiple codes
|
|
||||||
separated by a semicolon. For example: `31;1` will make the text bold and red.
|
|
||||||
Task also supports 8-bit color (256 colors). You can specify these colors by
|
|
||||||
using the sequence `38;2;R:G:B` for foreground colors and `48;2;R:G:B` for
|
|
||||||
background colors where `R`, `G` and `B` should be replaced with values between
|
|
||||||
0 and 255.
|
|
||||||
|
|
||||||
For convenience, we allow foreground colors to be specified using shorthand,
|
|
||||||
comma-separated syntax: `R,G,B`. For example, `255,0,0` is equivalent to
|
|
||||||
`38;2;255:0:0`.
|
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[ansi]: https://en.wikipedia.org/wiki/ANSI_escape_code
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,242 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /reference/schema
|
|
||||||
sidebar_position: 3
|
|
||||||
toc_min_heading_level: 2
|
|
||||||
toc_max_heading_level: 5
|
|
||||||
---
|
|
||||||
|
|
||||||
# Schema Reference
|
|
||||||
|
|
||||||
| Attribute | Type | Default | Description |
|
|
||||||
|------------|------------------------------------|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `version` | `string` | | Version of the Taskfile. The current version is `3`. |
|
|
||||||
| `output` | `string` | `interleaved` | Output mode. Available options: `interleaved`, `group` and `prefixed`. |
|
|
||||||
| `method` | `string` | `checksum` | Default method in this Taskfile. Can be overridden in a task by task basis. Available options: `checksum`, `timestamp` and `none`. |
|
|
||||||
| `includes` | [`map[string]Include`](#include) | | Additional Taskfiles to be included. |
|
|
||||||
| `vars` | [`map[string]Variable`](#variable) | | A set of global variables. |
|
|
||||||
| `env` | [`map[string]Variable`](#variable) | | A set of global environment variables. |
|
|
||||||
| `tasks` | [`map[string]Task`](#task) | | A set of task definitions. |
|
|
||||||
| `silent` | `bool` | `false` | Default 'silent' options for this Taskfile. If `false`, can be overridden with `true` in a task by task basis. |
|
|
||||||
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
|
|
||||||
| `run` | `string` | `always` | Default 'run' option for this Taskfile. Available options: `always`, `once` and `when_changed`. |
|
|
||||||
| `interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). |
|
|
||||||
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
|
|
||||||
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
|
|
||||||
|
|
||||||
## Include
|
|
||||||
|
|
||||||
| Attribute | Type | Default | Description |
|
|
||||||
|------------|-----------------------|-------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `taskfile` | `string` | | The path for the Taskfile or directory to be included. If a directory, Task will look for files named `Taskfile.yml` or `Taskfile.yaml` inside that directory. If a relative path, resolved relative to the directory containing the including Taskfile. |
|
|
||||||
| `dir` | `string` | The parent Taskfile directory | The working directory of the included tasks when run. |
|
|
||||||
| `optional` | `bool` | `false` | If `true`, no errors will be thrown if the specified file does not exist. |
|
|
||||||
| `flatten` | `bool` | `false` | If `true`, the tasks from the included Taskfile will be available in the including Taskfile without a namespace. If a task with the same name already exists in the including Taskfile, an error will be thrown. |
|
|
||||||
| `internal` | `bool` | `false` | Stops any task in the included Taskfile from being callable on the command line. These commands will also be omitted from the output when used with `--list`. |
|
|
||||||
| `aliases` | `[]string` | | Alternative names for the namespace of the included Taskfile. |
|
|
||||||
| `vars` | `map[string]Variable` | | A set of variables to apply to the included Taskfile. |
|
|
||||||
| `checksum` | `string` | | The checksum of the file you expect to include. If the checksum does not match, the file will not be included. |
|
|
||||||
|
|
||||||
:::info
|
|
||||||
|
|
||||||
Informing only a string like below is equivalent to setting that value to the
|
|
||||||
`taskfile` attribute.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
includes:
|
|
||||||
foo: ./path
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Variable
|
|
||||||
|
|
||||||
| Attribute | Type | Default | Description |
|
|
||||||
| --------- | -------- | ------- | ------------------------------------------------------------------------ |
|
|
||||||
| _itself_ | `string` | | A static value that will be set to the variable. |
|
|
||||||
| `sh` | `string` | | A shell command. The output (`STDOUT`) will be assigned to the variable. |
|
|
||||||
|
|
||||||
:::info
|
|
||||||
|
|
||||||
Static and dynamic variables have different syntaxes, like below:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
vars:
|
|
||||||
STATIC: static
|
|
||||||
DYNAMIC:
|
|
||||||
sh: echo "dynamic"
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
:::info
|
|
||||||
|
|
||||||
In a variables map, variables defined later may reference variables defined
|
|
||||||
earlier (declaration order is respected):
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
vars:
|
|
||||||
FIRST_VAR: "hello"
|
|
||||||
SECOND_VAR: "{{.FIRST_VAR}} world"
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Task
|
|
||||||
|
|
||||||
| Attribute | Type | Default | Description |
|
|
||||||
| --------------- | ---------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `cmds` | [`[]Command`](#command) | | A list of shell commands to be executed. |
|
|
||||||
| `deps` | [`[]Dependency`](#dependency) | | A list of dependencies of this task. Tasks defined here will run in parallel before this task. |
|
|
||||||
| `label` | `string` | | Overrides the name of the task in the output when a task is run. Supports variables. |
|
|
||||||
| `desc` | `string` | | A short description of the task. This is displayed when calling `task --list`. |
|
|
||||||
| `prompt` | `[]string` | | One or more prompts that will be presented before a task is run. Declining will cancel running the current and any subsequent tasks. |
|
|
||||||
| `summary` | `string` | | A longer description of the task. This is displayed when calling `task --summary [task]`. |
|
|
||||||
| `aliases` | `[]string` | | A list of alternative names by which the task can be called. |
|
|
||||||
| `sources` | `[]string` | | A list of sources to check before running this task. Relevant for `checksum` and `timestamp` methods. Can be file paths or star globs. |
|
|
||||||
| `generates` | `[]string` | | A list of files meant to be generated by this task. Relevant for `timestamp` method. Can be file paths or star globs. |
|
|
||||||
| `status` | `[]string` | | A list of commands to check if this task should run. The task is skipped otherwise. This overrides `method`, `sources` and `generates`. |
|
|
||||||
| `preconditions` | [`[]Precondition`](#precondition) | | A list of commands to check if this task should run. If a condition is not met, the task will error. |
|
|
||||||
| `requires` | [`Requires`](#requires) | | A list of required variables which should be set if this task is to run, if any variables listed are unset the task will error and not run. |
|
|
||||||
| `dir` | `string` | | The directory in which this task should run. Defaults to the current working directory. |
|
|
||||||
| `vars` | [`map[string]Variable`](#variable) | | A set of variables that can be used in the task. |
|
|
||||||
| `env` | [`map[string]Variable`](#variable) | | A set of environment variables that will be made available to shell commands. |
|
|
||||||
| `dotenv` | `[]string` | | A list of `.env` file paths to be parsed. |
|
|
||||||
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. When combined with the `--list` flag, task descriptions will be hidden. |
|
|
||||||
| `interactive` | `bool` | `false` | Tells task that the command is interactive. |
|
|
||||||
| `internal` | `bool` | `false` | Stops a task from being callable on the command line. It will also be omitted from the output when used with `--list`. |
|
|
||||||
| `method` | `string` | `checksum` | Defines which method is used to check the task is up-to-date. `timestamp` will compare the timestamp of the sources and generates files. `checksum` will check the checksum (You probably want to ignore the .task folder in your .gitignore file). `none` skips any validation and always run the task. |
|
|
||||||
| `prefix` | `string` | | Defines a string to prefix the output of tasks running in parallel. Only used when the output mode is `prefixed`. |
|
|
||||||
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing commands. |
|
|
||||||
| `run` | `string` | The one declared globally in the Taskfile or `always` | Specifies whether the task should run again or not if called more than once. Available options: `always`, `once` and `when_changed`. |
|
|
||||||
| `platforms` | `[]string` | All platforms | Specifies which platforms the task should be run on. [Valid GOOS and GOARCH values allowed](https://github.com/golang/go/blob/master/src/internal/syslist/syslist.go). Task will be skipped otherwise. |
|
|
||||||
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
|
|
||||||
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
|
|
||||||
|
|
||||||
:::info
|
|
||||||
|
|
||||||
These alternative syntaxes are available. They will set the given values to
|
|
||||||
`cmds` and everything else will be set to their default values:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
tasks:
|
|
||||||
foo: echo "foo"
|
|
||||||
|
|
||||||
foobar:
|
|
||||||
- echo "foo"
|
|
||||||
- echo "bar"
|
|
||||||
|
|
||||||
baz:
|
|
||||||
cmd: echo "baz"
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
### Command
|
|
||||||
|
|
||||||
| Attribute | Type | Default | Description |
|
|
||||||
| -------------- | ---------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `cmd` | `string` | | The shell command to be executed. |
|
|
||||||
| `task` | `string` | | Set this to trigger execution of another task instead of running a command. This cannot be set together with `cmd`. |
|
|
||||||
| `for` | [`For`](#for) | | Runs the command once for each given value. |
|
|
||||||
| `silent` | `bool` | `false` | Skips some output for this command. Note that STDOUT and STDERR of the commands will still be redirected. |
|
|
||||||
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to the referenced task. Only relevant when setting `task` instead of `cmd`. |
|
|
||||||
| `ignore_error` | `bool` | `false` | Continue execution if errors happen while executing the command. |
|
|
||||||
| `defer` | [`Defer`](#defer) | | Alternative to `cmd`, but schedules the command or a task to be executed at the end of this task instead of immediately. This cannot be used together with `cmd`. |
|
|
||||||
| `platforms` | `[]string` | All platforms | Specifies which platforms the command should be run on. [Valid GOOS and GOARCH values allowed](https://github.com/golang/go/blob/master/src/internal/syslist/syslist.go). Command will be skipped otherwise. |
|
|
||||||
| `set` | `[]string` | | Specify options for the [`set` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html). |
|
|
||||||
| `shopt` | `[]string` | | Specify option for the [`shopt` builtin](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html). |
|
|
||||||
|
|
||||||
:::info
|
|
||||||
|
|
||||||
If given as a a string, the value will be assigned to `cmd`:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
tasks:
|
|
||||||
foo:
|
|
||||||
cmds:
|
|
||||||
- echo "foo"
|
|
||||||
- echo "bar"
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
### Dependency
|
|
||||||
|
|
||||||
| Attribute | Type | Default | Description |
|
|
||||||
| --------- | ---------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `task` | `string` | | The task to be execute as a dependency. |
|
|
||||||
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to this task. |
|
|
||||||
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. |
|
|
||||||
|
|
||||||
:::tip
|
|
||||||
|
|
||||||
If you don't want to set additional variables, it's enough to declare the
|
|
||||||
dependency as a list of strings (they will be assigned to `task`):
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
tasks:
|
|
||||||
foo:
|
|
||||||
deps: [foo, bar]
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
### Defer
|
|
||||||
|
|
||||||
The `defer` parameter defines a shell command to run, or a task to trigger, at the end of the current task instead of immediately.
|
|
||||||
If defined as a string this is a shell command, otherwise it is a map defining a task to call:
|
|
||||||
|
|
||||||
| Attribute | Type | Default | Description |
|
|
||||||
| --------- | ---------------------------------- | ------- | ----------------------------------------------------------------- |
|
|
||||||
| `task` | `string` | | The deferred task to trigger. |
|
|
||||||
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to the deferred task. |
|
|
||||||
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. |
|
|
||||||
|
|
||||||
### For
|
|
||||||
|
|
||||||
The `for` parameter can be defined as a string, a list of strings or a map. If
|
|
||||||
it is defined as a string, you can give it any of the following values:
|
|
||||||
|
|
||||||
- `sources` - Will run the command for each source file defined on the task.
|
|
||||||
(Glob patterns will be resolved, so `*.go` will run for every Go file that
|
|
||||||
matches).
|
|
||||||
- `generates` - Will run the command for each file defined in the task's generates
|
|
||||||
list. (Glob patterns will be resolved, so `*.txt` will run for every text file
|
|
||||||
that matches).
|
|
||||||
|
|
||||||
If it is defined as a list of strings, the command will be run for each value.
|
|
||||||
|
|
||||||
Finally, the `for` parameter can be defined as a map when you want to use a
|
|
||||||
variable to define the values to loop over:
|
|
||||||
|
|
||||||
| Attribute | Type | Default | Description |
|
|
||||||
| --------- | -------- | ---------------- | -------------------------------------------- |
|
|
||||||
| `var` | `string` | | The name of the variable to use as an input. |
|
|
||||||
| `split` | `string` | (any whitespace) | What string the variable should be split on. |
|
|
||||||
| `as` | `string` | `ITEM` | The name of the iterator variable. |
|
|
||||||
|
|
||||||
### Precondition
|
|
||||||
|
|
||||||
| Attribute | Type | Default | Description |
|
|
||||||
| --------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------ |
|
|
||||||
| `sh` | `string` | | Command to be executed. If a non-zero exit code is returned, the task errors without executing its commands. |
|
|
||||||
| `msg` | `string` | | Optional message to print if the precondition isn't met. |
|
|
||||||
|
|
||||||
:::tip
|
|
||||||
|
|
||||||
If you don't want to set a different message, you can declare a precondition
|
|
||||||
like this and the value will be assigned to `sh`:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
tasks:
|
|
||||||
foo:
|
|
||||||
precondition: test -f Taskfile.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
### Requires
|
|
||||||
|
|
||||||
| Attribute | Type | Default | Description |
|
|
||||||
| --------- | ---------- | ------- | -------------------------------------------------------------------------------------------------- |
|
|
||||||
| `vars` | `[]string` | | List of variable or environment variable names that must be set if this task is to execute and run |
|
|
@@ -1,426 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /reference/templating/
|
|
||||||
sidebar_position: 4
|
|
||||||
toc_min_heading_level: 2
|
|
||||||
toc_max_heading_level: 5
|
|
||||||
---
|
|
||||||
|
|
||||||
# Templating Reference
|
|
||||||
|
|
||||||
Task's templating engine uses Go's [text/template][text/template] package to
|
|
||||||
interpolate values. For detailed information about the usage of Go's templating
|
|
||||||
engine, we recommend reading [the official documentation][text/template].
|
|
||||||
However, we will provide a basic overview of the main features here.
|
|
||||||
|
|
||||||
## Basic Usage
|
|
||||||
|
|
||||||
Most string values in Task (though, not all) can be templated. The templating
|
|
||||||
engine uses double curly braces `{{` and `}}` to denote a template. Anything
|
|
||||||
inside the curly braces will be executed as a Go template and the result will be
|
|
||||||
inserted into the resulting string. For example:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
hello:
|
|
||||||
vars:
|
|
||||||
MESSAGE: 'Hello, World!'
|
|
||||||
cmds:
|
|
||||||
- 'echo {{.MESSAGE}}'
|
|
||||||
```
|
|
||||||
|
|
||||||
In this example, we have a task called `hello` with a single variable, `MESSAGE`
|
|
||||||
defined. When the command is run, the templating engine will evaluate the
|
|
||||||
variable and replace `{{.MESSAGE}}` with the variable's contents. This task will
|
|
||||||
output `Hello, World!` to the terminal. Note that when referring to a variable,
|
|
||||||
you must use dot notation.
|
|
||||||
|
|
||||||
You are also able to do more complex things in templates, such as conditional
|
|
||||||
logic:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
maybe-happy:
|
|
||||||
vars:
|
|
||||||
SMILE: ':\)'
|
|
||||||
FROWN: ':\('
|
|
||||||
HAPPY: true
|
|
||||||
cmds:
|
|
||||||
- 'echo {{if .HAPPY}}{{.SMILE}}{{else}}{{.FROWN}}{{end}}'
|
|
||||||
```
|
|
||||||
|
|
||||||
```txt
|
|
||||||
:)
|
|
||||||
```
|
|
||||||
|
|
||||||
...calling functions and piping values:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
uniq:
|
|
||||||
vars:
|
|
||||||
NUMBERS: '0,1,1,1,2,2,3'
|
|
||||||
cmds:
|
|
||||||
- 'echo {{splitList "," .NUMBERS | uniq | join ", " }}!'
|
|
||||||
```
|
|
||||||
|
|
||||||
```txt
|
|
||||||
0, 1, 2, 3
|
|
||||||
```
|
|
||||||
|
|
||||||
...looping over values with control flow operators:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
loop:
|
|
||||||
vars:
|
|
||||||
NUMBERS: [0, 1, 1, 1, 2, 2, 3]
|
|
||||||
cmds:
|
|
||||||
# Ranges over NUMBERS and prints the index and value of each number until it finds a number greater than 1
|
|
||||||
- "{{range $index, $num := .NUMBERS}}{{if gt $num 1 }}{{break}}{{end}}echo {{$index}}: {{$num}}\n{{end}}"
|
|
||||||
```
|
|
||||||
|
|
||||||
```txt
|
|
||||||
0: 0
|
|
||||||
1: 1
|
|
||||||
2: 1
|
|
||||||
3: 1
|
|
||||||
```
|
|
||||||
|
|
||||||
## Special Variables
|
|
||||||
|
|
||||||
Task defines some special variables that are always available to the templating
|
|
||||||
engine. If you define a variable with the same name as a special variable, the
|
|
||||||
special variable will be overridden.
|
|
||||||
|
|
||||||
| Var | Description |
|
|
||||||
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `CLI_ARGS` | Contain all extra arguments passed after `--` when calling Task through the CLI as a string. |
|
|
||||||
| `CLI_ARGS_LIST` | Contain all extra arguments passed after `--` when calling Task through the CLI as a shell parsed list. |
|
|
||||||
| `CLI_FORCE` | A boolean containing whether the `--force` or `--force-all` flags were set. |
|
|
||||||
| `CLI_SILENT` | A boolean containing whether the `--silent` flag was set. |
|
|
||||||
| `CLI_VERBOSE` | A boolean containing whether the `--verbose` flag was set. |
|
|
||||||
| `CLI_OFFLINE` | A boolean containing whether the `--offline` flag was set. |
|
|
||||||
| `TASK` | The name of the current task. |
|
|
||||||
| `ALIAS` | The alias used for the current task, otherwise matches `TASK`. |
|
|
||||||
| `TASK_EXE` | The Task executable name or path. |
|
|
||||||
| `ROOT_TASKFILE` | The absolute path of the root Taskfile. |
|
|
||||||
| `ROOT_DIR` | The absolute path of the root Taskfile directory. |
|
|
||||||
| `TASKFILE` | The absolute path of the included Taskfile. |
|
|
||||||
| `TASKFILE_DIR` | The absolute path of the included Taskfile directory. |
|
|
||||||
| `TASK_DIR` | The absolute path of the directory where the task is executed. |
|
|
||||||
| `USER_WORKING_DIR` | The absolute path of the directory `task` was called from. |
|
|
||||||
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
|
|
||||||
| `TIMESTAMP` | The date object of the greatest timestamp of the files listed in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
|
|
||||||
| `TASK_VERSION` | The current version of task. |
|
|
||||||
| `ITEM` | The value of the current iteration when using the `for` property. Can be changed to a different variable name using `as:`. |
|
|
||||||
| `EXIT_CODE` | Available exclusively inside the `defer:` command. Contains the failed command exit code. Only set when non-zero. |
|
|
||||||
|
|
||||||
## Functions
|
|
||||||
|
|
||||||
Functions are provided at a few different levels in Task. Below, we list all the
|
|
||||||
functions available for use in Task.
|
|
||||||
|
|
||||||
:::note
|
|
||||||
|
|
||||||
Functions marked with an asterisk (\*) also have `must` variants that will panic
|
|
||||||
rather than erroring.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
### Built-in Functions
|
|
||||||
|
|
||||||
The first set of functions are [provided by Golang
|
|
||||||
itself][go-template-functions]:
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `and` | Returns the boolean AND of its arguments by returning the first empty argument or the last argument. That is, `and x y` behaves as `if x then y else x`. Evaluation proceeds through the arguments left to right and returns when the result is determined. |
|
|
||||||
| `call` | Returns the result of calling the first argument, which must be a function, with the remaining arguments as parameters. Thus `call .X.Y 1 2` is, in Go notation, `dot.X.Y(1, 2)` where `Y` is a func-valued field, map entry, or the like. The first argument must be the result of an evaluation that yields a value of function type (as distinct from a predefined function such as print). The function must return either one or two result values, the second of which is of type error. If the arguments don't match the function or the returned error value is non-nil, execution stops. |
|
|
||||||
| `html` | Returns the escaped HTML equivalent of the textual representation of its arguments. This function is unavailable in [html/template][html/template], with a few exceptions. |
|
|
||||||
| `index` | Returns the result of indexing its first argument by the following arguments. Thus `index x 1 2 3` is, in Go syntax, `x[1][2][3]`. Each indexed item must be a map, slice, or array. |
|
|
||||||
| `slice` | slice returns the result of slicing its first argument by the remaining arguments. Thus `slice x 1 2` is, in Go syntax, `x[1:2]`, while `slice x` is `x[:]`, `slice x 1` is `x[1:]`, and `slice x 1 2 3` is `x[1:2:3]`. The first argument must be a string, slice, or array. |
|
|
||||||
| `js` | Returns the escaped JavaScript equivalent of the textual representation of its arguments. |
|
|
||||||
| `len` | Returns the integer length of its argument. |
|
|
||||||
| `not` | Returns the boolean negation of its single argument. |
|
|
||||||
| `or` | Returns the boolean OR of its arguments by returning the first non-empty argument or the last argument, that is, `or x y` behaves as `if x then x else y`. Evaluation proceeds through the arguments left to right and returns when the result is determined. |
|
|
||||||
| `print` | An alias for `fmt.Sprint`. |
|
|
||||||
| `printf` | An alias for `fmt.Sprintf`. |
|
|
||||||
| `println` | An alias for `fmt.Sprintln`. |
|
|
||||||
| `urlquery` | Returns the escaped value of the textual representation of its arguments in a form suitable for embedding in a URL query. This function is unavailable in [html/template][html/template], with a few exceptions. |
|
|
||||||
|
|
||||||
### Slim-Sprig Functions
|
|
||||||
|
|
||||||
In addition to the built-in functions, Task also provides a set of functions
|
|
||||||
imported via the [slim-sprig][slim-sprig] package. We only provide a very basic
|
|
||||||
description here for completeness. For detailed usage, please refer to the
|
|
||||||
[slim-sprig documentation][slim-sprig]:
|
|
||||||
|
|
||||||
#### [String Functions][string-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `trim` | Removes space from either side of a string. |
|
|
||||||
| `trimAll` | Removes given characters from the front or back of a string. |
|
|
||||||
| `trimSuffix` | Trims just the suffix from a string. |
|
|
||||||
| `trimPrefix` | Trims just the prefix from a string. |
|
|
||||||
| `upper` | Converts the entire string to uppercase. |
|
|
||||||
| `lower` | Converts the entire string to lowercase. |
|
|
||||||
| `title` | Converts to title case. |
|
|
||||||
| `repeat` | Repeats a string multiple times. |
|
|
||||||
| `substr` | Gets a substring from a string. |
|
|
||||||
| `trunc` | Truncates a string. |
|
|
||||||
| `contains` | Tests to see if one string is contained inside of another. |
|
|
||||||
| `hasPrefix` | Tests whether a string has a given prefix. |
|
|
||||||
| `hasSuffix` | Tests whether a string has a given suffix. |
|
|
||||||
| `quote` | Wraps a string in double quotes. |
|
|
||||||
| `squote` | Wraps a string in single quotes. |
|
|
||||||
| `cat` | Concatenates multiple strings together into one, separating them with spaces. |
|
|
||||||
| `indent` | Indents every line in a given string to the specified indent width. |
|
|
||||||
| `nindent` | Identical to `indent`, but prepends a new line to the beginning of the string. |
|
|
||||||
| `replace` | Replaces a string. |
|
|
||||||
| `plural` | Pluralizes a string. |
|
|
||||||
| `regexMatch`\* | Returns true if the input string contains any match of the regular expression. |
|
|
||||||
| `regexFindAll`\* | Returns a slice of all matches of the regular expression in the input string. |
|
|
||||||
| `regexFind`\* | Returns the first (left most) match of the regular expression in the input string. |
|
|
||||||
| `regexReplaceAll`\* | Returns a copy of the input string, replacing matches of the Regexp with the replacement string replacement. |
|
|
||||||
| `regexReplaceAllLiteral`\* | Returns a copy of the input string, replacing matches of the Regexp with the replacement string replacement without expanding `$`. |
|
|
||||||
| `regexSplit`\* | Slices the input string into substrings separated by the expression and returns a slice of the substrings between those expression matches. |
|
|
||||||
| `regexQuoteMeta`\* | Returns a string that escapes all regular expression metacharacters inside the argument text. |
|
|
||||||
|
|
||||||
#### [String Slice Functions][string-list-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ----------- | ----------------------------------------------------------------------- |
|
|
||||||
| `join` | Joins a list of strings into a single string, with the given separator. |
|
|
||||||
| `splitList` | Splits a string into a list of strings. |
|
|
||||||
| `split` | Splits a string into a map of strings where each key is an index. |
|
|
||||||
| `splitn` | Identical to `split`, but stops splitting after `n` values. |
|
|
||||||
| `sortAlpha` | Sorts a list of strings into alphabetical (lexicographical) order. |
|
|
||||||
|
|
||||||
#### [Integer Functions][math-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| --------- | ------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `add` | Sum a set of numbers. |
|
|
||||||
| `add1` | Increments a number by 1. |
|
|
||||||
| `sub` | Subtracts one number from another. |
|
|
||||||
| `div` | Performs integer division. |
|
|
||||||
| `mod` | Modulo. |
|
|
||||||
| `mul` | Multiplies a set of numbers. |
|
|
||||||
| `max` | Returns the largest of a set of integers. |
|
|
||||||
| `min` | Returns the smallest of a set of integers. |
|
|
||||||
| `floor` | Returns the greatest float value less than or equal to input value |
|
|
||||||
| `ceil` | Returns the greatest float value greater than or equal to input value |
|
|
||||||
| `round` | Returns a float value with the remainder rounded to the given number to digits after the decimal point. |
|
|
||||||
| `randInt` | Returns a random integer value from min (inclusive) to max (exclusive). |
|
|
||||||
|
|
||||||
#### [Integer Slice Functions][integer-list-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ----------- | --------------------------------------------------------------------------- |
|
|
||||||
| `until` | Builds a range of integers. |
|
|
||||||
| `untilStep` | Builds a range of integers, but allows you to define a start, stop and step |
|
|
||||||
| `seq` | Works like the bash `seq` command. |
|
|
||||||
|
|
||||||
#### [Date Functions][date-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ---------------- | ------------------------------------------------------------------------------ |
|
|
||||||
| `now` | Gets the current date/time. |
|
|
||||||
| `ago` | Returns the duration since the given date/time. |
|
|
||||||
| `date` | Formats a date. |
|
|
||||||
| `dateInZone` | Identical to `date`, but with the given timezone. |
|
|
||||||
| `duration` | Formats the number of seconds into a string. |
|
|
||||||
| `durationRound` | Identical to `duration`, but rounds the duration to the most significant unit. |
|
|
||||||
| `unixEpoch` | Returns the seconds since the unix epoch for the given date/time. |
|
|
||||||
| `dateModify`\* | Modifies a date using the given input string. |
|
|
||||||
| `htmlDate` | Formats a date for inserting into an HTML date picker input field. |
|
|
||||||
| `htmlDateInZone` | Identical to `htmlDate`, but with the given timezone. |
|
|
||||||
| `toDate`\* | Converts a string to a date/time. |
|
|
||||||
|
|
||||||
#### [Default Functions][default-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ---------- | ------------------------------------------------------------------------ |
|
|
||||||
| `default` | Uses a default value if the given value is considered "zero" or "empty". |
|
|
||||||
| `empty` | Returns true if a value is considered "zero" or "empty". |
|
|
||||||
| `coalesce` | Takes a list of values and returns the first non-empty one. |
|
|
||||||
| `all` | Returns true if all values are non-empty. |
|
|
||||||
| `any` | Returns true if any value is non-empty. |
|
|
||||||
| `ternary` | The ternary function takes two values, and a test value. If the test value is true, the first value will be returned. If the test value is empty, the second value will be returned. |
|
|
||||||
|
|
||||||
#### [Encoding Functions][encoding-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ---------------- | ------------------------------------------------------------------ |
|
|
||||||
| `fromJson`\* | Decodes a JSON string into an object. |
|
|
||||||
| `toJson`\* | Encodes an object as a JSON string. |
|
|
||||||
| `toPrettyJson`\* | Encodes an object as a JSON string with new lines and indentation. |
|
|
||||||
| `toRawJson`\* | Encodes an object as a JSON string with HTML characters unescaped. |
|
|
||||||
| `b64enc` | Encodes a string into base 64. |
|
|
||||||
| `b64dec` | Decodes a string from base 64. |
|
|
||||||
| `b32enc` | Encodes a string into base 32. |
|
|
||||||
| `b32dec` | Decodes a string from base 32. |
|
|
||||||
|
|
||||||
:::note
|
|
||||||
YAML encoding functions are [provided directly by Task](#task-functions).
|
|
||||||
:::
|
|
||||||
|
|
||||||
#### [List Functions][list-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ----------- | ---------------------------------------------------------------- |
|
|
||||||
| `list` | Creates a list from a set of values. |
|
|
||||||
| `first`\* | Gets the first value in a list. |
|
|
||||||
| `rest`\* | Gets all values except the first value in the list. |
|
|
||||||
| `last`\* | Gets the last value in the list. |
|
|
||||||
| `initial`\* | Get all values except the last value in the list. |
|
|
||||||
| `append`\* | Adds a new value to the end of the list. |
|
|
||||||
| `prepend`\* | Adds a new value to the start of the list. |
|
|
||||||
| `concat` | Joins two or more lists together. |
|
|
||||||
| `reverse`\* | Reverses the order of a list. |
|
|
||||||
| `uniq`\* | Generate a list with all of the duplicates removed. |
|
|
||||||
| `without`\* | Filters matching items out of a list. |
|
|
||||||
| `has`\* | Tests to see if a list has a particular element. |
|
|
||||||
| `compact`\* | Removes entries with empty values. |
|
|
||||||
| `slice`\* | Returns a partial copy of a list given start and end parameters. |
|
|
||||||
| `chunk` | Splits a list into chunks of given size. |
|
|
||||||
|
|
||||||
#### [Dictionary Functions][dictionary-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ------------------ | ------------------------------------------------------------------------------------------ |
|
|
||||||
| `dict` | Creates a dictionary from a set of key/value pairs. |
|
|
||||||
| `get` | Gets the value from the dictionary with the given key. |
|
|
||||||
| `set` | Adds a new key/value pair to a dictionary. |
|
|
||||||
| `unset` | Deletes a key from a dictionary. |
|
|
||||||
| `hasKey` | Returns true if a dictionary contains the given key. |
|
|
||||||
| `pluck` | Gets a list of all of the matching values in a set of maps given a key. |
|
|
||||||
| `dig` | Returns the value in a nested map given a path of keys. |
|
|
||||||
| `merge`\* | Merges two or more dictionaries into one. |
|
|
||||||
| `mergeOverwrite`\* | Identical to `merge`, but giving precedence from right to left. |
|
|
||||||
| `keys` | Returns a list of all of the keys in a dictionary. |
|
|
||||||
| `pick` | Creates a new dictionary containing only the given keys of an existing map. |
|
|
||||||
| `omit` | Creates a new dictionary containing all the keys of an existing map except the ones given. |
|
|
||||||
| `values` | Returns a list of all the values in a dictionary. |
|
|
||||||
|
|
||||||
#### [Type Conversion Functions][type-conversion-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ----------- | ------------------------------------------------------ |
|
|
||||||
| `atoi` | Converts a string to an integer. |
|
|
||||||
| `float64` | Converts to a float64. |
|
|
||||||
| `int` | Converts to an int at the system's width. |
|
|
||||||
| `int64` | Converts to an int64. |
|
|
||||||
| `toDecimal` | Converts a unix octal to a int64. |
|
|
||||||
| `toString` | Converts to a string. |
|
|
||||||
| `toStrings` | Converts a list, slice, or array to a list of strings. |
|
|
||||||
| `toStrings` | Produces a slice of strings from any list. |
|
|
||||||
| `toDecimal` | Given a unix octal permission, produce a decimal. |
|
|
||||||
|
|
||||||
#### [Path and Filepath Functions][path-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| --------- | ----------------------------------------- |
|
|
||||||
| `base` | Returns the last element of a path. |
|
|
||||||
| `dir` | Returns the directory of a path. |
|
|
||||||
| `clean` | Cleans up a path. |
|
|
||||||
| `ext` | Returns the file extension of a path. |
|
|
||||||
| `isAbs` | Checks if a path is absolute. |
|
|
||||||
| `osBase` | Returns the last element of a filepath. |
|
|
||||||
| `osDir` | Returns the directory of a filepath. |
|
|
||||||
| `osClean` | Cleans up a filepath. |
|
|
||||||
| `osExt` | Returns the file extension of a filepath. |
|
|
||||||
| `osIsAbs` | Checks if a filepath is absolute. |
|
|
||||||
|
|
||||||
:::note
|
|
||||||
More filepath encoding functions are [provided directly by Task](#task-functions).
|
|
||||||
:::
|
|
||||||
|
|
||||||
#### [Flow Control Functions][flow-control-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| -------- | ----------------------------------------------------------------------------- |
|
|
||||||
| `fail` | Unconditionally returns an empty string and an error with the specified text. |
|
|
||||||
|
|
||||||
#### [OS Functions][os-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ----------- | --------------------------------------------- |
|
|
||||||
| `env` | Reads an environment variable. |
|
|
||||||
| `expandenv` | Substitutes environment variables in a string |
|
|
||||||
|
|
||||||
#### [Reflection Functions][reflection-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ------------ | ------------------------------------------------------ |
|
|
||||||
| `kindOf` | Returns the kind of a value. |
|
|
||||||
| `kindIs` | Verifies that a value is a particular kind. |
|
|
||||||
| `typeOf` | Returns the underlying type of a value. |
|
|
||||||
| `typeIs` | Verifies that a value is of a particular type. |
|
|
||||||
| `typeIsLike` | Identical to `typeIs`, but also dereferences pointers. |
|
|
||||||
| `deepEqual` | Returns true if two values are "deeply equal". |
|
|
||||||
|
|
||||||
#### [Cryptographic and Security Functions][crypto-functions]
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ------------ | -------------------------------------- |
|
|
||||||
| `sha1sum` | Computes a string's SHA1 digest. |
|
|
||||||
| `sha256sum` | Computes a string's SHA256 digest. |
|
|
||||||
| `adler32sum` | Computes a string's Adler-32 checksum. |
|
|
||||||
|
|
||||||
### Task Functions
|
|
||||||
|
|
||||||
Lastly, Task itself provides a few functions:
|
|
||||||
|
|
||||||
| Function | Description |
|
|
||||||
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
||||||
| `OS` | Returns the operating system. Possible values are `windows`, `linux`, `darwin` (macOS) and `freebsd`. |
|
|
||||||
| `ARCH` | Returns the architecture Task was compiled to: `386`, `amd64`, `arm` or `s390x`. |
|
|
||||||
| `numCPU` | Returns the number of logical CPU's usable by the current process. |
|
|
||||||
| `splitLines` | Splits Unix (`\n`) and Windows (`\r\n`) styled newlines. |
|
|
||||||
| `catLines` | Replaces Unix (`\n`) and Windows (`\r\n`) styled newlines with a space. |
|
|
||||||
| `toSlash` | Does nothing on Unix, but on Windows converts a string from `\` path format to `/`. |
|
|
||||||
| `fromSlash` | Opposite of `toSlash`. Does nothing on Unix, but on Windows converts a string from `/` path format to `\`. |
|
|
||||||
| `exeExt` | Returns the right executable extension for the current OS (`".exe"` for Windows, `""` for others). |
|
|
||||||
| `shellQuote` | (aliased to `q`): Quotes a string to make it safe for use in shell scripts. Task uses [this Go function](https://pkg.go.dev/mvdan.cc/sh/v3@v3.4.0/syntax#Quote) for this. The Bash dialect is assumed. |
|
|
||||||
| `splitArgs` | Splits a string as if it were a command's arguments. Task uses [this Go function](https://pkg.go.dev/mvdan.cc/sh/v3@v3.4.0/shell#Fields). |
|
|
||||||
| `joinPath` | Joins any number of arguments into a path. The same as Go's [filepath.Join](https://pkg.go.dev/path/filepath#Join). |
|
|
||||||
| `relPath` | Converts an absolute path (second argument) into a relative path, based on a base path (first argument). The same as Go's [filepath.Rel](https://pkg.go.dev/path/filepath#Rel). |
|
|
||||||
| `merge` | Creates a new map that is a copy of the first map with the keys of each subsequent map merged into it. If there is a duplicate key, the value of the last map with that key is used. |
|
|
||||||
| `spew` | Returns the Go representation of a specific variable. Useful for debugging. Uses the [davecgh/go-spew](https://github.com/davecgh/go-spew) package. |
|
|
||||||
| `fromYaml`\* | Decodes a YAML string into an object. |
|
|
||||||
| `toYaml`\* | Encodes an object as a YAML string. |
|
|
||||||
| `uuid` | Generates a new pseudo-random UUIDv4 string. |
|
|
||||||
| `randIntN` | Generates a new pseudo-random, non-negative, 32bit integer in the half-open interval `[0,n)`. Generated numbers are not suitable for security-sensitive work. |
|
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[text/template]: https://pkg.go.dev/text/template
|
|
||||||
[html/template]: https://pkg.go.dev/html/template
|
|
||||||
[go-template-functions]: https://pkg.go.dev/text/template#hdr-Functions
|
|
||||||
[slim-sprig]: https://go-task.github.io/slim-sprig/
|
|
||||||
[os-functions]: https://go-task.github.io/slim-sprig/os.html
|
|
||||||
[string-functions]: https://go-task.github.io/slim-sprig/strings.html
|
|
||||||
[string-list-functions]: https://go-task.github.io/slim-sprig/string_slice.html
|
|
||||||
[math-functions]: https://go-task.github.io/slim-sprig/math.html
|
|
||||||
[integer-list-functions]: https://go-task.github.io/slim-sprig/integer_slice.html
|
|
||||||
[date-functions]: https://go-task.github.io/slim-sprig/date.html
|
|
||||||
[default-functions]: https://go-task.github.io/slim-sprig/defaults.html
|
|
||||||
[encoding-functions]: https://go-task.github.io/slim-sprig/encoding.html
|
|
||||||
[list-functions]: https://go-task.github.io/slim-sprig/lists.html
|
|
||||||
[dictionary-functions]: https://go-task.github.io/slim-sprig/dicts.html
|
|
||||||
[type-conversion-functions]: https://go-task.github.io/slim-sprig/conversion.html
|
|
||||||
[path-functions]: https://go-task.github.io/slim-sprig/paths.html
|
|
||||||
[flow-control-functions]: https://go-task.github.io/slim-sprig/flow_control.html
|
|
||||||
[os-functions]: https://go-task.github.io/slim-sprig/os.html
|
|
||||||
[reflection-functions]: https://go-task.github.io/slim-sprig/reflection.html
|
|
||||||
[crypto-functions]: https://go-task.github.io/slim-sprig/crypto.html
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,72 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /releasing/
|
|
||||||
sidebar_position: 13
|
|
||||||
---
|
|
||||||
|
|
||||||
# Releasing
|
|
||||||
|
|
||||||
The release process of Task is done with the help of [GoReleaser][goreleaser].
|
|
||||||
You can test the release process locally by calling the `test-release` task of
|
|
||||||
the Taskfile.
|
|
||||||
|
|
||||||
[GitHub Actions](https://github.com/go-task/task/actions) should release
|
|
||||||
artifacts automatically when a new Git tag is pushed to `main` branch (raw
|
|
||||||
executables and DEB and RPM packages).
|
|
||||||
|
|
||||||
Since v3.15.0, raw executables can also be reproduced and verified locally by
|
|
||||||
checking out a specific tag and calling `goreleaser build`, using the Go version
|
|
||||||
defined in the above GitHub Actions.
|
|
||||||
|
|
||||||
# Homebrew
|
|
||||||
|
|
||||||
Goreleaser will automatically push a new commit to the
|
|
||||||
[Formula/go-task.rb][gotaskrb] file in the [Homebrew tap][homebrewtap]
|
|
||||||
repository to release the new version.
|
|
||||||
|
|
||||||
# npm
|
|
||||||
|
|
||||||
To release to npm update the version in the [`package.json`][packagejson] file
|
|
||||||
and then run `task npm:publish` to push it.
|
|
||||||
|
|
||||||
# Snapcraft
|
|
||||||
|
|
||||||
The [snap package][snappackage] requires to manual steps to release a new
|
|
||||||
version:
|
|
||||||
|
|
||||||
- Updating the current version on [snapcraft.yaml][snapcraftyaml].
|
|
||||||
- Moving both `amd64`, `armhf` and `arm64` new artifacts to the stable channel
|
|
||||||
on the [Snapcraft dashboard][snapcraftdashboard].
|
|
||||||
|
|
||||||
# winget
|
|
||||||
|
|
||||||
winget also requires manual steps to be completed. By running
|
|
||||||
`task goreleaser:test` locally, manifest files will be generated on
|
|
||||||
`dist/winget/manifests/t/Task/Task/v{version}`.
|
|
||||||
[Upload the manifest directory into this fork](https://github.com/go-task/winget-pkgs/tree/master/manifests/t/Task/Task)
|
|
||||||
and open a pull request into
|
|
||||||
[this repository](https://github.com/microsoft/winget-pkgs).
|
|
||||||
|
|
||||||
# Scoop
|
|
||||||
|
|
||||||
Scoop is a command-line package manager for the Windows operating system. Scoop
|
|
||||||
package manifests are maintained by the community. Scoop owners usually take
|
|
||||||
care of updating versions there by editing
|
|
||||||
[this file](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json).
|
|
||||||
If you think its Task version is outdated, open an issue to let us know.
|
|
||||||
|
|
||||||
# Nix
|
|
||||||
|
|
||||||
Nix is a community owned installation method. Nix package maintainers usually
|
|
||||||
take care of updating versions there by editing
|
|
||||||
[this file](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/go/go-task/package.nix).
|
|
||||||
If you think its Task version is outdated, open an issue to let us know.
|
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[goreleaser]: https://goreleaser.com/
|
|
||||||
[homebrewtap]: https://github.com/go-task/homebrew-tap
|
|
||||||
[gotaskrb]: https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb
|
|
||||||
[packagejson]: https://github.com/go-task/task/blob/main/package.json#L3
|
|
||||||
[snappackage]: https://github.com/go-task/snap
|
|
||||||
[snapcraftyaml]: https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml#L2
|
|
||||||
[snapcraftdashboard]: https://snapcraft.io/task/releases
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,72 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /taskfile-versions/
|
|
||||||
sidebar_position: 6
|
|
||||||
---
|
|
||||||
|
|
||||||
# Taskfile Versions
|
|
||||||
|
|
||||||
The Taskfile schema slowly changes as new features are added and old ones are
|
|
||||||
removed. This document explains how to use a Taskfile's schema version to ensure
|
|
||||||
that the users of your Taskfile are using the correct versions of Task.
|
|
||||||
|
|
||||||
## What the Taskfile version means
|
|
||||||
|
|
||||||
The schema version at the top of every Taskfile corresponds to a version of the
|
|
||||||
Task CLI, and by extension, the features that are provided by that version. When
|
|
||||||
creating a Taskfile, you should specify the _minimum_ version of Task that
|
|
||||||
supports the features you require. If you try to run a Taskfile with a version
|
|
||||||
of Task that does not meet this minimum required version, it will exit with an
|
|
||||||
error. For example, given a Taskfile that starts with:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3.2.1'
|
|
||||||
```
|
|
||||||
|
|
||||||
When executed with Task `v3.2.0`, it will exit with an error. Running with
|
|
||||||
version `v3.2.1` or higher will work as expected.
|
|
||||||
|
|
||||||
Task accepts any [SemVer][semver] compatible string including versions which
|
|
||||||
omit the minor or patch numbers. For example, `3`, `3.0`, and `3.0.0` all mean
|
|
||||||
the same thing and are all valid. Most Taskfiles only specify the major version
|
|
||||||
number. However it can be useful to be more specific when you intend to share a
|
|
||||||
Taskfile with others.
|
|
||||||
|
|
||||||
For example, the Taskfile below makes use of aliases:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
hello:
|
|
||||||
aliases:
|
|
||||||
- hi
|
|
||||||
- hey
|
|
||||||
cmds:
|
|
||||||
- echo "Hello, world!"
|
|
||||||
```
|
|
||||||
|
|
||||||
Aliases were introduced in Task `v3.17.0`, but the Taskfile only specifies `3`
|
|
||||||
as the version. This means that a user who has `v3.16.0` or lower installed will
|
|
||||||
get a potentially confusing error message when trying to run the Task as the
|
|
||||||
Taskfile specifies that any version greater or equal to `v3.0.0` is fine.
|
|
||||||
|
|
||||||
Instead, we should start the file like this:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3.17'
|
|
||||||
```
|
|
||||||
|
|
||||||
Now when someone tries to run the Taskfile with an older version of Task, they
|
|
||||||
will receive an error prompting them to upgrade their version of Task to
|
|
||||||
`v3.17.0` or greater.
|
|
||||||
|
|
||||||
## Versions 1 & 2
|
|
||||||
|
|
||||||
Version 1 and 2 of Task are no longer officially supported and anyone still
|
|
||||||
using them is strongly encouraged to upgrade to the latest version of Task.
|
|
||||||
|
|
||||||
While `version: 2` of Task did support schema versions, the behavior did not
|
|
||||||
work in quite the same way and cannot be relied upon for the purposes discussed
|
|
||||||
above.
|
|
||||||
|
|
||||||
[semver]: https://semver.org/
|
|
@@ -1,249 +0,0 @@
|
|||||||
import type {Config} from '@docusaurus/types';
|
|
||||||
import type * as Preset from '@docusaurus/preset-classic';
|
|
||||||
import { EnumChangefreq } from 'sitemap';
|
|
||||||
|
|
||||||
import remarkGithub from 'remark-github';
|
|
||||||
import remarkGfm from 'remark-gfm';
|
|
||||||
|
|
||||||
import { DISCORD_URL } from './constants';
|
|
||||||
import { GITHUB_URL } from './constants';
|
|
||||||
import { BLUESKY_URL } from './constants';
|
|
||||||
import { MASTODON_URL } from './constants';
|
|
||||||
import { TWITTER_URL } from './constants';
|
|
||||||
import { STACK_OVERFLOW } from './constants';
|
|
||||||
import { ANSWER_OVERFLOW } from './constants';
|
|
||||||
|
|
||||||
import lightCodeTheme from './src/themes/prismLight';
|
|
||||||
import darkCodeTheme from './src/themes/prismDark';
|
|
||||||
|
|
||||||
const config: Config = {
|
|
||||||
title: 'Task',
|
|
||||||
tagline: 'A task runner / simpler Make alternative written in Go ',
|
|
||||||
url: 'https://taskfile.dev',
|
|
||||||
baseUrl: '/',
|
|
||||||
onBrokenLinks: 'warn',
|
|
||||||
onBrokenMarkdownLinks: 'warn',
|
|
||||||
favicon: 'img/favicon.ico',
|
|
||||||
|
|
||||||
organizationName: 'go-task',
|
|
||||||
projectName: 'task',
|
|
||||||
deploymentBranch: 'gh-pages',
|
|
||||||
|
|
||||||
i18n: {
|
|
||||||
defaultLocale: 'en',
|
|
||||||
locales: ['en'],
|
|
||||||
localeConfigs: {
|
|
||||||
en: {
|
|
||||||
label: 'English',
|
|
||||||
direction: 'ltr',
|
|
||||||
htmlLang: 'en-US'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
presets: [
|
|
||||||
[
|
|
||||||
'classic',
|
|
||||||
{
|
|
||||||
docs: {
|
|
||||||
routeBasePath: '/',
|
|
||||||
sidebarPath: './sidebars.ts',
|
|
||||||
remarkPlugins: [remarkGithub, remarkGfm],
|
|
||||||
includeCurrentVersion: true,
|
|
||||||
versions: {
|
|
||||||
current: {
|
|
||||||
label: `Next 🚧`,
|
|
||||||
path: 'next',
|
|
||||||
badge: false
|
|
||||||
},
|
|
||||||
latest: {
|
|
||||||
label: 'Latest',
|
|
||||||
badge: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
blog: {
|
|
||||||
blogSidebarTitle: 'All posts',
|
|
||||||
blogSidebarCount: 'ALL'
|
|
||||||
},
|
|
||||||
theme: {
|
|
||||||
customCss: [
|
|
||||||
'./src/css/custom.css',
|
|
||||||
'./src/css/carbon.css',
|
|
||||||
]
|
|
||||||
},
|
|
||||||
gtag: {
|
|
||||||
trackingID: 'G-4RT25NXQ7N',
|
|
||||||
anonymizeIP: true
|
|
||||||
},
|
|
||||||
sitemap: {
|
|
||||||
changefreq: EnumChangefreq.WEEKLY,
|
|
||||||
priority: 0.5,
|
|
||||||
ignorePatterns: ['/tags/**']
|
|
||||||
}
|
|
||||||
} satisfies Preset.Options,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
|
|
||||||
scripts: [
|
|
||||||
{
|
|
||||||
src: '/js/carbon.js',
|
|
||||||
async: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
themeConfig:{
|
|
||||||
metadata: [
|
|
||||||
{
|
|
||||||
name: 'og:image',
|
|
||||||
content: 'https://taskfile.dev/img/og-image.png'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
navbar: {
|
|
||||||
title: 'Task',
|
|
||||||
logo: {
|
|
||||||
alt: 'Task Logo',
|
|
||||||
src: 'img/logo.svg'
|
|
||||||
},
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
type: 'doc',
|
|
||||||
docId: 'intro',
|
|
||||||
position: 'left',
|
|
||||||
label: 'Docs'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
to: 'blog',
|
|
||||||
label: 'Blog',
|
|
||||||
position: 'left'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
to: '/donate',
|
|
||||||
position: 'left',
|
|
||||||
label: 'Donate'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'docsVersionDropdown',
|
|
||||||
position: 'right',
|
|
||||||
dropdownActiveClassDisabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
href: GITHUB_URL,
|
|
||||||
title: 'GitHub',
|
|
||||||
position: 'right',
|
|
||||||
className: "header-icon-link icon-github",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
href: DISCORD_URL,
|
|
||||||
title: 'Discord',
|
|
||||||
position: 'right',
|
|
||||||
className: "header-icon-link icon-discord",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
href: TWITTER_URL,
|
|
||||||
title: 'X (Twitter)',
|
|
||||||
position: 'right',
|
|
||||||
className: "header-icon-link icon-twitter",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
href: BLUESKY_URL,
|
|
||||||
title: 'Bluesky',
|
|
||||||
position: 'right',
|
|
||||||
className: "header-icon-link icon-bluesky",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
href: MASTODON_URL,
|
|
||||||
title: 'Mastodon',
|
|
||||||
rel: 'me',
|
|
||||||
position: 'right',
|
|
||||||
className: "header-icon-link icon-mastodon",
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
footer: {
|
|
||||||
style: 'dark',
|
|
||||||
links: [
|
|
||||||
{
|
|
||||||
title: 'Pages',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
label: 'Installation',
|
|
||||||
to: '/installation/'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Usage',
|
|
||||||
to: '/usage/'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Donate',
|
|
||||||
to: '/donate/'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Community',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
label: 'GitHub',
|
|
||||||
href: GITHUB_URL
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Discord',
|
|
||||||
href: DISCORD_URL
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Twitter',
|
|
||||||
href: TWITTER_URL
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Bluesky',
|
|
||||||
href: BLUESKY_URL,
|
|
||||||
rel: 'me'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Mastodon',
|
|
||||||
href: MASTODON_URL,
|
|
||||||
rel: 'me'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Stack Overflow',
|
|
||||||
href: STACK_OVERFLOW
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Answer Overflow',
|
|
||||||
href: ANSWER_OVERFLOW
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'OpenCollective',
|
|
||||||
href: 'https://opencollective.com/task'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
html: '<a target="_blank" href="https://www.netlify.com"><img src="https://www.netlify.com/v3/img/components/netlify-color-accent.svg" alt="Deploys by Netlify" /></a>'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
prism: {
|
|
||||||
theme: lightCodeTheme,
|
|
||||||
darkTheme: darkCodeTheme,
|
|
||||||
additionalLanguages: [
|
|
||||||
"bash", // aka. shell
|
|
||||||
"json",
|
|
||||||
"powershell"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
// NOTE(@andreynering): Don't worry, these keys are meant to be public =)
|
|
||||||
algolia: {
|
|
||||||
appId: '7IZIJ13AI7',
|
|
||||||
apiKey: '34b64ae4fc8d9da43d9a13d9710aaddc',
|
|
||||||
indexName: 'taskfile'
|
|
||||||
}
|
|
||||||
} satisfies Preset.ThemeConfig,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
3
website/netlify.toml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[build]
|
||||||
|
publish = ".vitepress/dist"
|
||||||
|
command = "pnpm run build"
|
@@ -1,54 +1,25 @@
|
|||||||
{
|
{
|
||||||
"name": "taskfile-dev",
|
"name": "website2",
|
||||||
"version": "0.0.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"description": "",
|
||||||
"repository": {
|
"type": "module",
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/go-task/task"
|
|
||||||
},
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"docusaurus": "docusaurus",
|
"dev": "vitepress dev",
|
||||||
"start": "docusaurus start",
|
"build": "vitepress build",
|
||||||
"build": "docusaurus build",
|
"preview": "vitepress preview",
|
||||||
"swizzle": "docusaurus swizzle",
|
"lint": "prettier --write ."
|
||||||
"deploy": "docusaurus deploy",
|
|
||||||
"clear": "docusaurus clear",
|
|
||||||
"serve": "docusaurus serve",
|
|
||||||
"write-translations": "docusaurus write-translations",
|
|
||||||
"write-heading-ids": "docusaurus write-heading-ids"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@docusaurus/core": "^3.5.2",
|
|
||||||
"@docusaurus/preset-classic": "^3.5.2",
|
|
||||||
"@mdx-js/react": "^3.0.0",
|
|
||||||
"clsx": "^2.0.0",
|
|
||||||
"prism-react-renderer": "^2.1.0",
|
|
||||||
"raw-loader": "^4.0.2",
|
|
||||||
"react": "^19.0.0",
|
|
||||||
"react-dom": "^19.0.0",
|
|
||||||
"remark-gfm": "^4.0.0",
|
|
||||||
"remark-github": "^12.0.0"
|
|
||||||
},
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@docusaurus/module-type-aliases": "^3.5.2",
|
"@types/markdown-it": "^14.1.2",
|
||||||
"@docusaurus/tsconfig": "^3.5.2",
|
"@types/node": "^24.1.0",
|
||||||
"@docusaurus/types": "^3.5.2",
|
"netlify-cli": "^23.1.1",
|
||||||
"@types/react": "^19.0.0",
|
"prettier": "^3.6.2",
|
||||||
"typescript": "^5.3.3"
|
"vitepress": "^1.6.3",
|
||||||
},
|
"vitepress-plugin-group-icons": "^1.6.1",
|
||||||
"engines": {
|
"vitepress-plugin-tabs": "^0.7.1",
|
||||||
"node": ">=18.0"
|
"vue": "^3.5.18"
|
||||||
},
|
|
||||||
"browserslist": {
|
|
||||||
"production": [
|
|
||||||
">0.5%",
|
|
||||||
"not dead",
|
|
||||||
"not op_mini all"
|
|
||||||
],
|
|
||||||
"development": [
|
|
||||||
"last 1 chrome version",
|
|
||||||
"last 1 firefox version",
|
|
||||||
"last 1 safari version"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
9330
website/pnpm-lock.yaml
generated
Normal file
@@ -1,9 +1,13 @@
|
|||||||
module.exports = {
|
/**
|
||||||
|
* @see https://prettier.io/docs/configuration
|
||||||
|
* @type {import("prettier").Config}
|
||||||
|
*/
|
||||||
|
const config = {
|
||||||
trailingComma: 'none',
|
trailingComma: 'none',
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ['*.md', '*.mdx'],
|
files: ['*.md'],
|
||||||
options: {
|
options: {
|
||||||
printWidth: 80,
|
printWidth: 80,
|
||||||
proseWrap: 'always'
|
proseWrap: 'always'
|
||||||
@@ -11,3 +15,5 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
import { SidebarsConfig } from '@docusaurus/plugin-content-docs';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
taskSidebar: [
|
|
||||||
{
|
|
||||||
type: 'autogenerated',
|
|
||||||
dirName: '.'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'html',
|
|
||||||
value: '<div id="sidebar-ads"></div>'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
} satisfies SidebarsConfig;
|
|
@@ -1,15 +1,13 @@
|
|||||||
---
|
---
|
||||||
title: Any Variables
|
title: Any Variables
|
||||||
description: Task variables are no longer limited to strings!
|
author: pd93
|
||||||
slug: any-variables
|
date: 2024-05-09
|
||||||
authors: [pd93]
|
outline: deep
|
||||||
tags: [experiments, variables]
|
|
||||||
image: https://i.imgur.com/mErPwqL.png
|
|
||||||
hide_table_of_contents: false
|
|
||||||
---
|
---
|
||||||
|
|
||||||
import Tabs from '@theme/Tabs';
|
# Any Variables
|
||||||
import TabItem from '@theme/TabItem';
|
|
||||||
|
<AuthorCard :author="$frontmatter.author" />
|
||||||
|
|
||||||
Task has always had variables, but even though you were able to define them
|
Task has always had variables, but even though you were able to define them
|
||||||
using different YAML types, they would always be converted to strings by Task.
|
using different YAML types, they would always be converted to strings by Task.
|
||||||
@@ -18,8 +16,6 @@ simple problems. Starting from [v3.37.0][v3.37.0], this is no longer the case!
|
|||||||
Task now supports most variable types, including **booleans**, **integers**,
|
Task now supports most variable types, including **booleans**, **integers**,
|
||||||
**floats** and **arrays**!
|
**floats** and **arrays**!
|
||||||
|
|
||||||
{/* truncate */}
|
|
||||||
|
|
||||||
## What's the big deal?
|
## What's the big deal?
|
||||||
|
|
||||||
These changes allow you to use variables in a much more natural way and opens up
|
These changes allow you to use variables in a much more natural way and opens up
|
||||||
@@ -31,10 +27,9 @@ some of the examples below for some inspiration.
|
|||||||
No more comparing strings to "true" or "false". Now you can use actual boolean
|
No more comparing strings to "true" or "false". Now you can use actual boolean
|
||||||
values in your templates:
|
values in your templates:
|
||||||
|
|
||||||
<Tabs defaultValue="2">
|
::: code-group
|
||||||
<TabItem value="1" label="Before">
|
|
||||||
|
|
||||||
```yaml
|
```yaml [Before]
|
||||||
version: 3
|
version: 3
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -45,10 +40,7 @@ tasks:
|
|||||||
- '{{if eq .BOOL "true"}}echo foo{{end}}'
|
- '{{if eq .BOOL "true"}}echo foo{{end}}'
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
```yaml [After]
|
||||||
<TabItem value="2" label="After">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: 3
|
version: 3
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -59,8 +51,7 @@ tasks:
|
|||||||
- '{{if .BOOL}}echo foo{{end}}' # <-- No need to compare to "true"
|
- '{{if .BOOL}}echo foo{{end}}' # <-- No need to compare to "true"
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
:::
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
### Arithmetic
|
### Arithmetic
|
||||||
|
|
||||||
@@ -110,10 +101,9 @@ to specify the delimiter. However, we have now added support for looping over
|
|||||||
"collection-type" variables using the `for` keyword, so now you are able to loop
|
"collection-type" variables using the `for` keyword, so now you are able to loop
|
||||||
over list variables directly:
|
over list variables directly:
|
||||||
|
|
||||||
<Tabs defaultValue="2">
|
::: code-group
|
||||||
<TabItem value="1" label="Before">
|
|
||||||
|
|
||||||
```yaml
|
```yaml [Before]
|
||||||
version: 3
|
version: 3
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -127,10 +117,7 @@ tasks:
|
|||||||
cmd: echo {{.ITEM}}
|
cmd: echo {{.ITEM}}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
```yaml [After]
|
||||||
<TabItem value="2" label="After">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: 3
|
version: 3
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -143,8 +130,7 @@ tasks:
|
|||||||
cmd: echo {{.ITEM}}
|
cmd: echo {{.ITEM}}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
:::
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
## What about maps?
|
## What about maps?
|
||||||
|
|
||||||
@@ -154,20 +140,9 @@ at once, we have released support for all other variable types and we will
|
|||||||
continue working on map support in the new "[Map Variables][map-variables]"
|
continue working on map support in the new "[Map Variables][map-variables]"
|
||||||
experiment.
|
experiment.
|
||||||
|
|
||||||
:::note
|
|
||||||
|
|
||||||
If you were previously using maps with the Any Variables experiment and wish to
|
|
||||||
continue using them, you will need to enable the new [Map Variables
|
|
||||||
experiment][map-variables] instead.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
We're looking for feedback on a couple of different proposals, so please give
|
We're looking for feedback on a couple of different proposals, so please give
|
||||||
them a go and let us know what you think. :pray:
|
them a go and let us know what you think. :pray:
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[v3.37.0]: https://github.com/go-task/task/releases/tag/v3.37.0
|
[v3.37.0]: https://github.com/go-task/task/releases/tag/v3.37.0
|
||||||
[slim-sprig-math]: https://go-task.github.io/slim-sprig/math.html
|
[slim-sprig-math]: https://go-task.github.io/slim-sprig/math.html
|
||||||
[slim-sprig-list]: https://go-task.github.io/slim-sprig/lists.html
|
[slim-sprig-list]: https://go-task.github.io/slim-sprig/lists.html
|
||||||
[map-variables]: /experiments/map-variables
|
|
||||||
{/* prettier-ignore-end */}
|
|
22
website/src/blog/index.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
title: Blog
|
||||||
|
description: Latest news and updates from the Task team
|
||||||
|
---
|
||||||
|
|
||||||
|
<BlogPost
|
||||||
|
title="Any Variables"
|
||||||
|
url="/blog/any-variables"
|
||||||
|
date="2024-05-09"
|
||||||
|
author="pd93"
|
||||||
|
description="Task has always had variables, but even though you were able to define them using different YAML types, they would always be converted to strings by Task. This limited users to string manipulation and encouraged messy workarounds for simple problems. Starting from v3.37.0, this is no longer the case! Task now supports most variable types, including booleans, integers, floats and arrays!"
|
||||||
|
:tags="['experiments', 'variables']"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<BlogPost
|
||||||
|
title="Introducing Experiments"
|
||||||
|
url="/blog/task-in-2023"
|
||||||
|
date="2023-09-02"
|
||||||
|
author="pd93"
|
||||||
|
description="A look at where Task is, where it's going and how we're going to get there. Lately, Task has been growing extremely quickly and I've found myself thinking a lot about the future of the project and how we continue to evolve and grow. I'm not much of a writer, but I think one of the things we could do better is to communicate these kinds of thoughts to the community."
|
||||||
|
:tags="['roadmap', 'experiments', 'community']"
|
||||||
|
/>
|
@@ -2,13 +2,15 @@
|
|||||||
title: Introducing Experiments
|
title: Introducing Experiments
|
||||||
description:
|
description:
|
||||||
A look at where task is, where it's going and how we're going to get there.
|
A look at where task is, where it's going and how we're going to get there.
|
||||||
slug: task-in-2023
|
author: pd93
|
||||||
authors: [pd93]
|
date: 2024-05-09
|
||||||
tags: [experiments, breaking-changes, roadmap, v4]
|
outline: deep
|
||||||
image: https://i.imgur.com/mErPwqL.png
|
|
||||||
hide_table_of_contents: false
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
# Introducing Experiments
|
||||||
|
|
||||||
|
<AuthorCard :author="$frontmatter.author" />
|
||||||
|
|
||||||
Lately, Task has been growing extremely quickly and I've found myself thinking a
|
Lately, Task has been growing extremely quickly and I've found myself thinking a
|
||||||
lot about the future of the project and how we continue to evolve and grow. I'm
|
lot about the future of the project and how we continue to evolve and grow. I'm
|
||||||
not much of a writer, but I think one of the things we could do better is to
|
not much of a writer, but I think one of the things we could do better is to
|
||||||
@@ -16,19 +18,17 @@ communicate these kinds of thoughts to the community. So, with that in mind,
|
|||||||
this is the first (hopefully of many) blog posts talking about Task and what
|
this is the first (hopefully of many) blog posts talking about Task and what
|
||||||
we're up to.
|
we're up to.
|
||||||
|
|
||||||
{/* truncate */}
|
|
||||||
|
|
||||||
## :calendar: So, what have we been up to?
|
## :calendar: So, what have we been up to?
|
||||||
|
|
||||||
Over the past 12 months or so, [@andreynering] (Author and maintainer of the
|
Over the past 12 months or so, @andreynering (Author and maintainer of the
|
||||||
project) and I ([@pd93]) have been working in our spare time to maintain and
|
project) and I (@pd93) have been working in our spare time to maintain and
|
||||||
improve v3 of Task and we've made some amazing progress. Here are just some of
|
improve v3 of Task and we've made some amazing progress. Here are just some of
|
||||||
the things we've released in that time:
|
the things we've released in that time:
|
||||||
|
|
||||||
- An official [extension for VS Code][vscode-task].
|
- An official [extension for VS Code][vscode-task].
|
||||||
- Internal Tasks ([#818](https://github.com/go-task/task/pull/818)).
|
- Internal Tasks (#818).
|
||||||
- Task aliases ([#879](https://github.com/go-task/task/pull/879)).
|
- Task aliases (#879).
|
||||||
- Looping over tasks ([#1220](https://github.com/go-task/task/pull/1200)).
|
- Looping over tasks (#1220).
|
||||||
- A series of refactors to the core codebase to make it more maintainable and
|
- A series of refactors to the core codebase to make it more maintainable and
|
||||||
extensible.
|
extensible.
|
||||||
- Loads of bug fixes and improvements.
|
- Loads of bug fixes and improvements.
|
||||||
@@ -38,14 +38,13 @@ the things we've released in that time:
|
|||||||
- And much, much more! :sparkles:
|
- And much, much more! :sparkles:
|
||||||
|
|
||||||
We're also working on adding some really exciting and highly requested features
|
We're also working on adding some really exciting and highly requested features
|
||||||
to Task such as having the ability to run remote Taskfiles
|
to Task such as having the ability to run remote Taskfiles (#1317).
|
||||||
([#1317](https://github.com/go-task/task/issues/1317)).
|
|
||||||
|
|
||||||
None of this would have been possible without the [150 or so (and growing)
|
None of this would have been possible without the [150 or so (and growing)
|
||||||
contributors][contributors] to the project, numerous sponsors and a passionate
|
contributors][contributors] to the project, numerous sponsors and a passionate
|
||||||
community of users. Together we have more than doubled the number of GitHub
|
community of users. Together we have more than doubled the number of GitHub
|
||||||
stars to over 8400 :star: since the beginning of 2022 and this continues to
|
stars to over 8400 :star: since the beginning of 2022 and this continues to
|
||||||
accelerate. We can't thank you all enough for your help and support! :rocket:
|
accelerate. We can't thank you all enough for your help and support! 🚀
|
||||||
|
|
||||||
[](https://star-history.com/#go-task/task&Date)
|
[](https://star-history.com/#go-task/task&Date)
|
||||||
|
|
||||||
@@ -71,7 +70,7 @@ commitment to make. Smaller, more frequent major releases are also a significant
|
|||||||
inconvenience for users as they have to constantly keep up-to-date with our
|
inconvenience for users as they have to constantly keep up-to-date with our
|
||||||
breaking changes. Fortunately, there is a better way.
|
breaking changes. Fortunately, there is a better way.
|
||||||
|
|
||||||
## What's going to change? :monocle:
|
## What's going to change? :monocle_face:
|
||||||
|
|
||||||
Going forwards, breaking changes will be allowed into _minor_ versions of Task
|
Going forwards, breaking changes will be allowed into _minor_ versions of Task
|
||||||
as "experimental features". To access these features users will need opt-in by
|
as "experimental features". To access these features users will need opt-in by
|
||||||
@@ -122,14 +121,11 @@ I plan to write more of these blog posts in the future on a variety of
|
|||||||
Task-related topics, so make sure to check in occasionally and see what we're up
|
Task-related topics, so make sure to check in occasionally and see what we're up
|
||||||
to!
|
to!
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[vscode-task]: https://github.com/go-task/vscode-task
|
[vscode-task]: https://github.com/go-task/vscode-task
|
||||||
[crowdin]: https://crowdin.com
|
[crowdin]: https://crowdin.com
|
||||||
[contributors]: https://github.com/go-task/task/graphs/contributors
|
[contributors]: https://github.com/go-task/task/graphs/contributors
|
||||||
[semver]: https://semver.org
|
[semver]: https://semver.org
|
||||||
[breaking-change-proposal]: https://github.com/go-task/task/discussions/1191
|
[breaking-change-proposal]: https://github.com/go-task/task/discussions/1191
|
||||||
[@andreynering]: https://github.com/andreynering
|
|
||||||
[@pd93]: https://github.com/pd93
|
|
||||||
[experiments]: https://taskfile.dev/experiments
|
[experiments]: https://taskfile.dev/experiments
|
||||||
[deprecations]: https://taskfile.dev/deprecations
|
[deprecations]: https://taskfile.dev/deprecations
|
||||||
[deprecate-version-2-schema]: https://github.com/go-task/task/issues/1197
|
[deprecate-version-2-schema]: https://github.com/go-task/task/issues/1197
|
||||||
@@ -139,4 +135,3 @@ to!
|
|||||||
[experiments-project]: https://github.com/orgs/go-task/projects/1
|
[experiments-project]: https://github.com/orgs/go-task/projects/1
|
||||||
[gentle-force-experiment]: https://github.com/go-task/task/issues/1200
|
[gentle-force-experiment]: https://github.com/go-task/task/issues/1200
|
||||||
[remote-taskfiles-experiment]: https://github.com/go-task/task/issues/1317
|
[remote-taskfiles-experiment]: https://github.com/go-task/task/issues/1317
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,65 +0,0 @@
|
|||||||
#carbonads * {
|
|
||||||
margin: initial;
|
|
||||||
padding: initial;
|
|
||||||
}
|
|
||||||
#carbonads {
|
|
||||||
display: flex;
|
|
||||||
max-width: 330px;
|
|
||||||
background-color: hsl(0, 0%, 98%);
|
|
||||||
box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, 0.1);
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
#carbonads a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
#carbonads a:hover {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
#carbonads span {
|
|
||||||
position: relative;
|
|
||||||
display: block;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
#carbonads .carbon-wrap {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
#carbonads .carbon-img {
|
|
||||||
display: block;
|
|
||||||
margin: 0;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
#carbonads .carbon-img img {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
#carbonads .carbon-text {
|
|
||||||
font-size: 13px;
|
|
||||||
padding: 10px;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
line-height: 1.5;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
#carbonads .carbon-poweredby {
|
|
||||||
display: block;
|
|
||||||
padding: 6px 8px;
|
|
||||||
background: #f1f1f2;
|
|
||||||
text-align: center;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.5px;
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 8px;
|
|
||||||
line-height: 1;
|
|
||||||
border-top-left-radius: 3px;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-theme='dark'] #carbonads {
|
|
||||||
background-color: hsl(0, 0%, 35%);
|
|
||||||
box-shadow: 0 1px 4px 1px hsl(0, 0%, 55%);
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-theme='dark'] #carbonads .carbon-poweredby {
|
|
||||||
background-color: hsl(0, 0%, 55%);
|
|
||||||
}
|
|
@@ -1,123 +0,0 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,400;0,700;1,400;1,700&family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap');
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--ifm-font-family-base: Roboto, system-ui, -apple-system, Segoe UI, Ubuntu, Cantarell, Noto Sans, sans-serif, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
|
|
||||||
--ifm-font-family-monospace: 'Roboto Mono', SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
|
||||||
|
|
||||||
--ifm-color-primary: #43ABA2 ;
|
|
||||||
--ifm-color-primary-dark: #3AB2A6;
|
|
||||||
--ifm-color-primary-darker: #32B8AB;
|
|
||||||
--ifm-color-primary-darkest: #29BEB0;
|
|
||||||
--ifm-color-primary-light: #4CA59D;
|
|
||||||
--ifm-color-primary-lighter: #559F98;
|
|
||||||
--ifm-color-primary-lightest: #5D9993;
|
|
||||||
--ifm-code-font-size: 95%;
|
|
||||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
|
|
||||||
|
|
||||||
--ifm-navbar-link-color: #fffdf9;
|
|
||||||
--ifm-navbar-link-hover-color: #43aba2;
|
|
||||||
}
|
|
||||||
.menu__link--sublist.menu__link--active,
|
|
||||||
.menu__link--sublist.menu__link--active:hover {
|
|
||||||
background-color: #43aba2 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-theme='light'] {
|
|
||||||
--ifm-background-color: #fffdf9;
|
|
||||||
--ifm-background-surface-color: #2b2d31;
|
|
||||||
--ifm-color-primary: #43aba2;
|
|
||||||
--ifm-dropdown-link-color: #fffdf9;
|
|
||||||
--ifm-link-color: #43aba2;
|
|
||||||
--ifm-breadcrumb-color-active: #2b2d31;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu, .navbar, .navbar-sidebar {
|
|
||||||
--ifm-menu-color-background-active: #43aba2;
|
|
||||||
--ifm-menu-color-active: #fffdf9;
|
|
||||||
}
|
|
||||||
.navbar, .navbar-sidebar {
|
|
||||||
--ifm-menu-color: #fffdf9;
|
|
||||||
}
|
|
||||||
.navbar-sidebar__back {
|
|
||||||
color: #fffdf9;
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-theme='light'] svg[class*="lightToggleIcon"],
|
|
||||||
[data-theme='light'] .navbar__toggle {
|
|
||||||
color: #fffdf9 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-theme='light'] div[class*="codeBlockTitle"],
|
|
||||||
[data-theme='light'] code[class*="codeBlockLines"] {
|
|
||||||
background-color: #f7f5f1 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-theme='dark'], .footer--dark {
|
|
||||||
--ifm-background-color: #242526 !important;
|
|
||||||
--ifm-background-surface-color: #2b2d31 !important;
|
|
||||||
--ifm-footer-background-color: #2b2d31 !important;
|
|
||||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
.code-block--max-width {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#carbonads {
|
|
||||||
margin-top: 30px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gold-sponsors {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gold-sponsors table img {
|
|
||||||
width: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu__list-item:has(.header-icon-link) {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu__list-item:has(.header-icon-link) .header-icon-link {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-icon-link::before {
|
|
||||||
content: '';
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
display: flex;
|
|
||||||
background-color: var(--ifm-navbar-link-color);
|
|
||||||
transition: background-color var(--ifm-transition-fast)
|
|
||||||
var(--ifm-transition-timing-default);
|
|
||||||
mask-size: contain;
|
|
||||||
mask-repeat: no-repeat;
|
|
||||||
mask-position: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-icon-link:hover::before {
|
|
||||||
background-color: var(--ifm-navbar-link-hover-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-github::before {
|
|
||||||
mask-image: url('/img/icon-github.svg');
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-discord::before {
|
|
||||||
mask-image: url('/img/icon-discord.svg');
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-mastodon::before {
|
|
||||||
mask-image: url('/img/icon-mastodon.svg');
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-twitter::before {
|
|
||||||
mask-image: url('/img/icon-twitter.svg');
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-bluesky::before {
|
|
||||||
mask-image: url('/img/icon-bluesky.svg');
|
|
||||||
}
|
|
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
slug: /changelog/
|
title: Changelog
|
||||||
sidebar_position: 14
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
@@ -92,8 +92,8 @@ Reverted the changes made in #2113 and #2186 that affected the
|
|||||||
- The default taskfile (output when using the `--init` flag) is now an embedded
|
- The default taskfile (output when using the `--init` flag) is now an embedded
|
||||||
file in the binary instead of being stored in the code (#2112 by @pd93).
|
file in the binary instead of being stored in the code (#2112 by @pd93).
|
||||||
- Improved the way we report the Task version when using the `--version` flag or
|
- Improved the way we report the Task version when using the `--version` flag or
|
||||||
`{{.TASK_VERSION}}` variable. This should now be more consistent and easier
|
<span v-pre>`{{.TASK_VERSION}}`</span> variable. This should now be more
|
||||||
for package maintainers to use (#2131 by @pd93).
|
consistent and easier for package maintainers to use (#2131 by @pd93).
|
||||||
- Fixed a bug where globstar (`**`) matching in `sources` only resolved the
|
- Fixed a bug where globstar (`**`) matching in `sources` only resolved the
|
||||||
first result (#2073, #2075 by @pd93).
|
first result (#2073, #2075 by @pd93).
|
||||||
- Fixed a bug where sorting tasks by "none" would use the default sorting
|
- Fixed a bug where sorting tasks by "none" would use the default sorting
|
||||||
@@ -107,7 +107,7 @@ Reverted the changes made in #2113 and #2186 that affected the
|
|||||||
- Fix Fish completions when `--global` (`-g`) is given (#2134 by @atusy).
|
- Fix Fish completions when `--global` (`-g`) is given (#2134 by @atusy).
|
||||||
- Fixed variables not available when using `defer:` (#1909, #2173 by @vmaerten).
|
- Fixed variables not available when using `defer:` (#1909, #2173 by @vmaerten).
|
||||||
|
|
||||||
#### Package API
|
### Package API
|
||||||
|
|
||||||
- The [`Executor`](https://pkg.go.dev/github.com/go-task/task/v3#Executor) now
|
- The [`Executor`](https://pkg.go.dev/github.com/go-task/task/v3#Executor) now
|
||||||
uses the functional options pattern (#2085, #2147, #2148 by @pd93).
|
uses the functional options pattern (#2085, #2147, #2148 by @pd93).
|
||||||
@@ -164,7 +164,7 @@ Reverted the changes made in #2113 and #2186 that affected the
|
|||||||
used, all other variables become unavailable in the templating system within
|
used, all other variables become unavailable in the templating system within
|
||||||
the include (#2092 by @vmaerten).
|
the include (#2092 by @vmaerten).
|
||||||
|
|
||||||
#### Package API
|
### Package API
|
||||||
|
|
||||||
Unlike our CLI tool,
|
Unlike our CLI tool,
|
||||||
[Task's package API is not currently stable](https://taskfile.dev/reference/package).
|
[Task's package API is not currently stable](https://taskfile.dev/reference/package).
|
||||||
@@ -500,360 +500,7 @@ stabilize the API in the future. #121 now tracks this piece of work.
|
|||||||
- The
|
- The
|
||||||
[Remote Taskfiles experiment](https://taskfile.dev/experiments/remote-taskfiles)
|
[Remote Taskfiles experiment](https://taskfile.dev/experiments/remote-taskfiles)
|
||||||
now prefers remote files over cached ones by default (#1317, #1345 by @pd93).
|
now prefers remote files over cached ones by default (#1317, #1345 by @pd93).
|
||||||
- Added `--timeout` flag to the
|
variable prefix and `^` command prefix (#642, #644, #645).
|
||||||
[Remote Taskfiles experiment](https://taskfile.dev/experiments/remote-taskfiles)
|
|
||||||
(#1317, #1345 by @pd93).
|
|
||||||
- Fix bug where dynamic `vars:` and `env:` were being executed when they should
|
|
||||||
actually be skipped by `platforms:` (#1273, #1377 by @andreynering).
|
|
||||||
- Fix `schema.json` to make `silent` valid in `cmds` that use `for` (#1385,
|
|
||||||
#1386 by @iainvm).
|
|
||||||
- Add new `--no-status` flag to skip expensive status checks when running
|
|
||||||
`task --list --json` (#1348, #1368 by @amancevice).
|
|
||||||
|
|
||||||
## v3.31.0 - 2023-10-07
|
|
||||||
|
|
||||||
- Enabled the `--yes` flag for the
|
|
||||||
[Remote Taskfiles experiment](https://taskfile.dev/experiments/remote-taskfiles)
|
|
||||||
(#1317, #1344 by @pd93).
|
|
||||||
- Add ability to set `watch: true` in a task to automatically run it in watch
|
|
||||||
mode (#231, #1361 by @andreynering).
|
|
||||||
- Fixed a bug on the watch mode where paths that contained `.git` (like
|
|
||||||
`.github`), for example, were also being ignored (#1356 by @butuzov).
|
|
||||||
- Fixed a nil pointer error when running a Taskfile with no contents (#1341,
|
|
||||||
#1342 by @pd93).
|
|
||||||
- Added a new [exit code](https://taskfile.dev/api/#exit-codes) (107) for when a
|
|
||||||
Taskfile does not contain a schema version (#1342 by @pd93).
|
|
||||||
- Increased limit of maximum task calls from 100 to 1000 for now, as some people
|
|
||||||
have been reaching this limit organically now that we have loops. This check
|
|
||||||
exists to detect recursive calls, but will be removed in favor of a better
|
|
||||||
algorithm soon (#1321, #1332).
|
|
||||||
- Fixed templating on descriptions on `task --list` (#1343 by @blackjid).
|
|
||||||
- Fixed a bug where precondition errors were incorrectly being printed when task
|
|
||||||
execution was aborted (#1337, #1338 by @sylv-io).
|
|
||||||
|
|
||||||
## v3.30.1 - 2023-09-14
|
|
||||||
|
|
||||||
- Fixed a regression where some special variables weren't being set correctly
|
|
||||||
(#1331, #1334 by @pd93).
|
|
||||||
|
|
||||||
## v3.30.0 - 2023-09-13
|
|
||||||
|
|
||||||
- Prep work for Remote Taskfiles (#1316 by @pd93).
|
|
||||||
- Added the
|
|
||||||
[Remote Taskfiles experiment](https://taskfile.dev/experiments/remote-taskfiles)
|
|
||||||
as a draft (#1152, #1317 by @pd93).
|
|
||||||
- Improve performance of content checksumming on `sources:` by replacing md5
|
|
||||||
with [XXH3](https://xxhash.com/) which is much faster. This is a soft breaking
|
|
||||||
change because checksums will be invalidated when upgrading to this release
|
|
||||||
(#1325 by @ReillyBrogan).
|
|
||||||
|
|
||||||
## v3.29.1 - 2023-08-26
|
|
||||||
|
|
||||||
- Update to Go 1.21 (bump minimum version to 1.20) (#1302 by @pd93)
|
|
||||||
- Fix a missing a line break on log when using `--watch` mode (#1285, #1297 by
|
|
||||||
@FilipSolich).
|
|
||||||
- Fix `defer` on JSON Schema (#1288 by @calvinmclean and @andreynering).
|
|
||||||
- Fix bug in usage of special variables like `{{.USER_WORKING_DIR}}` in
|
|
||||||
combination with `includes` (#1046, #1205, #1250, #1293, #1312, #1274 by
|
|
||||||
@andarto, #1309 by @andreynering).
|
|
||||||
- Fix bug on `--status` flag. Running this flag should not have side-effects: it
|
|
||||||
should not update the checksum on `.task`, only report its status (#1305,
|
|
||||||
#1307 by @visciang, #1313 by @andreynering).
|
|
||||||
|
|
||||||
## v3.28.0 - 2023-07-24
|
|
||||||
|
|
||||||
- Added the ability to
|
|
||||||
[loop over commands and tasks](https://taskfile.dev/usage/#looping-over-values)
|
|
||||||
using `for` (#82, #1220 by @pd93).
|
|
||||||
- Fixed variable propagation in multi-level includes (#778, #996, #1256 by
|
|
||||||
@hudclark).
|
|
||||||
- Fixed a bug where the `--exit-code` code flag was not returning the correct
|
|
||||||
exit code when calling commands indirectly (#1266, #1270 by @pd93).
|
|
||||||
- Fixed a `nil` panic when a dependency was commented out or left empty (#1263
|
|
||||||
by @neomantra).
|
|
||||||
|
|
||||||
## v3.27.1 - 2023-06-30
|
|
||||||
|
|
||||||
- Fix panic when a `.env` directory (not file) is present on current directory
|
|
||||||
(#1244, #1245 by @pd93).
|
|
||||||
|
|
||||||
## v3.27.0 - 2023-06-29
|
|
||||||
|
|
||||||
- Allow Taskfiles starting with lowercase characters (#947, #1221 by @pd93).
|
|
||||||
- e.g. `taskfile.yml`, `taskfile.yaml`, `taskfile.dist.yml` &
|
|
||||||
`taskfile.dist.yaml`
|
|
||||||
- Bug fixes were made to the
|
|
||||||
[npm installation method](https://taskfile.dev/installation/#npm). (#1190, by
|
|
||||||
@sounisi5011).
|
|
||||||
- Added the
|
|
||||||
[gentle force experiment](https://taskfile.dev/experiments/gentle-force) as a
|
|
||||||
draft (#1200, #1216 by @pd93).
|
|
||||||
- Added an `--experiments` flag to allow you to see which experiments are
|
|
||||||
enabled (#1242 by @pd93).
|
|
||||||
- Added ability to specify which variables are required in a task (#1203, #1204
|
|
||||||
by @benc-uk).
|
|
||||||
|
|
||||||
## v3.26.0 - 2023-06-10
|
|
||||||
|
|
||||||
- Only rewrite checksum files in `.task` if the checksum has changed (#1185,
|
|
||||||
#1194 by @deviantintegral).
|
|
||||||
- Added [experiments documentation](https://taskfile.dev/experiments) to the
|
|
||||||
website (#1198 by @pd93).
|
|
||||||
- Deprecated `version: 2` schema. This will be removed in the next major release
|
|
||||||
(#1197, #1198, #1199 by @pd93).
|
|
||||||
- Added a new `prompt:` prop to set a warning prompt to be shown before running
|
|
||||||
a potential dangerous task (#100, #1163 by @MaxCheetham,
|
|
||||||
[Documentation](https://taskfile.dev/usage/#warning-prompts)).
|
|
||||||
- Added support for single command task syntax. With this change, it's now
|
|
||||||
possible to declare just `cmd:` in a task, avoiding the more complex
|
|
||||||
`cmds: []` when you have only a single command for that task (#1130, #1131 by
|
|
||||||
@timdp).
|
|
||||||
|
|
||||||
## v3.25.0 - 2023-05-22
|
|
||||||
|
|
||||||
- Support `silent:` when calling another tasks (#680, #1142 by @danquah).
|
|
||||||
- Improve PowerShell completion script (#1168 by @trim21).
|
|
||||||
- Add more languages to the website menu and show translation progress
|
|
||||||
percentage (#1173 by @misitebao).
|
|
||||||
- Starting on this release, official binaries for FreeBSD will be available to
|
|
||||||
download (#1068 by @andreynering).
|
|
||||||
- Fix some errors being unintendedly suppressed (#1134 by @clintmod).
|
|
||||||
- Fix a nil pointer error when `version` is omitted from a Taskfile (#1148,
|
|
||||||
#1149 by @pd93).
|
|
||||||
- Fix duplicate error message when a task does not exists (#1141, #1144 by
|
|
||||||
@pd93).
|
|
||||||
|
|
||||||
## v3.24.0 - 2023-04-15
|
|
||||||
|
|
||||||
- Fix Fish shell completion for tasks with aliases (#1113 by @patricksjackson).
|
|
||||||
- The default branch was renamed from `master` to `main` (#1049, #1048 by
|
|
||||||
@pd93).
|
|
||||||
- Fix bug where "up-to-date" logs were not being omitted for silent tasks (#546,
|
|
||||||
#1107 by @danquah).
|
|
||||||
- Add `.hg` (Mercurial) to the list of ignored directories when using `--watch`
|
|
||||||
(#1098 by @misery).
|
|
||||||
- More improvements to the release tool (#1096 by @pd93).
|
|
||||||
- Enforce [gofumpt](https://github.com/mvdan/gofumpt) linter (#1099 by @pd93)
|
|
||||||
- Add `--sort` flag for use with `--list` and `--list-all` (#946, #1105 by
|
|
||||||
@pd93).
|
|
||||||
- Task now has [custom exit codes](https://taskfile.dev/api/#exit-codes)
|
|
||||||
depending on the error (#1114 by @pd93).
|
|
||||||
|
|
||||||
## v3.23.0 - 2023-03-26
|
|
||||||
|
|
||||||
Task now has an
|
|
||||||
[official extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=task.vscode-task)
|
|
||||||
contributed by @pd93! :tada: The extension is maintained in a
|
|
||||||
[new repository](https://github.com/go-task/vscode-task) under the `go-task`
|
|
||||||
organization. We're looking to gather feedback from the community so please give
|
|
||||||
it a go and let us know what you think via a
|
|
||||||
[discussion](https://github.com/go-task/vscode-task/discussions),
|
|
||||||
[issue](https://github.com/go-task/vscode-task/issues) or on our
|
|
||||||
[Discord](https://discord.gg/6TY36E39UK)!
|
|
||||||
|
|
||||||
> **NOTE:** The extension _requires_ v3.23.0 to be installed in order to work.
|
|
||||||
|
|
||||||
- The website was integrated with
|
|
||||||
[Crowdin](https://crowdin.com/project/taskfile) to allow the community to
|
|
||||||
contribute with translations! [Chinese](https://taskfile.dev/zh-Hans/) is the
|
|
||||||
first language available (#1057, #1058 by @misitebao).
|
|
||||||
- Added task location data to the `--json` flag output (#1056 by @pd93)
|
|
||||||
- Change the name of the file generated by `task --init` from `Taskfile.yaml` to
|
|
||||||
`Taskfile.yml` (#1062 by @misitebao).
|
|
||||||
- Added new `splitArgs` template function
|
|
||||||
(`{{splitArgs "foo bar 'foo bar baz'"}}`) to ensure string is split as
|
|
||||||
arguments (#1040, #1059 by @dhanusaputra).
|
|
||||||
- Fix the value of `{{.CHECKSUM}}` variable in status (#1076, #1080 by @pd93).
|
|
||||||
- Fixed deep copy implementation (#1072 by @pd93)
|
|
||||||
- Created a tool to assist with releases (#1086 by @pd93).
|
|
||||||
|
|
||||||
## v3.22.0 - 2023-03-10
|
|
||||||
|
|
||||||
- Add a brand new `--global` (`-g`) flag that will run a Taskfile from your
|
|
||||||
`$HOME` directory. This is useful to have automation that you can run from
|
|
||||||
anywhere in your system!
|
|
||||||
([Documentation](https://taskfile.dev/usage/#running-a-global-taskfile), #1029
|
|
||||||
by @andreynering).
|
|
||||||
- Add ability to set `error_only: true` on the `group` output mode. This will
|
|
||||||
instruct Task to only print a command output if it returned with a non-zero
|
|
||||||
exit code (#664, #1022 by @jaedle).
|
|
||||||
- Fixed bug where `.task/checksum` file was sometimes not being created when
|
|
||||||
task also declares a `status:` (#840, #1035 by @harelwa, #1037 by @pd93).
|
|
||||||
- Refactored and decoupled fingerprinting from the main Task executor (#1039 by
|
|
||||||
@pd93).
|
|
||||||
- Fixed deadlock issue when using `run: once` (#715, #1025 by
|
|
||||||
@theunrepentantgeek).
|
|
||||||
|
|
||||||
## v3.21.0 - 2023-02-22
|
|
||||||
|
|
||||||
- Added new `TASK_VERSION` special variable (#990, #1014 by @ja1code).
|
|
||||||
- Fixed a bug where tasks were sometimes incorrectly marked as internal (#1007
|
|
||||||
by @pd93).
|
|
||||||
- Update to Go 1.20 (bump minimum version to 1.19) (#1010 by @pd93)
|
|
||||||
- Added environment variable `FORCE_COLOR` support to force color output. Useful
|
|
||||||
for environments without TTY (#1003 by @automation-stack)
|
|
||||||
|
|
||||||
## v3.20.0 - 2023-01-14
|
|
||||||
|
|
||||||
- Improve behavior and performance of status checking when using the `timestamp`
|
|
||||||
mode (#976, #977 by @aminya).
|
|
||||||
- Performance optimizations were made for large Taskfiles (#982 by @pd93).
|
|
||||||
- Add ability to configure options for the
|
|
||||||
[`set`](https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html)
|
|
||||||
and
|
|
||||||
[`shopt`](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html)
|
|
||||||
builtins (#908, #929 by @pd93,
|
|
||||||
[Documentation](http://taskfile.dev/usage/#set-and-shopt)).
|
|
||||||
- Add new `platforms:` attribute to `task` and `cmd`, so it's now possible to
|
|
||||||
choose in which platforms that given task or command will be run on. Possible
|
|
||||||
values are operating system (GOOS), architecture (GOARCH) or a combination of
|
|
||||||
the two. Example: `platforms: [linux]`, `platforms: [amd64]` or
|
|
||||||
`platforms: [linux/amd64]`. Other platforms will be skipped (#978, #980 by
|
|
||||||
@leaanthony).
|
|
||||||
|
|
||||||
## v3.19.1 - 2022-12-31
|
|
||||||
|
|
||||||
- Small bug fix: closing `Taskfile.yml` once we're done reading it (#963, #964
|
|
||||||
by @HeCorr).
|
|
||||||
- Fixes a bug in v2 that caused a panic when using a `Taskfile_{{OS}}.yml` file
|
|
||||||
(#961, #971 by @pd93).
|
|
||||||
- Fixed a bug where watch intervals set in the Taskfile were not being respected
|
|
||||||
(#969, #970 by @pd93)
|
|
||||||
- Add `--json` flag (alias `-j`) with the intent to improve support for code
|
|
||||||
editors and add room to other possible integrations. This is basic for now,
|
|
||||||
but we plan to add more info in the near future (#936 by @davidalpert, #764).
|
|
||||||
|
|
||||||
## v3.19.0 - 2022-12-05
|
|
||||||
|
|
||||||
- Installation via npm now supports [pnpm](https://pnpm.io/) as well
|
|
||||||
([go-task/go-npm#2](https://github.com/go-task/go-npm/issues/2),
|
|
||||||
[go-task/go-npm#3](https://github.com/go-task/go-npm/pull/3)).
|
|
||||||
- It's now possible to run Taskfiles from subdirectories! A new
|
|
||||||
`USER_WORKING_DIR` special variable was added to add even more flexibility for
|
|
||||||
monorepos (#289, #920).
|
|
||||||
- Add task-level `dotenv` support (#389, #904).
|
|
||||||
- It's now possible to use global level variables on `includes` (#942, #943).
|
|
||||||
- The website got a brand new
|
|
||||||
[translation to Chinese](https://task-zh.readthedocs.io/zh_CN/latest/) by
|
|
||||||
[@DeronW](https://github.com/DeronW). Thanks!
|
|
||||||
|
|
||||||
## v3.18.0 - 2022-11-12
|
|
||||||
|
|
||||||
- Show aliases on `task --list --silent` (`task --ls`). This means that aliases
|
|
||||||
will be completed by the completion scripts (#919).
|
|
||||||
- Tasks in the root Taskfile will now be displayed first in
|
|
||||||
`--list`/`--list-all` output (#806, #890).
|
|
||||||
- It's now possible to call a `default` task in an included Taskfile by using
|
|
||||||
just the namespace. For example: `docs:default` is now automatically aliased
|
|
||||||
to `docs` (#661, #815).
|
|
||||||
|
|
||||||
## v3.17.0 - 2022-10-14
|
|
||||||
|
|
||||||
- Add a "Did you mean ...?" suggestion when a task does not exits another one
|
|
||||||
with a similar name is found (#867, #880).
|
|
||||||
- Now YAML parse errors will print which Taskfile failed to parse (#885, #887).
|
|
||||||
- Add ability to set `aliases` for tasks and namespaces (#268, #340, #879).
|
|
||||||
- Improvements to Fish shell completion (#897).
|
|
||||||
- Added ability to set a different watch interval by setting `interval: '500ms'`
|
|
||||||
or using the `--interval=500ms` flag (#813, #865).
|
|
||||||
- Add colored output to `--list`, `--list-all` and `--summary` flags (#845,
|
|
||||||
#874).
|
|
||||||
- Fix unexpected behavior where `label:` was being shown instead of the task
|
|
||||||
name on `--list` (#603, #877).
|
|
||||||
|
|
||||||
## v3.16.0 - 2022-09-29
|
|
||||||
|
|
||||||
- Add `npm` as new installation method: `npm i -g @go-task/cli` (#870, #871,
|
|
||||||
[npm package](https://www.npmjs.com/package/@go-task/cli)).
|
|
||||||
- Add support to marking tasks and includes as internal, which will hide them
|
|
||||||
from `--list` and `--list-all` (#818).
|
|
||||||
|
|
||||||
## v3.15.2 - 2022-09-08
|
|
||||||
|
|
||||||
- Fix error when using variable in `env:` introduced in the previous release
|
|
||||||
(#858, #866).
|
|
||||||
- Fix handling of `CLI_ARGS` (`--`) in Bash completion (#863).
|
|
||||||
- On zsh completion, add ability to replace `--list-all` with `--list` as
|
|
||||||
already possible on the Bash completion (#861).
|
|
||||||
|
|
||||||
## v3.15.0 - 2022-09-03
|
|
||||||
|
|
||||||
- Add new special variables `ROOT_DIR` and `TASKFILE_DIR`. This was a highly
|
|
||||||
requested feature (#215, #857,
|
|
||||||
[Documentation](https://taskfile.dev/api/#special-variables)).
|
|
||||||
- Follow symlinks on `sources` (#826, #831).
|
|
||||||
- Improvements and fixes to Bash completion (#835, #844).
|
|
||||||
|
|
||||||
## v3.14.1 - 2022-08-03
|
|
||||||
|
|
||||||
- Always resolve relative include paths relative to the including Taskfile
|
|
||||||
(#822, #823).
|
|
||||||
- Fix ZSH and PowerShell completions to consider all tasks instead of just the
|
|
||||||
public ones (those with descriptions) (#803).
|
|
||||||
|
|
||||||
## v3.14.0 - 2022-07-08
|
|
||||||
|
|
||||||
- Add ability to override the `.task` directory location with the
|
|
||||||
`TASK_TEMP_DIR` environment variable.
|
|
||||||
- Allow to override Task colors using environment variables: `TASK_COLOR_RESET`,
|
|
||||||
`TASK_COLOR_BLUE`, `TASK_COLOR_GREEN`, `TASK_COLOR_CYAN`, `TASK_COLOR_YELLOW`,
|
|
||||||
`TASK_COLOR_MAGENTA` and `TASK_COLOR_RED` (#568, #792).
|
|
||||||
- Fixed bug when using the `output: group` mode where STDOUT and STDERR were
|
|
||||||
being print in separated blocks instead of in the right order (#779).
|
|
||||||
- Starting on this release, ARM architecture binaries are been released to Snap
|
|
||||||
as well (#795).
|
|
||||||
- i386 binaries won't be available anymore on Snap because Ubuntu removed the
|
|
||||||
support for this architecture.
|
|
||||||
- Upgrade mvdan.cc/sh, which fixes a bug with associative arrays (#785,
|
|
||||||
[mvdan/sh#884](https://github.com/mvdan/sh/issues/884),
|
|
||||||
[mvdan/sh#893](https://github.com/mvdan/sh/pull/893)).
|
|
||||||
|
|
||||||
## v3.13.0 - 2022-06-13
|
|
||||||
|
|
||||||
- Added `-n` as an alias to `--dry` (#776, #777).
|
|
||||||
- Fix behavior of interrupt (SIGINT, SIGTERM) signals. Task will now give time
|
|
||||||
for the processes running to do cleanup work (#458, #479, #728, #769).
|
|
||||||
- Add new `--exit-code` (`-x`) flag that will pass-through the exit form the
|
|
||||||
command being ran (#755).
|
|
||||||
|
|
||||||
## v3.12.1 - 2022-05-10
|
|
||||||
|
|
||||||
- Fixed bug where, on Windows, variables were ending with `\r` because we were
|
|
||||||
only removing the final `\n` but not `\r\n` (#717).
|
|
||||||
|
|
||||||
## v3.12.0 - 2022-03-31
|
|
||||||
|
|
||||||
- The `--list` and `--list-all` flags can now be combined with the `--silent`
|
|
||||||
flag to print the task names only, without their description (#691).
|
|
||||||
- Added support for multi-level inclusion of Taskfiles. This means that included
|
|
||||||
Taskfiles can also include other Taskfiles. Before this was limited to one
|
|
||||||
level (#390, #623, #656).
|
|
||||||
- Add ability to specify vars when including a Taskfile.
|
|
||||||
[Check out the documentation](https://taskfile.dev/#/usage?id=vars-of-included-taskfiles)
|
|
||||||
for more information (#677).
|
|
||||||
|
|
||||||
## v3.11.0 - 2022-02-19
|
|
||||||
|
|
||||||
- Task now supports printing begin and end messages when using the `group`
|
|
||||||
output mode, useful for grouping tasks in CI systems.
|
|
||||||
[Check out the documentation](http://taskfile.dev/#/usage?id=output-syntax)
|
|
||||||
for more information (#647, #651).
|
|
||||||
- Add `Taskfile.dist.yml` and `Taskfile.dist.yaml` to the supported file name
|
|
||||||
list.
|
|
||||||
[Check out the documentation](https://taskfile.dev/#/usage?id=supported-file-names)
|
|
||||||
for more information (#498, #666).
|
|
||||||
|
|
||||||
## v3.10.0 - 2022-01-04
|
|
||||||
|
|
||||||
- A new `--list-all` (alias `-a`) flag is now available. It's similar to the
|
|
||||||
exiting `--list` (`-l`) but prints all tasks, even those without a description
|
|
||||||
(#383, #401).
|
|
||||||
- It's now possible to schedule cleanup commands to run once a task finishes
|
|
||||||
with the `defer:` keyword
|
|
||||||
([Documentation](https://taskfile.dev/#/usage?id=doing-task-cleanup-with-defer),
|
|
||||||
#475, #626).
|
|
||||||
- Remove long deprecated and undocumented `$` variable prefix and `^` command
|
|
||||||
prefix (#642, #644, #645).
|
|
||||||
- Add support for `.yaml` extension (as an alternative to `.yml`). This was
|
- Add support for `.yaml` extension (as an alternative to `.yml`). This was
|
||||||
requested multiple times throughout the years. Enjoy! (#183, #184, #369, #584,
|
requested multiple times throughout the years. Enjoy! (#183, #184, #369, #584,
|
||||||
#621).
|
#621).
|
||||||
@@ -871,8 +518,8 @@ it a go and let us know what you think via a
|
|||||||
|
|
||||||
- Add logging in verbose mode for when a task starts and finishes (#533, #588).
|
- Add logging in verbose mode for when a task starts and finishes (#533, #588).
|
||||||
- Fix an issue with preconditions and context errors (#597, #598).
|
- Fix an issue with preconditions and context errors (#597, #598).
|
||||||
- Quote each `{{.CLI_ARGS}}` argument to prevent one with spaces to become many
|
- Quote each <span v-pre>`{{.CLI_ARGS}}`</span> argument to prevent one with
|
||||||
(#613).
|
spaces to become many (#613).
|
||||||
- Fix nil pointer when `cmd:` was left empty (#612, #614).
|
- Fix nil pointer when `cmd:` was left empty (#612, #614).
|
||||||
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains two relevant
|
- Upgrade [mvdan/sh](https://github.com/mvdan/sh) which contains two relevant
|
||||||
fixes:
|
fixes:
|
||||||
@@ -888,8 +535,8 @@ it a go and let us know what you think via a
|
|||||||
## v3.9.0 - 2021-10-02
|
## v3.9.0 - 2021-10-02
|
||||||
|
|
||||||
- A new `shellQuote` function was added to the template system
|
- A new `shellQuote` function was added to the template system
|
||||||
(`{{shellQuote "a string"}}`) to ensure a string is safe for use in shell
|
(<span v-pre>`{{shellQuote "a string"}}`</span>) to ensure a string is safe
|
||||||
([mvdan/sh#727](https://github.com/mvdan/sh/pull/727),
|
for use in shell ([mvdan/sh#727](https://github.com/mvdan/sh/pull/727),
|
||||||
[mvdan/sh#737](https://github.com/mvdan/sh/pull/737),
|
[mvdan/sh#737](https://github.com/mvdan/sh/pull/737),
|
||||||
[Documentation](https://pkg.go.dev/mvdan.cc/sh/v3@v3.4.0/syntax#Quote))
|
[Documentation](https://pkg.go.dev/mvdan.cc/sh/v3@v3.4.0/syntax#Quote))
|
||||||
- In this version [mvdan.cc/sh](https://github.com/mvdan/sh) was upgraded with
|
- In this version [mvdan.cc/sh](https://github.com/mvdan/sh) was upgraded with
|
@@ -1,6 +1,9 @@
|
|||||||
---
|
---
|
||||||
slug: /community/
|
title: Community
|
||||||
sidebar_position: 10
|
description:
|
||||||
|
Task community contributions, installation methods, and integrations
|
||||||
|
maintained by third parties
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Community
|
# Community
|
||||||
@@ -13,7 +16,7 @@ thankful for everyone that helps me to improve the overall experience.
|
|||||||
|
|
||||||
Many of our integrations are contributed and maintained by the community. You
|
Many of our integrations are contributed and maintained by the community. You
|
||||||
can view the full list of community integrations
|
can view the full list of community integrations
|
||||||
[here](/integrations#community-integrations).
|
[here](./integrations.md#community-integrations).
|
||||||
|
|
||||||
## Installation methods
|
## Installation methods
|
||||||
|
|
@@ -1,6 +1,9 @@
|
|||||||
---
|
---
|
||||||
slug: /contributing/
|
title: Contributing
|
||||||
sidebar_position: 12
|
description:
|
||||||
|
Comprehensive guide for contributing to the Task project, including setup,
|
||||||
|
development, testing, and submitting PRs
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
@@ -8,7 +11,7 @@ sidebar_position: 12
|
|||||||
Contributions to Task are very welcome, but we ask that you read this document
|
Contributions to Task are very welcome, but we ask that you read this document
|
||||||
before submitting a PR.
|
before submitting a PR.
|
||||||
|
|
||||||
:::note
|
::: info
|
||||||
|
|
||||||
This document applies to the core [Task][task] repository _and_ [Task for Visual
|
This document applies to the core [Task][task] repository _and_ [Task for Visual
|
||||||
Studio Code][vscode-task].
|
Studio Code][vscode-task].
|
||||||
@@ -27,9 +30,10 @@ Studio Code][vscode-task].
|
|||||||
you invest your time into a PR.
|
you invest your time into a PR.
|
||||||
- **Experiments** - If there is no way to make your change backward compatible
|
- **Experiments** - If there is no way to make your change backward compatible
|
||||||
then there is a procedure to introduce breaking changes into minor versions.
|
then there is a procedure to introduce breaking changes into minor versions.
|
||||||
We call these "[experiments][experiments]". If you're intending to work on an
|
We call these "[experiments](./experiments/index.md)". If you're intending to work on
|
||||||
experiment, then please read the [experiments workflow][experiments-workflow]
|
an experiment, then please read the
|
||||||
document carefully and submit a proposal first.
|
[experiments workflow](./experiments/index.md#workflow) document carefully and submit a
|
||||||
|
proposal first.
|
||||||
|
|
||||||
## 1. Setup
|
## 1. Setup
|
||||||
|
|
||||||
@@ -38,7 +42,7 @@ Studio Code][vscode-task].
|
|||||||
- **Node.js** - [Node.js][nodejs] is used to host Task's documentation server
|
- **Node.js** - [Node.js][nodejs] is used to host Task's documentation server
|
||||||
and is required if you want to run this server locally. It is also required if
|
and is required if you want to run this server locally. It is also required if
|
||||||
you want to contribute to the Visual Studio Code extension.
|
you want to contribute to the Visual Studio Code extension.
|
||||||
- **Yarn** - [Yarn][yarn] is the Node.js package manager used by Task.
|
- **Pnpm** - [Pnpm][pnpm] is the Node.js package manager used by Task.
|
||||||
|
|
||||||
## 2. Making changes
|
## 2. Making changes
|
||||||
|
|
||||||
@@ -49,10 +53,11 @@ Studio Code][vscode-task].
|
|||||||
docs][golangci-lint-docs] for a guide on how to setup your editor to
|
docs][golangci-lint-docs] for a guide on how to setup your editor to
|
||||||
auto-format your code. Any Markdown or TypeScript files should be formatted
|
auto-format your code. Any Markdown or TypeScript files should be formatted
|
||||||
and linted by [Prettier][prettier]. This style is enforced by our CI to ensure
|
and linted by [Prettier][prettier]. This style is enforced by our CI to ensure
|
||||||
that we have a consistent style across the project. You can use the `task
|
that we have a consistent style across the project. You can use the
|
||||||
lint` command to lint the code locally and the `task lint:fix` command to try
|
`task lint` command to lint the code locally and the `task lint:fix` command
|
||||||
to automatically fix any issues that are found. You can also use the `task
|
to try to automatically fix any issues that are found. You can also use the
|
||||||
fmt` command to auto-format the files if your editor doesn't do it for you.
|
`task fmt` command to auto-format the files if your editor doesn't do it for
|
||||||
|
you.
|
||||||
- **Documentation** - Ensure that you add/update any relevant documentation. See
|
- **Documentation** - Ensure that you add/update any relevant documentation. See
|
||||||
the [updating documentation](#updating-documentation) section below.
|
the [updating documentation](#updating-documentation) section below.
|
||||||
- **Tests** - Ensure that you add/update any relevant tests and that all tests
|
- **Tests** - Ensure that you add/update any relevant tests and that all tests
|
||||||
@@ -74,24 +79,23 @@ install the extension.
|
|||||||
|
|
||||||
### Updating documentation
|
### Updating documentation
|
||||||
|
|
||||||
Task uses [Docusaurus][docusaurus] to host a documentation server. The code for
|
Task uses [Vitepress][vitepress] to host a documentation server. The code for
|
||||||
this is located in the core Task repository. This can be setup and run locally
|
this is located in the core Task repository. This can be setup and run locally
|
||||||
by using `task website` (requires `nodejs` & `yarn`). All content is written in
|
by using `task website` (requires `nodejs` & `pnpm`). All content is written in
|
||||||
[MDX][mdx] (an extension of Markdown) and is located in the `website/docs`
|
Markdown and is located in the `website/src` directory. All Markdown documents
|
||||||
directory. All Markdown documents should have an 80 character line wrap limit
|
should have an 80 character line wrap limit (enforced by Prettier).
|
||||||
(enforced by Prettier).
|
|
||||||
|
|
||||||
When making a change, consider whether a change to the [Usage Guide](/usage) is
|
When making a change, consider whether a change to the [Usage Guide](/docs/guide) is
|
||||||
necessary. This document contains descriptions and examples of how to use Task
|
necessary. This document contains descriptions and examples of how to use Task
|
||||||
features. If you're adding a new feature, try to find an appropriate place to
|
features. If you're adding a new feature, try to find an appropriate place to
|
||||||
add a new section. If you're updating an existing feature, ensure that the
|
add a new section. If you're updating an existing feature, ensure that the
|
||||||
documentation and any examples are up-to-date. Ensure that any examples follow
|
documentation and any examples are up-to-date. Ensure that any examples follow
|
||||||
the [Taskfile Styleguide](/styleguide).
|
the [Taskfile Styleguide](./styleguide.md).
|
||||||
|
|
||||||
If you added a new command or flag, ensure that you add it to the [CLI
|
If you added a new command or flag, ensure that you add it to the
|
||||||
Reference](/reference/cli). New fields also need to be added to the [Schema
|
[CLI Reference](./reference/cli.md). New fields also need to be added to the
|
||||||
Reference](/reference/schema) and [JSON Schema][json-schema]. The descriptions
|
[Schema Reference](./reference/schema.md) and [JSON Schema][json-schema]. The
|
||||||
for fields in the docs and the schema should match.
|
descriptions for fields in the docs and the schema should match.
|
||||||
|
|
||||||
### Writing tests
|
### Writing tests
|
||||||
|
|
||||||
@@ -143,7 +147,7 @@ contributions.
|
|||||||
|
|
||||||
All kinds of contributions are welcome, whether its a typo fix or a shiny new
|
All kinds of contributions are welcome, whether its a typo fix or a shiny new
|
||||||
feature. You can also contribute by upvoting/commenting on issues, helping to
|
feature. You can also contribute by upvoting/commenting on issues, helping to
|
||||||
answer questions or contributing to other [community projects](/community).
|
answer questions or contributing to other [community projects](./community.md).
|
||||||
|
|
||||||
> I'm stuck, where can I get help?
|
> I'm stuck, where can I get help?
|
||||||
|
|
||||||
@@ -152,9 +156,6 @@ If you have questions, feel free to ask them in the `#help` forum channel on our
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[experiments]: /experiments
|
|
||||||
[experiments-workflow]: /experiments#workflow
|
|
||||||
[task]: https://github.com/go-task/task
|
[task]: https://github.com/go-task/task
|
||||||
[vscode-task]: https://github.com/go-task/vscode-task
|
[vscode-task]: https://github.com/go-task/vscode-task
|
||||||
[go]: https://go.dev
|
[go]: https://go.dev
|
||||||
@@ -164,14 +165,15 @@ If you have questions, feel free to ask them in the `#help` forum channel on our
|
|||||||
[golangci-lint-docs]: https://golangci-lint.run/welcome/integrations/
|
[golangci-lint-docs]: https://golangci-lint.run/welcome/integrations/
|
||||||
[prettier]: https://prettier.io
|
[prettier]: https://prettier.io
|
||||||
[nodejs]: https://nodejs.org/en/
|
[nodejs]: https://nodejs.org/en/
|
||||||
[yarn]: https://yarnpkg.com/
|
[pnpm]: https://pnpm.io/
|
||||||
[docusaurus]: https://docusaurus.io
|
[vitepress]: https://vitepress.dev
|
||||||
[json-schema]: https://github.com/go-task/task/blob/main/website/static/schema.json
|
[json-schema]:
|
||||||
|
https://github.com/go-task/task/blob/main/website/static/schema.json
|
||||||
[task-open-issues]: https://github.com/go-task/task/issues
|
[task-open-issues]: https://github.com/go-task/task/issues
|
||||||
[vscode-task-open-issues]: https://github.com/go-task/vscode-task/issues
|
[vscode-task-open-issues]: https://github.com/go-task/vscode-task/issues
|
||||||
[good-first-issue]: https://github.com/go-task/task/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
|
[good-first-issue]:
|
||||||
|
https://github.com/go-task/task/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
|
||||||
[discord-server]: https://discord.gg/6TY36E39UK
|
[discord-server]: https://discord.gg/6TY36E39UK
|
||||||
[discussion]: https://github.com/go-task/task/discussions
|
[discussion]: https://github.com/go-task/task/discussions
|
||||||
[conventional-commits]: https://www.conventionalcommits.org
|
[conventional-commits]: https://www.conventionalcommits.org
|
||||||
[mdx]: https://mdxjs.com/
|
[mdx]: https://mdxjs.com/
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,10 +1,12 @@
|
|||||||
---
|
---
|
||||||
slug: /deprecations/completion-scripts/
|
title: 'Completion Scripts'
|
||||||
|
description: Deprecation of direct completion scripts in Task’s Git directory
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Completion Scripts
|
# Completion Scripts
|
||||||
|
|
||||||
:::warning
|
::: danger
|
||||||
|
|
||||||
This deprecation breaks the following functionality:
|
This deprecation breaks the following functionality:
|
||||||
|
|
||||||
@@ -19,7 +21,5 @@ the future as the scripts may be moved or deleted entirely. Any configuration
|
|||||||
should be updated to use the [new method for generating shell
|
should be updated to use the [new method for generating shell
|
||||||
completions][completions] instead.
|
completions][completions] instead.
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
[completions]: /docs/installation#setup-completions
|
||||||
[completions]: ../installation.mdx#setup-completions
|
|
||||||
[task]: https://github.com/go-task/task
|
[task]: https://github.com/go-task/task
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,6 +1,9 @@
|
|||||||
---
|
---
|
||||||
slug: /deprecations/
|
title: Deprecations
|
||||||
sidebar_position: 8
|
description:
|
||||||
|
Guide to deprecated features in Task and how to migrate to the new
|
||||||
|
alternatives
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Deprecations
|
# Deprecations
|
@@ -1,10 +1,14 @@
|
|||||||
---
|
---
|
||||||
slug: /deprecations/template-functions/
|
title: 'Template Functions'
|
||||||
|
description:
|
||||||
|
Deprecation of some templating functions in Task, with guidance on their
|
||||||
|
replacements.
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Template Functions
|
# Template Functions
|
||||||
|
|
||||||
:::warning
|
::: danger
|
||||||
|
|
||||||
This deprecation breaks the following functionality:
|
This deprecation breaks the following functionality:
|
||||||
|
|
24
website/src/docs/deprecations/template.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
# This is a template for deprecation documentation
|
||||||
|
# Copy this page and fill in the details as necessary
|
||||||
|
title: '--- Template ---'
|
||||||
|
description: Template for documenting deprecated features in Task
|
||||||
|
draft: true # Hide in production
|
||||||
|
outline: deep
|
||||||
|
---
|
||||||
|
|
||||||
|
# {Name of Deprecated Feature} (#{Issue})
|
||||||
|
|
||||||
|
::: danger
|
||||||
|
|
||||||
|
This deprecation breaks the following functionality:
|
||||||
|
|
||||||
|
- {list any existing functionality that will be broken by this deprecation}
|
||||||
|
- {if there are no breaking changes, remove this admonition}
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
{Short description of the feature/behavior and why it is being deprecated}
|
||||||
|
|
||||||
|
{Short explanation of any replacement features/behaviors and how users should
|
||||||
|
migrate to it}
|
@@ -1,10 +1,12 @@
|
|||||||
---
|
---
|
||||||
slug: /deprecations/version-2-schema/
|
title: 'Version 2 Schema (#1197)'
|
||||||
|
description: Deprecation of Taskfile schema version 2 and migration to version 3
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Version 2 Schema (#1197)
|
# Version 2 Schema (#1197)
|
||||||
|
|
||||||
:::warning
|
::: danger
|
||||||
|
|
||||||
This deprecation breaks the following functionality:
|
This deprecation breaks the following functionality:
|
||||||
|
|
||||||
@@ -26,8 +28,6 @@ main branch. To use a more recent version of Task, you will need to ensure that
|
|||||||
your Taskfile uses the version 3 schema instead. A list of changes between
|
your Taskfile uses the version 3 schema instead. A list of changes between
|
||||||
version 2 and version 3 are available in the [Task v3 Release Notes][v3.0.0].
|
version 2 and version 3 are available in the [Task v3 Release Notes][v3.0.0].
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[v3.0.0]: https://github.com/go-task/task/releases/tag/v3.0.0
|
[v3.0.0]: https://github.com/go-task/task/releases/tag/v3.0.0
|
||||||
[v3.33.0]: https://github.com/go-task/task/releases/tag/v3.33.0
|
[v3.33.0]: https://github.com/go-task/task/releases/tag/v3.33.0
|
||||||
[deprecation-notice]: https://github.com/go-task/task/issues/1197
|
[deprecation-notice]: https://github.com/go-task/task/issues/1197
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,10 +1,13 @@
|
|||||||
---
|
---
|
||||||
slug: '/experiments/env-precedence'
|
title: 'Env Precedence (#1038)'
|
||||||
|
description:
|
||||||
|
Experiment to change the precedence of environment variables in Task
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Env Precedence (#1038)
|
# Env Precedence (#1038)
|
||||||
|
|
||||||
:::caution
|
::: warning
|
||||||
|
|
||||||
All experimental features are subject to breaking changes and/or removal _at any
|
All experimental features are subject to breaking changes and/or removal _at any
|
||||||
time_. We strongly recommend that you do not use these features in a production
|
time_. We strongly recommend that you do not use these features in a production
|
||||||
@@ -12,7 +15,7 @@ environment. They are intended for testing and feedback only.
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::warning
|
::: danger
|
||||||
|
|
||||||
This experiment breaks the following functionality:
|
This experiment breaks the following functionality:
|
||||||
|
|
||||||
@@ -20,11 +23,12 @@ This experiment breaks the following functionality:
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
To enable this experiment, set the environment variable:
|
To enable this experiment, set the environment variable:
|
||||||
`TASK_X_ENV_PRECEDENCE=1`. Check out [our guide to enabling
|
`TASK_X_ENV_PRECEDENCE=1`. Check out
|
||||||
experiments][enabling-experiments] for more information.
|
[our guide to enabling experiments](./index.md#enabling-experiments) for more
|
||||||
|
information.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -44,11 +48,12 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- echo "$KEY"
|
- echo "$KEY"
|
||||||
```
|
```
|
||||||
|
|
||||||
Running `KEY=some task` before this experiment, the output would be `some`, but
|
Running `KEY=some task` before this experiment, the output would be `some`, but
|
||||||
after this experiment, the output would be `other`.
|
after this experiment, the output would be `other`.
|
||||||
|
|
||||||
If you still want to get the OS variable, you can use the template function env
|
If you still want to get the OS variable, you can use the template function env
|
||||||
like follow : `{{env "OS_VAR"}}`.
|
like follow : <span v-pre>`{{env "OS_VAR"}}`</span>.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
version: '3'
|
version: '3'
|
||||||
@@ -61,14 +66,12 @@ tasks:
|
|||||||
- echo "$KEY"
|
- echo "$KEY"
|
||||||
- echo {{env "KEY"}}
|
- echo {{env "KEY"}}
|
||||||
```
|
```
|
||||||
|
|
||||||
Running `KEY=some task`, the output would be `other` and `some`.
|
Running `KEY=some task`, the output would be `other` and `some`.
|
||||||
|
|
||||||
Like other variables/envs, you can also fall back to a given value using the
|
Like other variables/envs, you can also fall back to a given value using the
|
||||||
default template function:
|
default template function:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
MY_ENV: '{{.MY_ENV | default "fallback"}}'
|
MY_ENV: '{{.MY_ENV | default "fallback"}}'
|
||||||
```
|
```
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[enabling-experiments]: ./experiments.mdx#enabling-experiments
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,10 +1,12 @@
|
|||||||
---
|
---
|
||||||
slug: /experiments/gentle-force/
|
title: 'Gentle Force (#1200)'
|
||||||
|
description: Experiment to modify the behavior of the --force flag in Task
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Gentle Force (#1200)
|
# Gentle Force (#1200)
|
||||||
|
|
||||||
:::caution
|
::: warning
|
||||||
|
|
||||||
All experimental features are subject to breaking changes and/or removal _at any
|
All experimental features are subject to breaking changes and/or removal _at any
|
||||||
time_. We strongly recommend that you do not use these features in a production
|
time_. We strongly recommend that you do not use these features in a production
|
||||||
@@ -12,7 +14,7 @@ environment. They are intended for testing and feedback only.
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::warning
|
::: danger
|
||||||
|
|
||||||
This experiment breaks the following functionality:
|
This experiment breaks the following functionality:
|
||||||
|
|
||||||
@@ -20,11 +22,12 @@ This experiment breaks the following functionality:
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
To enable this experiment, set the environment variable:
|
To enable this experiment, set the environment variable:
|
||||||
`TASK_X_GENTLE_FORCE=1`. Check out [our guide to enabling experiments
|
`TASK_X_GENTLE_FORCE=1`. Check out
|
||||||
][enabling-experiments] for more information.
|
[our guide to enabling experiments](./index.md#enabling-experiments) for more
|
||||||
|
information.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -43,7 +46,3 @@ If you want to migrate, but continue to force all dependant tasks to run, you
|
|||||||
should replace all uses of the `--force` flag with `--force-all`. Alternatively,
|
should replace all uses of the `--force` flag with `--force-all`. Alternatively,
|
||||||
if you want to adopt the new behavior, you can continue to use the `--force`
|
if you want to adopt the new behavior, you can continue to use the `--force`
|
||||||
flag as you do now!
|
flag as you do now!
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[enabling-experiments]: ./experiments.mdx#enabling-experiments
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,14 +1,12 @@
|
|||||||
---
|
---
|
||||||
slug: /experiments/
|
title: Experiments
|
||||||
sidebar_position: 7
|
description: Guide to Task’s experimental features and how to use them
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
import Tabs from '@theme/Tabs';
|
|
||||||
import TabItem from '@theme/TabItem';
|
|
||||||
|
|
||||||
# Experiments
|
# Experiments
|
||||||
|
|
||||||
:::caution
|
::: warning
|
||||||
|
|
||||||
All experimental features are subject to breaking changes and/or removal _at any
|
All experimental features are subject to breaking changes and/or removal _at any
|
||||||
time_. We strongly recommend that you do not use these features in a production
|
time_. We strongly recommend that you do not use these features in a production
|
||||||
@@ -46,37 +44,36 @@ Which method you use depends on how you intend to use the experiment:
|
|||||||
`.bashrc`, `.zshrc` etc.). This will permanently enable experimental features
|
`.bashrc`, `.zshrc` etc.). This will permanently enable experimental features
|
||||||
for your personal environment.
|
for your personal environment.
|
||||||
|
|
||||||
```shell title="~/.bashrc"
|
```shell
|
||||||
|
# ~/.bashrc
|
||||||
export TASK_X_FEATURE=1
|
export TASK_X_FEATURE=1
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Creating a `.env` or a `.taskrc.yml` file in the same directory as
|
3. Creating a `.env` or a `.taskrc.yml` file in the same directory as your root
|
||||||
your root Taskfile.\
|
Taskfile.\
|
||||||
The `.env` file should contain the relevant environment
|
The `.env` file should contain the relevant environment variable(s), while
|
||||||
variable(s), while the `.taskrc.yml` file should use a YAML format
|
the `.taskrc.yml` file should use a YAML format where each experiment is
|
||||||
where each experiment is defined as a key with a corresponding value.
|
defined as a key with a corresponding value.
|
||||||
|
|
||||||
This allows you to enable an experimental feature at a project level. If you
|
This allows you to enable an experimental feature at a project level. If you
|
||||||
commit this file to source control, then other users of your project will
|
commit this file to source control, then other users of your project will
|
||||||
also have these experiments enabled.
|
also have these experiments enabled.
|
||||||
|
|
||||||
If both files are present, the values in the `.taskrc.yml` file
|
If both files are present, the values in the `.taskrc.yml` file will take
|
||||||
will take precedence.
|
precedence.
|
||||||
|
|
||||||
<Tabs values={[ {label: '.taskrc.yml', value: 'yaml'}, {label: '.env', value: 'env'}]}>
|
::: code-group
|
||||||
<TabItem value="yaml">
|
|
||||||
```yaml title=".taskrc.yml"
|
|
||||||
experiments:
|
|
||||||
FEATURE: 1
|
|
||||||
```
|
|
||||||
</TabItem>
|
|
||||||
|
|
||||||
<TabItem value="env">
|
```yaml [.taskrc.yml]
|
||||||
```shell title=".env"
|
experiments:
|
||||||
TASK_X_FEATURE=1
|
FEATURE: 1
|
||||||
```
|
```
|
||||||
</TabItem>
|
|
||||||
</Tabs>
|
```shell [.env]
|
||||||
|
TASK_X_FEATURE=1
|
||||||
|
```
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
## Workflow
|
## Workflow
|
||||||
|
|
||||||
@@ -112,7 +109,7 @@ the status will be updated via the `status: draft` label. This indicates that an
|
|||||||
implementation is now available for use in a release and the experiment is open
|
implementation is now available for use in a release and the experiment is open
|
||||||
for feedback.
|
for feedback.
|
||||||
|
|
||||||
:::note
|
::: info
|
||||||
|
|
||||||
During the draft period, major changes to the implementation may be made based
|
During the draft period, major changes to the implementation may be made based
|
||||||
on the feedback received from users. There are _no stability guarantees_ and
|
on the feedback received from users. There are _no stability guarantees_ and
|
||||||
@@ -139,13 +136,13 @@ version.
|
|||||||
|
|
||||||
### 5. Released
|
### 5. Released
|
||||||
|
|
||||||
When making a new major release of Task, all experiments marked as `status:
|
When making a new major release of Task, all experiments marked as
|
||||||
stable` will move to `status: released` and their behaviors will become the new
|
`status: stable` will move to `status: released` and their behaviors will become
|
||||||
default in Task. Experiments in an earlier stage (i.e. not stable) cannot be
|
the new default in Task. Experiments in an earlier stage (i.e. not stable)
|
||||||
released and so will continue to be experiments in the new version.
|
cannot be released and so will continue to be experiments in the new version.
|
||||||
|
|
||||||
### Abandoned / Superseded
|
### Abandoned / Superseded
|
||||||
|
|
||||||
If an experiment is unsuccessful at any point then it will be given the `status:
|
If an experiment is unsuccessful at any point then it will be given the
|
||||||
abandoned` or `status: superseded` labels depending on which is more suitable.
|
`status: abandoned` or `status: superseded` labels depending on which is more
|
||||||
These experiments will be removed from Task.
|
suitable. These experiments will be removed from Task.
|
@@ -1,13 +1,12 @@
|
|||||||
---
|
---
|
||||||
slug: /experiments/remote-taskfiles/
|
title: 'Remote Taskfiles (#1317)'
|
||||||
|
description: Experimentation for using Taskfiles stored in remote locations
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
import Tabs from '@theme/Tabs';
|
|
||||||
import TabItem from '@theme/TabItem';
|
|
||||||
|
|
||||||
# Remote Taskfiles (#1317)
|
# Remote Taskfiles (#1317)
|
||||||
|
|
||||||
:::caution
|
::: warning
|
||||||
|
|
||||||
All experimental features are subject to breaking changes and/or removal _at any
|
All experimental features are subject to breaking changes and/or removal _at any
|
||||||
time_. We strongly recommend that you do not use these features in a production
|
time_. We strongly recommend that you do not use these features in a production
|
||||||
@@ -15,16 +14,19 @@ environment. They are intended for testing and feedback only.
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
To enable this experiment, set the environment variable:
|
To enable this experiment, set the environment variable:
|
||||||
`TASK_X_REMOTE_TASKFILES=1`. Check out [our guide to enabling experiments
|
`TASK_X_REMOTE_TASKFILES=1`. Check out
|
||||||
][enabling-experiments] for more information.
|
[our guide to enabling experiments](./index.md#enabling-experiments) for more
|
||||||
|
information.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::danger
|
::: danger
|
||||||
|
|
||||||
Never run remote Taskfiles from sources that you do not trust.
|
Never run remote Taskfiles from sources that you do not trust.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
This experiment allows you to use Taskfiles which are stored in remote
|
This experiment allows you to use Taskfiles which are stored in remote
|
||||||
@@ -34,19 +36,35 @@ when including Taskfiles.
|
|||||||
Task uses "nodes" to reference remote Taskfiles. There are a few different types
|
Task uses "nodes" to reference remote Taskfiles. There are a few different types
|
||||||
of node which you can use:
|
of node which you can use:
|
||||||
|
|
||||||
<Tabs groupId="method" queryString>
|
::: code-group
|
||||||
<TabItem value="http" label="HTTP/HTTPS">
|
|
||||||
|
```text [HTTP/HTTPS]
|
||||||
|
https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
```text [Git over HTTP]
|
||||||
|
https://github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
||||||
|
```
|
||||||
|
|
||||||
|
```text [Git over SSH]
|
||||||
|
git@github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
||||||
|
```
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
## Node Types
|
||||||
|
|
||||||
|
### HTTP/HTTPS
|
||||||
|
|
||||||
`https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml`
|
`https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml`
|
||||||
|
|
||||||
This is the most basic type of remote node and works by downloading the file
|
This is the most basic type of remote node and works by downloading the file
|
||||||
from the specified URL. The file must be a valid Taskfile and can be of any
|
from the specified URL. The file must be a valid Taskfile and can be of any
|
||||||
name. If a file is not found at the specified URL, Task will append each of the
|
name. If a file is not found at the specified URL, Task will append each of the
|
||||||
[supported file names][supported-file-names] in turn until it finds a valid
|
supported file names in turn until it finds a valid file. If it still does not
|
||||||
file. If it still does not find a valid Taskfile, an error is returned.
|
find a valid Taskfile, an error is returned.
|
||||||
|
|
||||||
</TabItem>
|
### Git over HTTP
|
||||||
<TabItem value="git-http" label="Git over HTTP">
|
|
||||||
|
|
||||||
`https://github.com/go-task/task.git//website/static/Taskfile.yml?ref=main`
|
`https://github.com/go-task/task.git//website/static/Taskfile.yml?ref=main`
|
||||||
|
|
||||||
@@ -55,13 +73,12 @@ HTTP/HTTPS. The first part of the URL is the base URL of the Git repository.
|
|||||||
This is the same URL that you would use to clone the repo over HTTP.
|
This is the same URL that you would use to clone the repo over HTTP.
|
||||||
|
|
||||||
- You can optionally add the path to the Taskfile in the repository by appending
|
- You can optionally add the path to the Taskfile in the repository by appending
|
||||||
`//<path>` to the URL.
|
`//<path>` to the URL.
|
||||||
- You can also optionally specify a branch or tag to use by appending
|
- You can also optionally specify a branch or tag to use by appending
|
||||||
`?ref=<ref>` to the end of the URL. If you omit a reference, the default branch
|
`?ref=<ref>` to the end of the URL. If you omit a reference, the default
|
||||||
will be used.
|
branch will be used.
|
||||||
|
|
||||||
</TabItem>
|
### Git over SSH
|
||||||
<TabItem value="git-ssh" label="Git over SSH">
|
|
||||||
|
|
||||||
`git@github.com/go-task/task.git//website/static/Taskfile.yml?ref=main`
|
`git@github.com/go-task/task.git//website/static/Taskfile.yml?ref=main`
|
||||||
|
|
||||||
@@ -73,16 +90,13 @@ To use Git over SSH, you need to make sure that your SSH agent has your private
|
|||||||
SSH keys added so that they can be used during authentication.
|
SSH keys added so that they can be used during authentication.
|
||||||
|
|
||||||
- You can optionally add the path to the Taskfile in the repository by appending
|
- You can optionally add the path to the Taskfile in the repository by appending
|
||||||
`//<path>` to the URL.
|
`//<path>` to the URL.
|
||||||
- You can also optionally specify a branch or tag to use by appending
|
- You can also optionally specify a branch or tag to use by appending
|
||||||
`?ref=<ref>` to the end of the URL. If you omit a reference, the default branch
|
`?ref=<ref>` to the end of the URL. If you omit a reference, the default
|
||||||
will be used.
|
branch will be used.
|
||||||
|
|
||||||
</TabItem>
|
Task has an example remote Taskfile in our repository that you can use for
|
||||||
</Tabs>
|
testing and that we will use throughout this document:
|
||||||
|
|
||||||
Task has an [example remote Taskfile][example-remote-taskfile] in our repository
|
|
||||||
that you can use for testing and that we will use throughout this document:
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: '3'
|
version: '3'
|
||||||
@@ -99,34 +113,32 @@ tasks:
|
|||||||
|
|
||||||
## Specifying a remote entrypoint
|
## Specifying a remote entrypoint
|
||||||
|
|
||||||
By default, Task will look for one of the [supported file
|
By default, Task will look for one of the supported file names on your local
|
||||||
names][supported-file-names] on your local filesystem. If you want to use a
|
filesystem. If you want to use a remote file instead, you can pass its URI into
|
||||||
remote file instead, you can pass its URI into the `--taskfile`/`-t` flag just
|
the `--taskfile`/`-t` flag just like you would to specify a different local
|
||||||
like you would to specify a different local file. For example:
|
file. For example:
|
||||||
|
|
||||||
<Tabs groupId="method" queryString>
|
::: code-group
|
||||||
<TabItem value="http" label="HTTP/HTTPS">
|
|
||||||
```shell
|
```shell [HTTP/HTTPS]
|
||||||
$ task --taskfile https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml
|
$ task --taskfile https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml
|
||||||
task: [hello] echo "Hello Task!"
|
task: [hello] echo "Hello Task!"
|
||||||
Hello Task!
|
Hello Task!
|
||||||
```
|
```
|
||||||
</TabItem>
|
|
||||||
<TabItem value="git-http" label="Git over HTTP">
|
```shell [Git over HTTP]
|
||||||
```shell
|
|
||||||
$ task --taskfile https://github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
$ task --taskfile https://github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
||||||
task: [hello] echo "Hello Task!"
|
task: [hello] echo "Hello Task!"
|
||||||
Hello Task!
|
Hello Task!
|
||||||
```
|
```
|
||||||
</TabItem>
|
|
||||||
<TabItem value="git-ssh" label="Git over SSH">
|
```shell [Git over SSH]
|
||||||
```shell
|
|
||||||
$ task --taskfile git@github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
$ task --taskfile git@github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
||||||
task: [hello] echo "Hello Task!"
|
task: [hello] echo "Hello Task!"
|
||||||
Hello Task!
|
Hello Task!
|
||||||
```
|
```
|
||||||
</TabItem>
|
|
||||||
</Tabs>
|
:::
|
||||||
|
|
||||||
## Including remote Taskfiles
|
## Including remote Taskfiles
|
||||||
|
|
||||||
@@ -134,32 +146,30 @@ Including a remote file works exactly the same way that including a local file
|
|||||||
does. You just need to replace the local path with a remote URI. Any tasks in
|
does. You just need to replace the local path with a remote URI. Any tasks in
|
||||||
the remote Taskfile will be available to run from your main Taskfile.
|
the remote Taskfile will be available to run from your main Taskfile.
|
||||||
|
|
||||||
<Tabs groupId="method" queryString>
|
::: code-group
|
||||||
<TabItem value="http" label="HTTP/HTTPS">
|
|
||||||
```yaml
|
```yaml [HTTP/HTTPS]
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
includes:
|
includes:
|
||||||
my-remote-namespace: https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml
|
my-remote-namespace: https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml
|
||||||
```
|
```
|
||||||
</TabItem>
|
|
||||||
<TabItem value="git-http" label="Git over HTTP">
|
```yaml [Git over HTTP]
|
||||||
```yaml
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
includes:
|
includes:
|
||||||
my-remote-namespace: https://github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
my-remote-namespace: https://github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
||||||
```
|
```
|
||||||
</TabItem>
|
|
||||||
<TabItem value="git-ssh" label="Git over SSH">
|
```yaml [Git over SSH]
|
||||||
```yaml
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
includes:
|
includes:
|
||||||
my-remote-namespace: git@github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
my-remote-namespace: git@github.com/go-task/task.git//website/static/Taskfile.yml?ref=main
|
||||||
```
|
```
|
||||||
</TabItem>
|
|
||||||
</Tabs>
|
:::
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ task my-remote-namespace:hello
|
$ task my-remote-namespace:hello
|
||||||
@@ -247,9 +257,8 @@ Task currently supports both `http` and `https` URLs. However, the `http`
|
|||||||
requests will not execute by default unless you run the task with the
|
requests will not execute by default unless you run the task with the
|
||||||
`--insecure` flag. This is to protect you from accidentally running a remote
|
`--insecure` flag. This is to protect you from accidentally running a remote
|
||||||
Taskfile that is downloaded via an unencrypted connection. Sources that are not
|
Taskfile that is downloaded via an unencrypted connection. Sources that are not
|
||||||
protected by TLS are vulnerable to [man-in-the-middle
|
protected by TLS are vulnerable to man-in-the-middle attacks and should be
|
||||||
attacks][man-in-the-middle-attacks] and should be avoided unless you know what
|
avoided unless you know what you are doing.
|
||||||
you are doing.
|
|
||||||
|
|
||||||
## Caching & Running Offline
|
## Caching & Running Offline
|
||||||
|
|
||||||
@@ -273,18 +282,11 @@ the `--timeout` flag and specifying a duration. For example, `--timeout 5s` will
|
|||||||
set the timeout to 5 seconds.
|
set the timeout to 5 seconds.
|
||||||
|
|
||||||
By default, the cache is stored in the Task temp directory, represented by the
|
By default, the cache is stored in the Task temp directory, represented by the
|
||||||
`TASK_TEMP_DIR` [environment variable](../reference/environment.mdx) You can
|
`TASK_TEMP_DIR` environment variable. You can override the location of the cache
|
||||||
override the location of the cache by setting the `TASK_REMOTE_DIR` environment
|
by setting the `TASK_REMOTE_DIR` environment variable. This way, you can share
|
||||||
variable. This way, you can share the cache between different projects.
|
the cache between different projects.
|
||||||
|
|
||||||
You can force Task to ignore the cache and download the latest version
|
You can force Task to ignore the cache and download the latest version by using
|
||||||
by using the `--download` flag.
|
the `--download` flag.
|
||||||
|
|
||||||
You can use the `--clear-cache` flag to clear all cached remote files.
|
You can use the `--clear-cache` flag to clear all cached remote files.
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[enabling-experiments]: ./experiments.mdx#enabling-experiments
|
|
||||||
[man-in-the-middle-attacks]: https://en.wikipedia.org/wiki/Man-in-the-middle_attack
|
|
||||||
[supported-file-names]: https://taskfile.dev/usage/#supported-file-names
|
|
||||||
[example-remote-taskfile]: https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,14 +1,10 @@
|
|||||||
---
|
---
|
||||||
# This is a template for an experiments documentation
|
|
||||||
# Copy this page and fill in the details as necessary
|
|
||||||
title: '--- Template ---'
|
title: '--- Template ---'
|
||||||
sidebar_position: -1 # Always push to the top
|
|
||||||
draft: true # Hide in production
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# \{Name of Experiment\} (#\{Issue\})
|
# \{Name of Experiment\} (#\{Issue\})
|
||||||
|
|
||||||
:::caution
|
::: warning
|
||||||
|
|
||||||
All experimental features are subject to breaking changes and/or removal _at any
|
All experimental features are subject to breaking changes and/or removal _at any
|
||||||
time_. We strongly recommend that you do not use these features in a production
|
time_. We strongly recommend that you do not use these features in a production
|
||||||
@@ -16,7 +12,7 @@ environment. They are intended for testing and feedback only.
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::warning
|
::: warning
|
||||||
|
|
||||||
This experiment breaks the following functionality:
|
This experiment breaks the following functionality:
|
||||||
|
|
||||||
@@ -37,6 +33,4 @@ information.
|
|||||||
|
|
||||||
\{Short explanation of how users should migrate to the new behavior\}
|
\{Short explanation of how users should migrate to the new behavior\}
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
[enabling-experiments]: /docs/experiments/#enabling-experiments
|
||||||
[enabling-experiments]: ./experiments.mdx#enabling-experiments
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,6 +1,9 @@
|
|||||||
---
|
---
|
||||||
slug: /faq/
|
title: FAQ
|
||||||
sidebar_position: 15
|
description:
|
||||||
|
Frequently asked questions about Task, including ETAs, shell limitations, and
|
||||||
|
Windows compatibility
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# FAQ
|
# FAQ
|
||||||
@@ -24,7 +27,7 @@ be patient and avoid asking for ETAs.
|
|||||||
|
|
||||||
The best way to speed things up is to contribute to the project yourself. We
|
The best way to speed things up is to contribute to the project yourself. We
|
||||||
always appreciate new contributors. If you are interested in contributing, check
|
always appreciate new contributors. If you are interested in contributing, check
|
||||||
out the [contributing guide](./contributing.mdx).
|
out the [contributing guide](./contributing.md).
|
||||||
|
|
||||||
## Why won't my task update my shell environment?
|
## Why won't my task update my shell environment?
|
||||||
|
|
||||||
@@ -101,8 +104,9 @@ The default shell on Windows (`cmd` and `powershell`) do not have commands like
|
|||||||
If you want to make your Taskfile fully cross-platform, you'll need to work
|
If you want to make your Taskfile fully cross-platform, you'll need to work
|
||||||
around this limitation using one of the following methods:
|
around this limitation using one of the following methods:
|
||||||
|
|
||||||
- Use the `{{OS}}` function to run an OS-specific script.
|
- Use the <span v-pre>`{{OS}}`</span> function to run an OS-specific script.
|
||||||
- Use something like `{{if eq OS "windows"}}powershell {{end}}<my_cmd>` to
|
- Use something like
|
||||||
|
<span v-pre>`{{if eq OS "windows"}}powershell {{end}}<my_cmd>`</span> to
|
||||||
detect windows and run the command in Powershell directly.
|
detect windows and run the command in Powershell directly.
|
||||||
- Use a shell on Windows that supports these commands as builtins, such as [Git
|
- Use a shell on Windows that supports these commands as builtins, such as [Git
|
||||||
Bash][git-bash] or [WSL][wsl].
|
Bash][git-bash] or [WSL][wsl].
|
||||||
@@ -114,7 +118,5 @@ this work. Constructive comments and contributions are very welcome!
|
|||||||
- [mvdan/sh#93](https://github.com/mvdan/sh/issues/93)
|
- [mvdan/sh#93](https://github.com/mvdan/sh/issues/93)
|
||||||
- [mvdan/sh#97](https://github.com/mvdan/sh/issues/97)
|
- [mvdan/sh#97](https://github.com/mvdan/sh/issues/97)
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[git-bash]: https://gitforwindows.org/
|
[git-bash]: https://gitforwindows.org/
|
||||||
[wsl]: https://learn.microsoft.com/en-us/windows/wsl/install
|
[wsl]: https://learn.microsoft.com/en-us/windows/wsl/install
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,14 +1,14 @@
|
|||||||
---
|
---
|
||||||
slug: /getting-started/
|
title: Getting Started
|
||||||
sidebar_position: 3
|
description: Guide for getting started with Task
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Getting Started
|
# Getting Started
|
||||||
|
|
||||||
The following guide will help introduce you to the basics of Task. We'll cover
|
The following guide will help introduce you to the basics of Task. We'll cover
|
||||||
how to create a Taskfile, how to write a basic task and how to call it. If you
|
how to create a Taskfile, how to write a basic task and how to call it. If you
|
||||||
haven't installed Task yet, head over to our [installation
|
haven't installed Task yet, head over to our [installation guide](installation).
|
||||||
guide][installation].
|
|
||||||
|
|
||||||
## Creating your first Taskfile
|
## Creating your first Taskfile
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ task --init Custom.yml
|
|||||||
|
|
||||||
This will create a Taskfile that looks something like this:
|
This will create a Taskfile that looks something like this:
|
||||||
|
|
||||||
```yaml
|
```yaml [Taskfile.yml]
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
@@ -48,11 +48,11 @@ tasks:
|
|||||||
silent: true
|
silent: true
|
||||||
```
|
```
|
||||||
|
|
||||||
As you can see, all Taskfiles are written in [YAML format][yaml]. The `version`
|
As you can see, all Taskfiles are written in [YAML format](https://yaml.org/).
|
||||||
attribute specifies the minimum version of Task that can be used to run this
|
The `version` attribute specifies the minimum version of Task that can be used
|
||||||
file. The `vars` attribute is used to define variables that can be used in
|
to run this file. The `vars` attribute is used to define variables that can be
|
||||||
tasks. In this case, we are creating a string variable called `GREETING` with a
|
used in tasks. In this case, we are creating a string variable called `GREETING`
|
||||||
value of `Hello, World!`.
|
with a value of `Hello, World!`.
|
||||||
|
|
||||||
Finally, the `tasks` attribute is used to define the tasks that can be run. In
|
Finally, the `tasks` attribute is used to define the tasks that can be run. In
|
||||||
this case, we have a task called `default` that echoes the value of the
|
this case, we have a task called `default` that echoes the value of the
|
||||||
@@ -70,10 +70,10 @@ task default
|
|||||||
```
|
```
|
||||||
|
|
||||||
Note that we don't have to specify the name of the Taskfile. Task will
|
Note that we don't have to specify the name of the Taskfile. Task will
|
||||||
automatically look for a file called `Taskfile.yml` (or any of Task's [supported
|
automatically look for a file called `Taskfile.yml` (or any of Task's
|
||||||
file names][supported-file-names]) in the current directory. Additionally, tasks
|
[supported file names](/docs/guide#supported-file-names)) in the current directory.
|
||||||
with the name `default` are special. They can also be run without specifying the
|
Additionally, tasks with the name `default` are special. They can also be run
|
||||||
task name.
|
without specifying the task name.
|
||||||
|
|
||||||
If you created a Taskfile in a different directory, you can run it by passing
|
If you created a Taskfile in a different directory, you can run it by passing
|
||||||
the absolute or relative path to the directory as an argument using the `--dir`
|
the absolute or relative path to the directory as an argument using the `--dir`
|
||||||
@@ -96,10 +96,10 @@ Let's create a task to build a program in Go. Start by adding a new task called
|
|||||||
`build` below the existing `default` task. We can then add a `cmds` attribute
|
`build` below the existing `default` task. We can then add a `cmds` attribute
|
||||||
with a single command to build the program.
|
with a single command to build the program.
|
||||||
|
|
||||||
Task uses [mvdan/sh][mvdan/sh], a native Go sh interpreter. So you can write
|
Task uses [mvdan/sh](https://github.com/mvdan/sh), a native Go sh interpreter.
|
||||||
sh/bash-like commands - even in environments where `sh` or `bash` are usually
|
So you can write sh/bash-like commands - even in environments where `sh` or
|
||||||
not available (like Windows). Just remember any executables called must be
|
`bash` are usually not available (like Windows). Just remember any executables
|
||||||
available as a built-in or in the system's `PATH`.
|
called must be available as a built-in or in the system's `PATH`.
|
||||||
|
|
||||||
When you're done, it should look something like this:
|
When you're done, it should look something like this:
|
||||||
|
|
||||||
@@ -128,16 +128,6 @@ task build
|
|||||||
|
|
||||||
That's about it for the basics, but there's _so much_ more that you can do with
|
That's about it for the basics, but there's _so much_ more that you can do with
|
||||||
Task. Check out the rest of the documentation to learn more about all the
|
Task. Check out the rest of the documentation to learn more about all the
|
||||||
features Task has to offer! We recommend taking a look at the [usage
|
features Task has to offer! We recommend taking a look at the
|
||||||
guide][usage] next. Alternatively, you can check out our reference docs for the
|
[usage guide](/docs/guide) next. Alternatively, you can check out our reference docs
|
||||||
[Taskfile schema][schema] and [CLI][cli].
|
for the [Taskfile schema](reference/schema) and [CLI](reference/cli).
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[yaml]: https://yaml.org/
|
|
||||||
[installation]: /installation/
|
|
||||||
[supported-file-names]: /usage/#supported-file-names
|
|
||||||
[mvdan/sh]: https://github.com/mvdan/sh
|
|
||||||
[usage]: /usage/
|
|
||||||
[schema]: /reference/schema/
|
|
||||||
[cli]: /reference/cli/
|
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,12 +1,8 @@
|
|||||||
---
|
---
|
||||||
slug: /usage/
|
outline: deep
|
||||||
sidebar_position: 4
|
|
||||||
---
|
---
|
||||||
|
|
||||||
import Tabs from '@theme/Tabs';
|
# Guide
|
||||||
import TabItem from '@theme/TabItem';
|
|
||||||
|
|
||||||
# Usage
|
|
||||||
|
|
||||||
## Running Taskfiles
|
## Running Taskfiles
|
||||||
|
|
||||||
@@ -39,11 +35,12 @@ the file tree until it finds one (similar to how `git` works). When running Task
|
|||||||
from a subdirectory like this, it will behave as if you ran it from the
|
from a subdirectory like this, it will behave as if you ran it from the
|
||||||
directory containing the Taskfile.
|
directory containing the Taskfile.
|
||||||
|
|
||||||
You can use this functionality along with the special `{{.USER_WORKING_DIR}}`
|
You can use this functionality along with the special
|
||||||
variable to create some very useful reusable tasks. For example, if you have a
|
<span v-pre>`{{.USER_WORKING_DIR}}`</span> variable to create some very useful
|
||||||
monorepo with directories for each microservice, you can `cd` into a
|
reusable tasks. For example, if you have a monorepo with directories for each
|
||||||
microservice directory and run a task command to bring it up without having to
|
microservice, you can `cd` into a microservice directory and run a task command
|
||||||
create multiple tasks or Taskfiles with identical content. For example:
|
to bring it up without having to create multiple tasks or Taskfiles with
|
||||||
|
identical content. For example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: '3'
|
version: '3'
|
||||||
@@ -69,14 +66,14 @@ Taskfile that matches `$HOME/{T,t}askfile.{yml,yaml}` .
|
|||||||
|
|
||||||
This is useful to have automation that you can run from anywhere in your system!
|
This is useful to have automation that you can run from anywhere in your system!
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
When running your global Taskfile with `-g`, tasks will run on `$HOME` by
|
When running your global Taskfile with `-g`, tasks will run on `$HOME` by
|
||||||
default, and not on your working directory!
|
default, and not on your working directory!
|
||||||
|
|
||||||
As mentioned in the previous section, the `{{.USER_WORKING_DIR}}` special
|
As mentioned in the previous section, the
|
||||||
variable can be very handy here to run stuff on the directory you're calling
|
<span v-pre>`{{.USER_WORKING_DIR}}`</span> special variable can be very handy
|
||||||
`task -g` from.
|
here to run stuff on the directory you're calling `task -g` from.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: '3'
|
version: '3'
|
||||||
@@ -139,7 +136,7 @@ tasks:
|
|||||||
- echo $GREETING
|
- echo $GREETING
|
||||||
```
|
```
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
`env` supports expansion and retrieving output from a shell command just like
|
`env` supports expansion and retrieving output from a shell command just like
|
||||||
variables, as you can see in the [Variables](#variables) section.
|
variables, as you can see in the [Variables](#variables) section.
|
||||||
@@ -151,15 +148,19 @@ variables, as you can see in the [Variables](#variables) section.
|
|||||||
You can also ask Task to include `.env` like files by using the `dotenv:`
|
You can also ask Task to include `.env` like files by using the `dotenv:`
|
||||||
setting:
|
setting:
|
||||||
|
|
||||||
```shell title=".env"
|
::: code-group
|
||||||
|
|
||||||
|
```shell [.env]
|
||||||
KEYNAME=VALUE
|
KEYNAME=VALUE
|
||||||
```
|
```
|
||||||
|
|
||||||
```shell title="testing/.env"
|
```shell [testing/.env]
|
||||||
ENDPOINT=testing.com
|
ENDPOINT=testing.com
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml title="Taskfile.yml"
|
:::
|
||||||
|
|
||||||
|
```yaml
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -206,7 +207,7 @@ tasks:
|
|||||||
- echo "Using $KEYNAME and endpoint $ENDPOINT"
|
- echo "Using $KEYNAME and endpoint $ENDPOINT"
|
||||||
```
|
```
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
Please note that you are not currently able to use the `dotenv` key inside
|
Please note that you are not currently able to use the `dotenv` key inside
|
||||||
included Taskfiles.
|
included Taskfiles.
|
||||||
@@ -260,7 +261,7 @@ includes:
|
|||||||
dir: ./docs
|
dir: ./docs
|
||||||
```
|
```
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
The included Taskfiles must be using the same schema version as the main
|
The included Taskfiles must be using the same schema version as the main
|
||||||
Taskfile uses.
|
Taskfile uses.
|
||||||
@@ -305,14 +306,13 @@ includes:
|
|||||||
|
|
||||||
### Flatten includes
|
### Flatten includes
|
||||||
|
|
||||||
You can flatten the included Taskfile tasks into the main Taskfile by using the `flatten` option.
|
You can flatten the included Taskfile tasks into the main Taskfile by using the
|
||||||
It means that the included Taskfile tasks will be available without the namespace.
|
`flatten` option. It means that the included Taskfile tasks will be available
|
||||||
|
without the namespace.
|
||||||
|
|
||||||
|
::: code-group
|
||||||
|
|
||||||
<Tabs defaultValue="1">
|
```yaml [Taskfile.yml]
|
||||||
<TabItem value="1" label="Taskfile.yml">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
includes:
|
includes:
|
||||||
@@ -327,10 +327,7 @@ tasks:
|
|||||||
- task: foo
|
- task: foo
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
```yaml [Included.yml]
|
||||||
<TabItem value="2" label="Included.yml">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -339,8 +336,7 @@ tasks:
|
|||||||
- echo "Foo"
|
- echo "Foo"
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
:::
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
If you run `task -a` it will print :
|
If you run `task -a` it will print :
|
||||||
|
|
||||||
@@ -352,7 +348,8 @@ task: Available tasks for this project:
|
|||||||
|
|
||||||
You can run `task foo` directly without the namespace.
|
You can run `task foo` directly without the namespace.
|
||||||
|
|
||||||
You can also reference the task in other tasks without the namespace. So if you run `task greet` it will run `greet` and `foo` tasks and the output will be :
|
You can also reference the task in other tasks without the namespace. So if you
|
||||||
|
run `task greet` it will run `greet` and `foo` tasks and the output will be :
|
||||||
|
|
||||||
```text
|
```text
|
||||||
Greet
|
Greet
|
||||||
@@ -361,10 +358,9 @@ Foo
|
|||||||
|
|
||||||
If multiple tasks have the same name, an error will be thrown:
|
If multiple tasks have the same name, an error will be thrown:
|
||||||
|
|
||||||
<Tabs defaultValue="1">
|
::: code-group
|
||||||
<TabItem value="1" label="Taskfile.yml">
|
|
||||||
|
|
||||||
```yaml
|
```yaml [Taskfile.yml]
|
||||||
version: '3'
|
version: '3'
|
||||||
includes:
|
includes:
|
||||||
lib:
|
lib:
|
||||||
@@ -378,10 +374,7 @@ tasks:
|
|||||||
- task: foo
|
- task: foo
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
```yaml [Included.yml]
|
||||||
<TabItem value="2" label="Included.yml">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -390,27 +383,28 @@ tasks:
|
|||||||
- echo "Foo"
|
- echo "Foo"
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
:::
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
If you run `task -a` it will print:
|
If you run `task -a` it will print:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
task: Found multiple tasks (greet) included by "lib"
|
task: Found multiple tasks (greet) included by "lib"
|
||||||
```
|
```
|
||||||
|
|
||||||
If the included Taskfile has a task with the same name as a task in the main Taskfile,
|
If the included Taskfile has a task with the same name as a task in the main
|
||||||
you may want to exclude it from the flattened tasks.
|
Taskfile, you may want to exclude it from the flattened tasks.
|
||||||
|
|
||||||
You can do this by using the [`excludes` option](#exclude-tasks-from-being-included).
|
You can do this by using the
|
||||||
|
[`excludes` option](#exclude-tasks-from-being-included).
|
||||||
|
|
||||||
### Exclude tasks from being included
|
### Exclude tasks from being included
|
||||||
|
|
||||||
You can exclude tasks from being included by using the `excludes` option. This option takes the list of tasks to be excluded from this include.
|
You can exclude tasks from being included by using the `excludes` option. This
|
||||||
|
option takes the list of tasks to be excluded from this include.
|
||||||
|
|
||||||
<Tabs defaultValue="1">
|
::: code-group
|
||||||
<TabItem value="1" label="Taskfile.yml">
|
|
||||||
|
|
||||||
```yaml
|
```yaml [Taskfile.yml]
|
||||||
version: '3'
|
version: '3'
|
||||||
includes:
|
includes:
|
||||||
included:
|
included:
|
||||||
@@ -418,10 +412,7 @@ version: '3'
|
|||||||
excludes: [foo]
|
excludes: [foo]
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
```yaml [Included.yml]
|
||||||
<TabItem value="2" label="Included.yml">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -429,9 +420,10 @@ tasks:
|
|||||||
bar: echo "Bar"
|
bar: echo "Bar"
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem></Tabs>
|
:::
|
||||||
|
|
||||||
`task included:foo` will throw an error because the `foo` task is excluded but `task included:bar` will work and display `Bar`.
|
`task included:foo` will throw an error because the `foo` task is excluded but
|
||||||
|
`task included:bar` will work and display `Bar`.
|
||||||
|
|
||||||
It's compatible with the `flatten` option.
|
It's compatible with the `flatten` option.
|
||||||
|
|
||||||
@@ -470,13 +462,13 @@ includes:
|
|||||||
aliases: [gen]
|
aliases: [gen]
|
||||||
```
|
```
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
Vars declared in the included Taskfile have preference over the variables in the
|
Vars declared in the included Taskfile have preference over the variables in the
|
||||||
including Taskfile! If you want a variable in an included Taskfile to be
|
including Taskfile! If you want a variable in an included Taskfile to be
|
||||||
overridable, use the
|
overridable, use the
|
||||||
[default function](https://go-task.github.io/slim-sprig/defaults.html):
|
[default function](https://go-task.github.io/slim-sprig/defaults.html):
|
||||||
`MY_VAR: '{{.MY_VAR | default "my-default-value"}}'`.
|
<span v-pre>`MY_VAR: '{{.MY_VAR | default "my-default-value"}}'`</span>.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -569,7 +561,7 @@ tasks:
|
|||||||
If there is more than one dependency, they always run in parallel for better
|
If there is more than one dependency, they always run in parallel for better
|
||||||
performance.
|
performance.
|
||||||
|
|
||||||
:::tip
|
::: tip
|
||||||
|
|
||||||
You can also make the tasks given by the command line run in parallel by using
|
You can also make the tasks given by the command line run in parallel by using
|
||||||
the `--parallel` flag (alias `-p`). Example: `task --parallel js css`.
|
the `--parallel` flag (alias `-p`). Example: `task --parallel js css`.
|
||||||
@@ -718,7 +710,7 @@ tasks:
|
|||||||
|
|
||||||
The above syntax is also supported in `deps`.
|
The above syntax is also supported in `deps`.
|
||||||
|
|
||||||
:::tip
|
::: tip
|
||||||
|
|
||||||
NOTE: If you want to call a task declared in the root Taskfile from within an
|
NOTE: If you want to call a task declared in the root Taskfile from within an
|
||||||
[included Taskfile](#including-other-taskfiles), add a leading `:` like this:
|
[included Taskfile](#including-other-taskfiles), add a leading `:` like this:
|
||||||
@@ -785,7 +777,6 @@ instead of its checksum (content), just set the `method` property to
|
|||||||
|
|
||||||
At the task level for a specific task:
|
At the task level for a specific task:
|
||||||
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
@@ -805,7 +796,7 @@ At the root level of the Taskfile to apply it globally to all tasks:
|
|||||||
```yaml
|
```yaml
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
method: timestamp # Will be the default for all tasks
|
method: timestamp # Will be the default for all tasks
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
build:
|
build:
|
||||||
@@ -817,13 +808,12 @@ tasks:
|
|||||||
- app{{exeExt}}
|
- app{{exeExt}}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
In situations where you need more flexibility the `status` keyword can be used.
|
In situations where you need more flexibility the `status` keyword can be used.
|
||||||
You can even combine the two. See the documentation for
|
You can even combine the two. See the documentation for
|
||||||
[status](#using-programmatic-checks-to-indicate-a-task-is-up-to-date) for an
|
[status](#using-programmatic-checks-to-indicate-a-task-is-up-to-date) for an
|
||||||
example.
|
example.
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
By default, task stores checksums on a local `.task` directory in the project's
|
By default, task stores checksums on a local `.task` directory in the project's
|
||||||
directory. Most of the time, you'll want to have this directory on `.gitignore`
|
directory. Most of the time, you'll want to have this directory on `.gitignore`
|
||||||
@@ -843,7 +833,7 @@ export TASK_TEMP_DIR='~/.task'
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
Each task has only one checksum stored for its `sources`. If you want to
|
Each task has only one checksum stored for its `sources`. If you want to
|
||||||
distinguish a task by any of its input variables, you can add those variables as
|
distinguish a task by any of its input variables, you can add those variables as
|
||||||
@@ -856,13 +846,13 @@ change even if the source has not.
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::tip
|
::: tip
|
||||||
|
|
||||||
The method `none` skips any validation and always runs the task.
|
The method `none` skips any validation and always runs the task.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
For the `checksum` (default) or `timestamp` method to work, it is only necessary
|
For the `checksum` (default) or `timestamp` method to work, it is only necessary
|
||||||
to inform the source files. When the `timestamp` method is used, the last time
|
to inform the source files. When the `timestamp` method is used, the last time
|
||||||
@@ -896,12 +886,14 @@ tasks that generate remote artifacts (Docker images, deploys, CD releases) the
|
|||||||
checksum source and timestamps require either access to the artifact or for an
|
checksum source and timestamps require either access to the artifact or for an
|
||||||
out-of-band refresh of the `.checksum` fingerprint file.
|
out-of-band refresh of the `.checksum` fingerprint file.
|
||||||
|
|
||||||
Two special variables `{{.CHECKSUM}}` and `{{.TIMESTAMP}}` are available for
|
Two special variables <span v-pre>`{{.CHECKSUM}}`</span> and
|
||||||
interpolation within `cmds` and `status` commands, depending on the method assigned to
|
<span v-pre>`{{.TIMESTAMP}}`</span> are available for interpolation within
|
||||||
fingerprint the sources. Only `source` globs are fingerprinted.
|
`cmds` and `status` commands, depending on the method assigned to fingerprint
|
||||||
|
the sources. Only `source` globs are fingerprinted.
|
||||||
|
|
||||||
Note that the `{{.TIMESTAMP}}` variable is a "live" Go `time.Time` struct, and
|
Note that the <span v-pre>`{{.TIMESTAMP}}`</span> variable is a "live" Go
|
||||||
can be formatted using any of the methods that `time.Time` responds to.
|
`time.Time` struct, and can be formatted using any of the methods that
|
||||||
|
`time.Time` responds to.
|
||||||
|
|
||||||
See [the Go Time documentation](https://golang.org/pkg/time/) for more
|
See [the Go Time documentation](https://golang.org/pkg/time/) for more
|
||||||
information.
|
information.
|
||||||
@@ -909,8 +901,8 @@ information.
|
|||||||
You can use `--force` or `-f` if you want to force a task to run even when
|
You can use `--force` or `-f` if you want to force a task to run even when
|
||||||
up-to-date.
|
up-to-date.
|
||||||
|
|
||||||
Also, `task --status [tasks]...` will exit with a non-zero [exit
|
Also, `task --status [tasks]...` will exit with a non-zero
|
||||||
code](/reference/cli#exit-codes) if any of the tasks are not up-to-date.
|
[exit code](/docs/reference/cli#exit-codes) if any of the tasks are not up-to-date.
|
||||||
|
|
||||||
`status` can be combined with the
|
`status` can be combined with the
|
||||||
[fingerprinting](#by-fingerprinting-locally-generated-files-and-their-sources)
|
[fingerprinting](#by-fingerprinting-locally-generated-files-and-their-sources)
|
||||||
@@ -1050,7 +1042,7 @@ requires:
|
|||||||
vars: [] # Array of strings
|
vars: [] # Array of strings
|
||||||
```
|
```
|
||||||
|
|
||||||
:::note
|
::: info
|
||||||
|
|
||||||
Variables set to empty zero length strings, will pass the `requires` check.
|
Variables set to empty zero length strings, will pass the `requires` check.
|
||||||
|
|
||||||
@@ -1073,11 +1065,16 @@ tasks:
|
|||||||
|
|
||||||
### Ensuring required variables have allowed values
|
### Ensuring required variables have allowed values
|
||||||
|
|
||||||
If you want to ensure that a variable is set to one of a predefined set of valid values before executing a task, you can use requires.
|
If you want to ensure that a variable is set to one of a predefined set of valid
|
||||||
This is particularly useful when there are strict requirements for what values a variable can take, and you want to provide clear feedback to the user when an invalid value is detected.
|
values before executing a task, you can use requires. This is particularly
|
||||||
|
useful when there are strict requirements for what values a variable can take,
|
||||||
|
and you want to provide clear feedback to the user when an invalid value is
|
||||||
|
detected.
|
||||||
|
|
||||||
To use `requires`, you specify an array of allowed values in the vars sub-section under requires. Task will check if the variable is set to one of the allowed values.
|
To use `requires`, you specify an array of allowed values in the vars
|
||||||
If the variable does not match any of these values, the task will raise an error and stop execution.
|
sub-section under requires. Task will check if the variable is set to one of the
|
||||||
|
allowed values. If the variable does not match any of these values, the task
|
||||||
|
will raise an error and stop execution.
|
||||||
|
|
||||||
This check applies both to user-defined variables and environment variables.
|
This check applies both to user-defined variables and environment variables.
|
||||||
|
|
||||||
@@ -1099,7 +1096,7 @@ tasks:
|
|||||||
|
|
||||||
If `ENV` is not one of 'dev', 'beta' or 'prod' an error will be raised.
|
If `ENV` is not one of 'dev', 'beta' or 'prod' an error will be raised.
|
||||||
|
|
||||||
:::note
|
::: info
|
||||||
|
|
||||||
This is supported only for string variables.
|
This is supported only for string variables.
|
||||||
|
|
||||||
@@ -1117,7 +1114,7 @@ variable types are supported:
|
|||||||
- `array`
|
- `array`
|
||||||
- `map`
|
- `map`
|
||||||
|
|
||||||
:::note
|
::: info
|
||||||
|
|
||||||
Defining a map requires that you use a special `map` subkey (see example below).
|
Defining a map requires that you use a special `map` subkey (see example below).
|
||||||
|
|
||||||
@@ -1135,16 +1132,16 @@ tasks:
|
|||||||
FLOAT: 3.14
|
FLOAT: 3.14
|
||||||
ARRAY: [1, 2, 3]
|
ARRAY: [1, 2, 3]
|
||||||
MAP:
|
MAP:
|
||||||
map: {A: 1, B: 2, C: 3}
|
map: { A: 1, B: 2, C: 3 }
|
||||||
cmds:
|
cmds:
|
||||||
- 'echo {{.STRING}}' # Hello, World!
|
- 'echo {{.STRING}}' # Hello, World!
|
||||||
- 'echo {{.BOOL}}' # true
|
- 'echo {{.BOOL}}' # true
|
||||||
- 'echo {{.INT}}' # 42
|
- 'echo {{.INT}}' # 42
|
||||||
- 'echo {{.FLOAT}}' # 3.14
|
- 'echo {{.FLOAT}}' # 3.14
|
||||||
- 'echo {{.ARRAY}}' # [1 2 3]
|
- 'echo {{.ARRAY}}' # [1 2 3]
|
||||||
- 'echo {{index .ARRAY 0}}' # 1
|
- 'echo {{index .ARRAY 0}}' # 1
|
||||||
- 'echo {{.MAP}}' # map[A:1 B:2 C:3]
|
- 'echo {{.MAP}}' # map[A:1 B:2 C:3]
|
||||||
- 'echo {{.MAP.A}}' # 1
|
- 'echo {{.MAP.A}}' # 1
|
||||||
```
|
```
|
||||||
|
|
||||||
Variables can be set in many places in a Taskfile. When executing
|
Variables can be set in many places in a Taskfile. When executing
|
||||||
@@ -1167,7 +1164,7 @@ Example of sending parameters with environment variables:
|
|||||||
$ TASK_VARIABLE=a-value task do-something
|
$ TASK_VARIABLE=a-value task do-something
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tip
|
::: tip
|
||||||
|
|
||||||
A special variable `.TASK` is always available containing the task name.
|
A special variable `.TASK` is always available containing the task name.
|
||||||
|
|
||||||
@@ -1213,8 +1210,9 @@ Example of a `default` value to be overridden from CLI:
|
|||||||
```yaml
|
```yaml
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
|
tasks:
|
||||||
greet_user:
|
greet_user:
|
||||||
desc: "Greet the user with a name."
|
desc: 'Greet the user with a name.'
|
||||||
vars:
|
vars:
|
||||||
USER_NAME: '{{.USER_NAME| default "DefaultUser"}}'
|
USER_NAME: '{{.USER_NAME| default "DefaultUser"}}'
|
||||||
cmds:
|
cmds:
|
||||||
@@ -1252,15 +1250,14 @@ This works for all types of variables.
|
|||||||
|
|
||||||
### Referencing other variables
|
### Referencing other variables
|
||||||
|
|
||||||
Templating is great for referencing string values if you want to pass
|
Templating is great for referencing string values if you want to pass a value
|
||||||
a value from one task to another. However, the templating engine is only able to
|
from one task to another. However, the templating engine is only able to output
|
||||||
output strings. If you want to pass something other than a string to another
|
strings. If you want to pass something other than a string to another task then
|
||||||
task then you will need to use a reference (`ref`) instead.
|
you will need to use a reference (`ref`) instead.
|
||||||
|
|
||||||
<Tabs defaultValue="2">
|
::: code-group
|
||||||
<TabItem value="1" label="Templating Engine">
|
|
||||||
|
|
||||||
```yaml
|
```yaml [Templating Engine]
|
||||||
version: 3
|
version: 3
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -1276,10 +1273,7 @@ tasks:
|
|||||||
- 'echo {{index .FOO 0}}' # <-- FOO is a string so the task outputs '91' which is the ASCII code for '[' instead of the expected 'A'
|
- 'echo {{index .FOO 0}}' # <-- FOO is a string so the task outputs '91' which is the ASCII code for '[' instead of the expected 'A'
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
```yaml [Reference]
|
||||||
<TabItem value="2" label="Reference">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: 3
|
version: 3
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -1296,11 +1290,10 @@ tasks:
|
|||||||
- 'echo {{index .FOO 0}}' # <-- FOO is still a map so the task outputs 'A' as expected
|
- 'echo {{index .FOO 0}}' # <-- FOO is still a map so the task outputs 'A' as expected
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
:::
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
This also works the same way when calling `deps` and when defining
|
This also works the same way when calling `deps` and when defining a variable
|
||||||
a variable and can be used in any combination:
|
and can be used in any combination:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: 3
|
version: 3
|
||||||
@@ -1357,7 +1350,7 @@ tasks:
|
|||||||
vars:
|
vars:
|
||||||
JSON: '{"a": 1, "b": 2, "c": 3}'
|
JSON: '{"a": 1, "b": 2, "c": 3}'
|
||||||
FOO:
|
FOO:
|
||||||
ref: "fromJson .JSON"
|
ref: 'fromJson .JSON'
|
||||||
cmds:
|
cmds:
|
||||||
- echo {{.FOO}}
|
- echo {{.FOO}}
|
||||||
```
|
```
|
||||||
@@ -1402,9 +1395,11 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- for:
|
- for:
|
||||||
matrix:
|
matrix:
|
||||||
OS: ["windows", "linux", "darwin"]
|
OS: ['windows', 'linux', 'darwin']
|
||||||
ARCH: ["amd64", "arm64"]
|
ARCH: ['amd64', 'arm64']
|
||||||
cmd: echo "{{.ITEM.OS}}/{{.ITEM.ARCH}}"
|
cmd:
|
||||||
|
echo "<span v-pre>{{.ITEM.OS}}</span>/<span
|
||||||
|
v-pre>{{.ITEM.ARCH}}</span>"
|
||||||
```
|
```
|
||||||
|
|
||||||
This will output:
|
This will output:
|
||||||
@@ -1421,11 +1416,11 @@ darwin/arm64
|
|||||||
You can also use references to other variables as long as they are also lists:
|
You can also use references to other variables as long as they are also lists:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
version: '3'
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
OS_VAR: ["windows", "linux", "darwin"]
|
OS_VAR: ['windows', 'linux', 'darwin']
|
||||||
ARCH_VAR: ["amd64", "arm64"]
|
ARCH_VAR: ['amd64', 'arm64']
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
default:
|
default:
|
||||||
@@ -1436,7 +1431,9 @@ tasks:
|
|||||||
ref: .OS_VAR
|
ref: .OS_VAR
|
||||||
ARCH:
|
ARCH:
|
||||||
ref: .ARCH_VAR
|
ref: .ARCH_VAR
|
||||||
cmd: echo "{{.ITEM.OS}}/{{.ITEM.ARCH}}"
|
cmd:
|
||||||
|
echo "<span v-pre>{{.ITEM.OS}}</span>/<span
|
||||||
|
v-pre>{{.ITEM.ARCH}}</span>"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Looping over your task's sources or generated files
|
### Looping over your task's sources or generated files
|
||||||
@@ -1444,10 +1441,9 @@ tasks:
|
|||||||
You are also able to loop over the sources of your task or the files it
|
You are also able to loop over the sources of your task or the files it
|
||||||
generates:
|
generates:
|
||||||
|
|
||||||
<Tabs defaultValue="1" groupId="sources-generates">
|
::: code-group
|
||||||
<TabItem value="1" label="Sources">
|
|
||||||
|
|
||||||
```yaml
|
```yaml [Sources]
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -1460,10 +1456,7 @@ tasks:
|
|||||||
cmd: cat {{ .ITEM }}
|
cmd: cat {{ .ITEM }}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
```yaml [Generates]
|
||||||
<TabItem value="2" label="Generates">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -1476,8 +1469,7 @@ tasks:
|
|||||||
cmd: cat {{ .ITEM }}
|
cmd: cat {{ .ITEM }}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
:::
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
This will also work if you use globbing syntax in `sources` or `generates`. For
|
This will also work if you use globbing syntax in `sources` or `generates`. For
|
||||||
example, if you specify a source for `*.txt`, the loop will iterate over all
|
example, if you specify a source for `*.txt`, the loop will iterate over all
|
||||||
@@ -1485,50 +1477,45 @@ files that match that glob.
|
|||||||
|
|
||||||
Paths will always be returned as paths relative to the task directory. If you
|
Paths will always be returned as paths relative to the task directory. If you
|
||||||
need to convert this to an absolute path, you can use the built-in `joinPath`
|
need to convert this to an absolute path, you can use the built-in `joinPath`
|
||||||
function. There are some [special
|
function. There are some
|
||||||
variables](/reference/templating/#special-variables) that you may find useful
|
[special variables](/docs/reference/templating#special-variables) that you may find
|
||||||
for this.
|
useful for this.
|
||||||
|
|
||||||
<Tabs defaultValue="1" groupId="sources-generates">
|
::: code-group
|
||||||
<TabItem value="1" label="Sources">
|
|
||||||
|
|
||||||
```yaml
|
```yaml [Sources]
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
default:
|
default:
|
||||||
vars:
|
vars:
|
||||||
MY_DIR: /path/to/dir
|
MY_DIR: /path/to/dir
|
||||||
dir: '{{.MY_DIR}}'
|
dir: '<span v-pre>{{.MY_DIR}}</span>'
|
||||||
sources:
|
sources:
|
||||||
- foo.txt
|
- foo.txt
|
||||||
- bar.txt
|
- bar.txt
|
||||||
cmds:
|
cmds:
|
||||||
- for: sources
|
- for: sources
|
||||||
cmd: cat {{joinPath .MY_DIR .ITEM}}
|
cmd: cat <span v-pre>{{joinPath .MY_DIR .ITEM}}</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
```yaml [Generates]
|
||||||
<TabItem value="2" label="Generates">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
default:
|
default:
|
||||||
vars:
|
vars:
|
||||||
MY_DIR: /path/to/dir
|
MY_DIR: /path/to/dir
|
||||||
dir: '{{.MY_DIR}}'
|
dir: '<span v-pre>{{.MY_DIR}}</span>'
|
||||||
generates:
|
generates:
|
||||||
- foo.txt
|
- foo.txt
|
||||||
- bar.txt
|
- bar.txt
|
||||||
cmds:
|
cmds:
|
||||||
- for: generates
|
- for: generates
|
||||||
cmd: cat {{joinPath .MY_DIR .ITEM}}
|
cmd: cat <span v-pre>{{joinPath .MY_DIR .ITEM}}</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
:::
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
### Looping over variables
|
### Looping over variables
|
||||||
|
|
||||||
@@ -1545,7 +1532,7 @@ tasks:
|
|||||||
MY_VAR: foo.txt bar.txt
|
MY_VAR: foo.txt bar.txt
|
||||||
cmds:
|
cmds:
|
||||||
- for: { var: MY_VAR }
|
- for: { var: MY_VAR }
|
||||||
cmd: cat {{.ITEM}}
|
cmd: cat <span v-pre>{{.ITEM}}</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
If you need to split a string on a different character, you can do this by
|
If you need to split a string on a different character, you can do this by
|
||||||
@@ -1560,7 +1547,7 @@ tasks:
|
|||||||
MY_VAR: foo.txt,bar.txt
|
MY_VAR: foo.txt,bar.txt
|
||||||
cmds:
|
cmds:
|
||||||
- for: { var: MY_VAR, split: ',' }
|
- for: { var: MY_VAR, split: ',' }
|
||||||
cmd: cat {{.ITEM}}
|
cmd: cat <span v-pre>{{.ITEM}}</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also loop over arrays and maps directly:
|
You can also loop over arrays and maps directly:
|
||||||
@@ -1575,12 +1562,12 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- for:
|
- for:
|
||||||
var: LIST
|
var: LIST
|
||||||
cmd: echo {{.ITEM}}
|
cmd: echo <span v-pre>{{.ITEM}}</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
When looping over a map we also make an additional `{{.KEY}}` variable available
|
When looping over a map we also make an additional <span v-pre>`{{.KEY}}`</span>
|
||||||
that holds the string value of the map key. Remember that maps are unordered, so
|
variable available that holds the string value of the map key. Remember that
|
||||||
the order in which the items are looped over is random.
|
maps are unordered, so the order in which the items are looped over is random.
|
||||||
|
|
||||||
All of this also works with dynamic variables!
|
All of this also works with dynamic variables!
|
||||||
|
|
||||||
@@ -1594,7 +1581,7 @@ tasks:
|
|||||||
sh: find -type f -name '*.txt'
|
sh: find -type f -name '*.txt'
|
||||||
cmds:
|
cmds:
|
||||||
- for: { var: MY_VAR }
|
- for: { var: MY_VAR }
|
||||||
cmd: cat {{.ITEM}}
|
cmd: cat <span v-pre>{{.ITEM}}</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Renaming variables
|
### Renaming variables
|
||||||
@@ -1611,7 +1598,7 @@ tasks:
|
|||||||
MY_VAR: foo.txt bar.txt
|
MY_VAR: foo.txt bar.txt
|
||||||
cmds:
|
cmds:
|
||||||
- for: { var: MY_VAR, as: FILE }
|
- for: { var: MY_VAR, as: FILE }
|
||||||
cmd: cat {{.FILE}}
|
cmd: cat <span v-pre>{{.FILE}}</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Looping over tasks
|
### Looping over tasks
|
||||||
@@ -1629,11 +1616,11 @@ tasks:
|
|||||||
- for: [foo, bar]
|
- for: [foo, bar]
|
||||||
task: my-task
|
task: my-task
|
||||||
vars:
|
vars:
|
||||||
FILE: '{{.ITEM}}'
|
FILE: '<span v-pre>{{.ITEM}}</span>'
|
||||||
|
|
||||||
my-task:
|
my-task:
|
||||||
cmds:
|
cmds:
|
||||||
- echo '{{.FILE}}'
|
- echo '<span v-pre>{{.FILE}}</span>'
|
||||||
```
|
```
|
||||||
|
|
||||||
Or if you want to run different tasks depending on the value of the loop:
|
Or if you want to run different tasks depending on the value of the loop:
|
||||||
@@ -1645,7 +1632,7 @@ tasks:
|
|||||||
default:
|
default:
|
||||||
cmds:
|
cmds:
|
||||||
- for: [foo, bar]
|
- for: [foo, bar]
|
||||||
task: task-{{.ITEM}}
|
task: task-<span v-pre>{{.ITEM}}</span>
|
||||||
|
|
||||||
task-foo:
|
task-foo:
|
||||||
cmds:
|
cmds:
|
||||||
@@ -1670,11 +1657,11 @@ tasks:
|
|||||||
- for: [foo, bar]
|
- for: [foo, bar]
|
||||||
task: my-task
|
task: my-task
|
||||||
vars:
|
vars:
|
||||||
FILE: '{{.ITEM}}'
|
FILE: '<span v-pre>{{.ITEM}}</span>'
|
||||||
|
|
||||||
my-task:
|
my-task:
|
||||||
cmds:
|
cmds:
|
||||||
- echo '{{.FILE}}'
|
- echo '<span v-pre>{{.FILE}}</span>'
|
||||||
```
|
```
|
||||||
|
|
||||||
It is important to note that as `deps` are run in parallel, the order in which
|
It is important to note that as `deps` are run in parallel, the order in which
|
||||||
@@ -1710,7 +1697,7 @@ version: '3'
|
|||||||
tasks:
|
tasks:
|
||||||
yarn:
|
yarn:
|
||||||
cmds:
|
cmds:
|
||||||
- yarn {{.CLI_ARGS}}
|
- yarn <span v-pre>{{.CLI_ARGS}}</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Wildcard arguments
|
## Wildcard arguments
|
||||||
@@ -1731,16 +1718,17 @@ version: '3'
|
|||||||
tasks:
|
tasks:
|
||||||
start:*:*:
|
start:*:*:
|
||||||
vars:
|
vars:
|
||||||
SERVICE: "{{index .MATCH 0}}"
|
SERVICE: '<span v-pre>{{index .MATCH 0}}</span>'
|
||||||
REPLICAS: "{{index .MATCH 1}}"
|
REPLICAS: '<span v-pre>{{index .MATCH 1}}</span>'
|
||||||
cmds:
|
cmds:
|
||||||
- echo "Starting {{.SERVICE}} with {{.REPLICAS}} replicas"
|
- echo "Starting <span v-pre>{{.SERVICE}}</span> with <span
|
||||||
|
v-pre>{{.REPLICAS}}</span> replicas"
|
||||||
|
|
||||||
start:*:
|
start:*:
|
||||||
vars:
|
vars:
|
||||||
SERVICE: "{{index .MATCH 0}}"
|
SERVICE: '<span v-pre>{{index .MATCH 0}}</span>'
|
||||||
cmds:
|
cmds:
|
||||||
- echo "Starting {{.SERVICE}}"
|
- echo "Starting <span v-pre>{{.SERVICE}}</span>"
|
||||||
```
|
```
|
||||||
|
|
||||||
This call matches the `start:*` task and the string "foo" is captured by the
|
This call matches the `start:*` task and the string "foo" is captured by the
|
||||||
@@ -1804,7 +1792,7 @@ tasks:
|
|||||||
cleanup: rm -rf tmpdir/
|
cleanup: rm -rf tmpdir/
|
||||||
```
|
```
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
Due to the nature of how the
|
Due to the nature of how the
|
||||||
[Go's own `defer` work](https://go.dev/tour/flowcontrol/13), the deferred
|
[Go's own `defer` work](https://go.dev/tour/flowcontrol/13), the deferred
|
||||||
@@ -1813,7 +1801,7 @@ commands are executed in the reverse order if you schedule multiple of them.
|
|||||||
:::
|
:::
|
||||||
|
|
||||||
A special variable `.EXIT_CODE` is exposed when a command exited with a non-zero
|
A special variable `.EXIT_CODE` is exposed when a command exited with a non-zero
|
||||||
[exit code](/reference/cli#exit-codes). You can check its presence to know if
|
[exit code](/docs/reference/cli#exit-codes). You can check its presence to know if
|
||||||
the task completed successfully or not:
|
the task completed successfully or not:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -1822,7 +1810,10 @@ version: '3'
|
|||||||
tasks:
|
tasks:
|
||||||
default:
|
default:
|
||||||
cmds:
|
cmds:
|
||||||
- defer: echo '{{if .EXIT_CODE}}Failed with {{.EXIT_CODE}}!{{else}}Success!{{end}}'
|
- defer:
|
||||||
|
echo '<span v-pre>{{if .EXIT_CODE}}</span>Failed with <span
|
||||||
|
v-pre>{{.EXIT_CODE}}</span>!<span v-pre>{{else}}</span>Success!<span
|
||||||
|
v-pre>{{end}}</span>'
|
||||||
- exit 1
|
- exit 1
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -1944,17 +1935,18 @@ version: '3'
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
default:
|
default:
|
||||||
- task: print
|
cmds:
|
||||||
vars:
|
- task: print
|
||||||
MESSAGE: hello
|
vars:
|
||||||
- task: print
|
MESSAGE: hello
|
||||||
vars:
|
- task: print
|
||||||
MESSAGE: world
|
vars:
|
||||||
|
MESSAGE: world
|
||||||
|
|
||||||
print:
|
print:
|
||||||
label: 'print-{{.MESSAGE}}'
|
label: 'print-<span v-pre>{{.MESSAGE}}</span>'
|
||||||
cmds:
|
cmds:
|
||||||
- echo "{{.MESSAGE}}"
|
- echo "<span v-pre>{{.MESSAGE}}</span>"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Warning Prompts
|
## Warning Prompts
|
||||||
@@ -2006,14 +1998,14 @@ tasks:
|
|||||||
|
|
||||||
dangerous:
|
dangerous:
|
||||||
prompt:
|
prompt:
|
||||||
- This is a dangerous command... Do you want to continue?
|
- This is a dangerous command... Do you want to continue?
|
||||||
- Are you sure?
|
- Are you sure?
|
||||||
cmds:
|
cmds:
|
||||||
- echo 'dangerous command'
|
- echo 'dangerous command'
|
||||||
```
|
```
|
||||||
|
|
||||||
Warning prompts are called before executing a task. If a prompt is denied Task
|
Warning prompts are called before executing a task. If a prompt is denied Task
|
||||||
will exit with [exit code](/reference/cli#exit-codes) 205. If approved, Task
|
will exit with [exit code](/docs/reference/cli#exit-codes) 205. If approved, Task
|
||||||
will continue as normal.
|
will continue as normal.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -2029,7 +2021,7 @@ To skip warning prompts automatically, you can use the `--yes` (alias `-y`)
|
|||||||
option when calling the task. By including this option, all warnings, will be
|
option when calling the task. By including this option, all warnings, will be
|
||||||
automatically confirmed, and no prompts will be shown.
|
automatically confirmed, and no prompts will be shown.
|
||||||
|
|
||||||
:::caution
|
::: warning
|
||||||
|
|
||||||
Tasks with prompts always fail by default on non-terminal environments, like a
|
Tasks with prompts always fail by default on non-terminal environments, like a
|
||||||
CI, where an `stdin` won't be available for the user to answer. In those cases,
|
CI, where an `stdin` won't be available for the user to answer. In those cases,
|
||||||
@@ -2197,7 +2189,7 @@ version: '3'
|
|||||||
|
|
||||||
output:
|
output:
|
||||||
group:
|
group:
|
||||||
begin: '::group::{{.TASK}}'
|
begin: '::group::<span v-pre>{{.TASK}}</span>'
|
||||||
end: '::endgroup::'
|
end: '::endgroup::'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -2260,8 +2252,8 @@ tasks:
|
|||||||
|
|
||||||
print:
|
print:
|
||||||
cmds:
|
cmds:
|
||||||
- echo "{{.TEXT}}"
|
- echo "<span v-pre>{{.TEXT}}</span>"
|
||||||
prefix: 'print-{{.TEXT}}'
|
prefix: 'print-<span v-pre>{{.TEXT}}</span>'
|
||||||
silent: true
|
silent: true
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -2272,7 +2264,7 @@ $ task default
|
|||||||
[print-baz] baz
|
[print-baz] baz
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tip
|
::: tip
|
||||||
|
|
||||||
The `output` option can also be specified by the `--output` or `-o` flags.
|
The `output` option can also be specified by the `--output` or `-o` flags.
|
||||||
|
|
||||||
@@ -2310,11 +2302,11 @@ the default settings (e.g. no custom `env:`, `vars:`, `desc:`, `silent:` , etc):
|
|||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
build: go build -v -o ./app{{exeExt}} .
|
build: go build -v -o ./app<span v-pre>{{exeExt}}</span> .
|
||||||
|
|
||||||
run:
|
run:
|
||||||
- task: build
|
- task: build
|
||||||
- ./app{{exeExt}} -h localhost -p 8080
|
- ./app<span v-pre>{{exeExt}}</span> -h localhost -p 8080
|
||||||
```
|
```
|
||||||
|
|
||||||
## `set` and `shopt`
|
## `set` and `shopt`
|
||||||
@@ -2336,7 +2328,7 @@ tasks:
|
|||||||
default: echo **/*.go
|
default: echo **/*.go
|
||||||
```
|
```
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
Keep in mind that not all options are available in the
|
Keep in mind that not all options are available in the
|
||||||
[shell interpreter library](https://github.com/mvdan/sh) that Task uses.
|
[shell interpreter library](https://github.com/mvdan/sh) that Task uses.
|
||||||
@@ -2351,9 +2343,9 @@ which files to watch.
|
|||||||
|
|
||||||
The default watch interval is 100 milliseconds, but it's possible to change it
|
The default watch interval is 100 milliseconds, but it's possible to change it
|
||||||
by either setting `interval: '500ms'` in the root of the Taskfile or by passing
|
by either setting `interval: '500ms'` in the root of the Taskfile or by passing
|
||||||
it as an argument like `--interval=500ms`.
|
it as an argument like `--interval=500ms`. This interval is the time Task will
|
||||||
This interval is the time Task will wait for duplicated events. It will only run
|
wait for duplicated events. It will only run the task again once, even if
|
||||||
the task again once, even if multiple changes happen within the interval.
|
multiple changes happen within the interval.
|
||||||
|
|
||||||
Also, it's possible to set `watch: true` in a given task and it'll automatically
|
Also, it's possible to set `watch: true` in a given task and it'll automatically
|
||||||
run in watch mode:
|
run in watch mode:
|
||||||
@@ -2373,7 +2365,7 @@ tasks:
|
|||||||
- go build # ...
|
- go build # ...
|
||||||
```
|
```
|
||||||
|
|
||||||
:::info
|
::: info
|
||||||
|
|
||||||
Note that when setting `watch: true` to a task, it'll only run in watch mode
|
Note that when setting `watch: true` to a task, it'll only run in watch mode
|
||||||
when running from the CLI via `task my-watch-task`, but won't run in watch mode
|
when running from the CLI via `task my-watch-task`, but won't run in watch mode
|
||||||
@@ -2381,13 +2373,12 @@ if called by another task, either directly or as a dependency.
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::caution
|
::: warning
|
||||||
|
|
||||||
The watcher can misbehave in certain scenarios, in particular for long-running
|
The watcher can misbehave in certain scenarios, in particular for long-running
|
||||||
servers.
|
servers. There is a known bug where child processes of the running might not be
|
||||||
There is a known bug where child processes of the running might not be killed
|
killed appropriately. It's advised to avoid running commands as `go run` and
|
||||||
appropriately. It's adviced to avoid running commands as `go run` and prefer
|
prefer `go build [...] && ./binary` instead.
|
||||||
`go build [...] && ./binary` instead.
|
|
||||||
|
|
||||||
If you are having issues, you might want to try tools specifically designed for
|
If you are having issues, you might want to try tools specifically designed for
|
||||||
live-reloading, like [Air](https://github.com/air-verse/air/). Also, be sure to
|
live-reloading, like [Air](https://github.com/air-verse/air/). Also, be sure to
|
||||||
@@ -2396,7 +2387,5 @@ to us.
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[gotemplate]: https://golang.org/pkg/text/template/
|
[gotemplate]: https://golang.org/pkg/text/template/
|
||||||
[templating-reference]: ./reference/templating.mdx
|
[templating-reference]: /docs/reference/templating
|
||||||
{/* prettier-ignore-end */}
|
|
323
website/src/docs/installation.md
Normal file
@@ -0,0 +1,323 @@
|
|||||||
|
---
|
||||||
|
title: Installation
|
||||||
|
description: Installation methods for Task
|
||||||
|
outline: deep
|
||||||
|
---
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
Task offers many installation methods. Check out the available methods below.
|
||||||
|
|
||||||
|
::: info
|
||||||
|
|
||||||
|
Some of the methods below are marked as
|
||||||
|
. This means
|
||||||
|
they are not maintained by the Task team and may not be up-to-date.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
## Package Managers
|
||||||
|
|
||||||
|
### [Homebrew](https://brew.sh)   {#homebrew}
|
||||||
|
|
||||||
|
Task is available via our official Homebrew tap
|
||||||
|
[[source](https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb)]:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
brew install go-task/tap/go-task
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively it can be installed from the official Homebrew repository
|
||||||
|
[[package](https://formulae.brew.sh/formula/go-task)]
|
||||||
|
[[source](https://github.com/Homebrew/homebrew-core/blob/master/Formula/g/go-task.rb)]
|
||||||
|
by running:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
brew install go-task
|
||||||
|
```
|
||||||
|
|
||||||
|
### [Macports](https://macports.org)   {#macports}
|
||||||
|
|
||||||
|
Task repository is tracked by Macports
|
||||||
|
[[package](https://ports.macports.org/port/go-task/details/)]
|
||||||
|
[[source](https://github.com/macports/macports-ports/blob/master/devel/go-task/Portfile)]:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
port install go-task
|
||||||
|
```
|
||||||
|
|
||||||
|
### [Snap](https://snapcraft.io/task)   {#snap}
|
||||||
|
|
||||||
|
Task is available on [Snapcraft](https://snapcraft.io/task)
|
||||||
|
[[source](https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml)], but
|
||||||
|
keep in mind that your Linux distribution should allow classic confinement for
|
||||||
|
Snaps to Task work correctly:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sudo snap install task --classic
|
||||||
|
```
|
||||||
|
|
||||||
|
### [npm](https://www.npmjs.com)    {#npm}
|
||||||
|
|
||||||
|
Npm can be used as cross-platform way to install Task globally or as a
|
||||||
|
dependency of your project
|
||||||
|
[[package](https://www.npmjs.com/package/@go-task/cli)]
|
||||||
|
[[source](https://github.com/go-task/task/blob/main/package.json)]:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
npm install -g @go-task/cli
|
||||||
|
```
|
||||||
|
|
||||||
|
### [pip](https://pip.pypa.io)     {#pip}
|
||||||
|
|
||||||
|
Like npm, pip can be used as a cross-platform way to install Task
|
||||||
|
[[package](https://pypi.org/project/go-task-bin)]
|
||||||
|
[[source](https://github.com/Bing-su/pip-binary-factory/tree/main/task)]:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pip install go-task-bin
|
||||||
|
```
|
||||||
|
|
||||||
|
### [WinGet](https://github.com/microsoft/winget-cli)  {#winget}
|
||||||
|
|
||||||
|
Task is available via the
|
||||||
|
[community repository](https://github.com/microsoft/winget-pkgs)
|
||||||
|
[[source](https://github.com/microsoft/winget-pkgs/tree/master/manifests/t/Task/Task)]:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
winget install Task.Task
|
||||||
|
```
|
||||||
|
|
||||||
|
### [Chocolatey](https://chocolatey.org)   {#chocolatey}
|
||||||
|
|
||||||
|
[[package](https://community.chocolatey.org/packages/go-task)]
|
||||||
|
[[source](https://github.com/Starz0r/ChocolateyPackagingScripts/blob/master/src/go-task_gh_build.py)]
|
||||||
|
|
||||||
|
```shell
|
||||||
|
choco install go-task
|
||||||
|
```
|
||||||
|
|
||||||
|
### [Scoop](https://scoop.sh)   {#scoop}
|
||||||
|
|
||||||
|
[[source](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json)]
|
||||||
|
|
||||||
|
```shell
|
||||||
|
scoop install task
|
||||||
|
```
|
||||||
|
|
||||||
|
### Arch ([pacman](https://wiki.archlinux.org/title/Pacman))   {#arch}
|
||||||
|
|
||||||
|
[[package](https://archlinux.org/packages/extra/x86_64/go-task/)]
|
||||||
|
[[source](https://gitlab.archlinux.org/archlinux/packaging/packages/go-task)]
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pacman -S go-task
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fedora ([dnf](https://docs.fedoraproject.org/en-US/quick-docs/dnf))   {#fedora}
|
||||||
|
|
||||||
|
[[package](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)]
|
||||||
|
[[source](https://src.fedoraproject.org/rpms/golang-github-task)]
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dnf install go-task
|
||||||
|
```
|
||||||
|
|
||||||
|
### FreeBSD ([Ports](https://ports.freebsd.org/cgi/ports.cgi))   {#freebsd}
|
||||||
|
|
||||||
|
[[package](https://cgit.freebsd.org/ports/tree/devel/task)]
|
||||||
|
[[source](https://cgit.freebsd.org/ports/tree/devel/task/Makefile)]
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pkg install task
|
||||||
|
```
|
||||||
|
|
||||||
|
### NixOS ([nix](https://nixos.org))    {#nix}
|
||||||
|
|
||||||
|
[[source](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/go/go-task/package.nix)]
|
||||||
|
|
||||||
|
```shell
|
||||||
|
nix-env -iA nixpkgs.go-task
|
||||||
|
```
|
||||||
|
|
||||||
|
### [pacstall](https://github.com/pacstall/pacstall)    {#pacstall}
|
||||||
|
|
||||||
|
[[package](https://pacstall.dev/packages/go-task-deb)]
|
||||||
|
[[source](https://github.com/pacstall/pacstall-programs/blob/master/packages/go-task-deb/go-task-deb.pacscript)]
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pacstall -I go-task-deb
|
||||||
|
```
|
||||||
|
|
||||||
|
### [pkgx](https://pkgx.sh)    {#pkgx}
|
||||||
|
|
||||||
|
[[package](https://pkgx.dev/pkgs/taskfile.dev)]
|
||||||
|
[[source](https://github.com/pkgxdev/pantry/blob/main/projects/taskfile.dev/package.yml)]
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pkgx task
|
||||||
|
```
|
||||||
|
|
||||||
|
or, if you have pkgx integration enabled:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
task
|
||||||
|
```
|
||||||
|
|
||||||
|
## Get The Binary
|
||||||
|
|
||||||
|
### Binary
|
||||||
|
|
||||||
|
You can download the binary from the
|
||||||
|
[releases page on GitHub](https://github.com/go-task/task/releases) and add to
|
||||||
|
your `$PATH`.
|
||||||
|
|
||||||
|
DEB and RPM packages are also available.
|
||||||
|
|
||||||
|
The `task_checksums.txt` file contains the SHA-256 checksum for each file.
|
||||||
|
|
||||||
|
### Install Script
|
||||||
|
|
||||||
|
We also have an
|
||||||
|
[install script](https://github.com/go-task/task/blob/main/install-task.sh)
|
||||||
|
which is very useful in scenarios like CI. Many thanks to
|
||||||
|
[GoDownloader](https://github.com/goreleaser/godownloader) for enabling the easy
|
||||||
|
generation of this script.
|
||||||
|
|
||||||
|
By default, it installs on the `./bin` directory relative to the working
|
||||||
|
directory:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
|
||||||
|
```
|
||||||
|
|
||||||
|
It is possible to override the installation directory with the `-b` parameter.
|
||||||
|
On Linux, common choices are `~/.local/bin` and `~/bin` to install for the
|
||||||
|
current user or `/usr/local/bin` to install for all users:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
|
||||||
|
```
|
||||||
|
|
||||||
|
::: warning
|
||||||
|
|
||||||
|
On macOS and Windows, `~/.local/bin` and `~/bin` are not added to `$PATH` by
|
||||||
|
default.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
By default, it installs the latest version available. You can also specify a tag
|
||||||
|
(available in [releases](https://github.com/go-task/task/releases)) to install a
|
||||||
|
specific version:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d v3.36.0
|
||||||
|
```
|
||||||
|
|
||||||
|
Parameters are order specific, to set both installation directory and version:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin v3.42.1
|
||||||
|
```
|
||||||
|
|
||||||
|
### GitHub Actions
|
||||||
|
|
||||||
|
If you want to install Task in GitHub Actions you can try using
|
||||||
|
[this action](https://github.com/arduino/setup-task) by the Arduino team:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Install Task
|
||||||
|
uses: arduino/setup-task@v2
|
||||||
|
with:
|
||||||
|
version: 3.x
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
```
|
||||||
|
|
||||||
|
This installation method is community owned.
|
||||||
|
|
||||||
|
## Build From Source
|
||||||
|
|
||||||
|
### Go Modules
|
||||||
|
|
||||||
|
Ensure that you have a supported version of [Go](https://golang.org) properly
|
||||||
|
installed and setup. You can find the minimum required version of Go in the
|
||||||
|
[go.mod](https://github.com/go-task/task/blob/main/go.mod#L3) file.
|
||||||
|
|
||||||
|
You can then install the latest release globally by running:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
go install github.com/go-task/task/v3/cmd/task@latest
|
||||||
|
```
|
||||||
|
|
||||||
|
Or you can install into another directory:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest
|
||||||
|
```
|
||||||
|
|
||||||
|
::: tip
|
||||||
|
|
||||||
|
For CI environments we recommend using the [install script](#install-script)
|
||||||
|
instead, which is faster and more stable, since it'll just download the latest
|
||||||
|
released binary.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
## Setup completions
|
||||||
|
|
||||||
|
Some installation methods will automatically install completions too, but if
|
||||||
|
this isn't working for you or your chosen method doesn't include them, you can
|
||||||
|
run `task --completion <shell>` to output a completion script for any supported
|
||||||
|
shell. There are a couple of ways these completions can be added to your shell
|
||||||
|
config:
|
||||||
|
|
||||||
|
### Option 1. Load the completions in your shell's startup config (Recommended)
|
||||||
|
|
||||||
|
This method loads the completion script from the currently installed version of
|
||||||
|
task every time you create a new shell. This ensures that your completions are
|
||||||
|
always up-to-date.
|
||||||
|
|
||||||
|
::: code-group
|
||||||
|
|
||||||
|
```shell [bash]
|
||||||
|
# ~/.bashrc
|
||||||
|
eval "$(task --completion bash)"
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell [zsh]
|
||||||
|
# ~/.zshrc
|
||||||
|
eval "$(task --completion zsh)"
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell [fish]
|
||||||
|
# ~/.config/fish/config.fish
|
||||||
|
task --completion fish | source
|
||||||
|
```
|
||||||
|
|
||||||
|
```powershell [powershell]
|
||||||
|
# $PROFILE\Microsoft.PowerShell_profile.ps1
|
||||||
|
Invoke-Expression (&task --completion powershell | Out-String)
|
||||||
|
```
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
### Option 2. Copy the script to your shell's completions directory
|
||||||
|
|
||||||
|
This method requires you to manually update the completions whenever Task is
|
||||||
|
updated. However, it is useful if you want to modify the completions yourself.
|
||||||
|
|
||||||
|
::: code-group
|
||||||
|
|
||||||
|
```shell [bash]
|
||||||
|
task --completion bash > /etc/bash_completion.d/task
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell [zsh]
|
||||||
|
task --completion zsh > /usr/local/share/zsh/site-functions/_task
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell [fish]
|
||||||
|
task --completion fish > ~/.config/fish/completions/task.fish
|
||||||
|
```
|
||||||
|
|
||||||
|
:::
|
@@ -1,6 +1,9 @@
|
|||||||
---
|
---
|
||||||
slug: /integrations/
|
title: Integrations
|
||||||
sidebar_position: 9
|
description:
|
||||||
|
Official and community integrations for Task, including VS Code, JSON schemas,
|
||||||
|
and other tools
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Integrations
|
# Integrations
|
343
website/src/docs/reference/cli.md
Normal file
@@ -0,0 +1,343 @@
|
|||||||
|
---
|
||||||
|
title: CLI Reference
|
||||||
|
description: Complete reference for Task CLI commands, flags, and exit codes
|
||||||
|
permalink: /reference/cli/
|
||||||
|
outline: deep
|
||||||
|
---
|
||||||
|
|
||||||
|
# Command Line Interface
|
||||||
|
|
||||||
|
Task CLI commands have the following syntax:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task [options] [tasks...] [-- CLI_ARGS...]
|
||||||
|
```
|
||||||
|
|
||||||
|
::: tip
|
||||||
|
|
||||||
|
If `--` is given, all remaining arguments will be assigned to a special
|
||||||
|
`CLI_ARGS` variable
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
### `task [tasks...]`
|
||||||
|
|
||||||
|
Run one or more tasks defined in your Taskfile.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task build
|
||||||
|
task test lint
|
||||||
|
task deploy --force
|
||||||
|
```
|
||||||
|
|
||||||
|
### `task --list`
|
||||||
|
|
||||||
|
List all available tasks with their descriptions.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task --list
|
||||||
|
task -l
|
||||||
|
```
|
||||||
|
|
||||||
|
### `task --list-all`
|
||||||
|
|
||||||
|
List all tasks, including those without descriptions.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task --list-all
|
||||||
|
task -a
|
||||||
|
```
|
||||||
|
|
||||||
|
### `task --init`
|
||||||
|
|
||||||
|
Create a new Taskfile.yml in the current directory.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task --init
|
||||||
|
task -i
|
||||||
|
```
|
||||||
|
|
||||||
|
## Options
|
||||||
|
|
||||||
|
### General
|
||||||
|
|
||||||
|
#### `-h, --help`
|
||||||
|
|
||||||
|
Show help information.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task --help
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `--version`
|
||||||
|
|
||||||
|
Show Task version.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task --version
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `-v, --verbose`
|
||||||
|
|
||||||
|
Enable verbose mode for detailed output.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task build --verbose
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `-s, --silent`
|
||||||
|
|
||||||
|
Disable command echoing.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task deploy --silent
|
||||||
|
```
|
||||||
|
|
||||||
|
### Execution Control
|
||||||
|
|
||||||
|
#### `-f, --force`
|
||||||
|
|
||||||
|
Force execution even when the task is up-to-date.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task build --force
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `-n, --dry`
|
||||||
|
|
||||||
|
Compile and print tasks without executing them.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task deploy --dry
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `-p, --parallel`
|
||||||
|
|
||||||
|
Execute multiple tasks in parallel.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task test lint --parallel
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `-C, --concurrency <number>`
|
||||||
|
|
||||||
|
Limit the number of concurrent tasks. Zero means unlimited.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task test --concurrency 4
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `-x, --exit-code`
|
||||||
|
|
||||||
|
Pass through the exit code of failed commands.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task test --exit-code
|
||||||
|
```
|
||||||
|
|
||||||
|
### File and Directory
|
||||||
|
|
||||||
|
#### `-d, --dir <path>`
|
||||||
|
|
||||||
|
Set the directory where Task will run and look for Taskfiles.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task build --dir ./backend
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `-t, --taskfile <file>`
|
||||||
|
|
||||||
|
Specify a custom Taskfile path.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task build --taskfile ./custom/Taskfile.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `-g, --global`
|
||||||
|
|
||||||
|
Run the global Taskfile from `$HOME/Taskfile.{yml,yaml}`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task backup --global
|
||||||
|
```
|
||||||
|
|
||||||
|
### Output Control
|
||||||
|
|
||||||
|
#### `-o, --output <mode>`
|
||||||
|
|
||||||
|
Set output style. Available modes: `interleaved`, `group`, `prefixed`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task test --output group
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `--output-group-begin <template>`
|
||||||
|
|
||||||
|
Message template to print before grouped output.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task test --output group --output-group-begin "::group::{{.TASK}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `--output-group-end <template>`
|
||||||
|
|
||||||
|
Message template to print after grouped output.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task test --output group --output-group-end "::endgroup::"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `--output-group-error-only`
|
||||||
|
|
||||||
|
Only show command output on non-zero exit codes.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task test --output group --output-group-error-only
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `-c, --color`
|
||||||
|
|
||||||
|
Control colored output. Enabled by default.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task build --color=false
|
||||||
|
# or use environment variable
|
||||||
|
NO_COLOR=1 task build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Task Information
|
||||||
|
|
||||||
|
#### `--status`
|
||||||
|
|
||||||
|
Check if tasks are up-to-date without running them.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task build --status
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `--summary`
|
||||||
|
|
||||||
|
Show detailed information about a task.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task build --summary
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `--json`
|
||||||
|
|
||||||
|
Output task information in JSON format (use with `--list` or `--list-all`).
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task --list --json
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `--sort <mode>`
|
||||||
|
|
||||||
|
Change task listing order. Available modes: `default`, `alphanumeric`, `none`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task --list --sort alphanumeric
|
||||||
|
```
|
||||||
|
|
||||||
|
### Watch Mode
|
||||||
|
|
||||||
|
#### `-w, --watch`
|
||||||
|
|
||||||
|
Watch for file changes and re-run tasks automatically.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task build --watch
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `-I, --interval <duration>`
|
||||||
|
|
||||||
|
Set watch interval (default: `5s`). Must be a valid
|
||||||
|
[Go duration](https://pkg.go.dev/time#ParseDuration).
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task build --watch --interval 1s
|
||||||
|
```
|
||||||
|
|
||||||
|
### Interactive
|
||||||
|
|
||||||
|
#### `-y, --yes`
|
||||||
|
|
||||||
|
Automatically answer "yes" to all prompts.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task deploy --yes
|
||||||
|
```
|
||||||
|
|
||||||
|
## Exit Codes
|
||||||
|
|
||||||
|
Task uses specific exit codes to indicate different types of errors:
|
||||||
|
|
||||||
|
### Success
|
||||||
|
|
||||||
|
- **0** - Success
|
||||||
|
|
||||||
|
### General Errors (1-99)
|
||||||
|
|
||||||
|
- **1** - Unknown error occurred
|
||||||
|
|
||||||
|
### Taskfile Errors (100-199)
|
||||||
|
|
||||||
|
- **100** - No Taskfile found
|
||||||
|
- **101** - Taskfile already exists (when using `--init`)
|
||||||
|
- **102** - Invalid or unparseable Taskfile
|
||||||
|
- **103** - Remote Taskfile download failed
|
||||||
|
- **104** - Remote Taskfile not trusted
|
||||||
|
- **105** - Remote Taskfile fetch not secure
|
||||||
|
- **106** - No cache for remote Taskfile in offline mode
|
||||||
|
- **107** - No schema version defined in Taskfile
|
||||||
|
|
||||||
|
### Task Errors (200-255)
|
||||||
|
|
||||||
|
- **200** - Task not found
|
||||||
|
- **201** - Command execution error
|
||||||
|
- **202** - Attempted to run internal task
|
||||||
|
- **203** - Multiple tasks with same name/alias
|
||||||
|
- **204** - Task called too many times (recursion limit)
|
||||||
|
- **205** - Task cancelled by user
|
||||||
|
- **206** - Missing required variables
|
||||||
|
- **207** - Variable has incorrect value
|
||||||
|
|
||||||
|
::: info
|
||||||
|
|
||||||
|
When using `-x/--exit-code`, failed command exit codes are passed through
|
||||||
|
instead of the above codes.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
::: tip
|
||||||
|
|
||||||
|
The complete list of exit codes is available in the repository at
|
||||||
|
[`errors/errors.go`](https://github.com/go-task/task/blob/main/errors/errors.go).
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
## JSON Output Format
|
||||||
|
|
||||||
|
When using `--json` with `--list` or `--list-all`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"name": "build",
|
||||||
|
"task": "build",
|
||||||
|
"desc": "Build the application",
|
||||||
|
"summary": "Compiles the source code and generates binaries",
|
||||||
|
"up_to_date": false,
|
||||||
|
"location": {
|
||||||
|
"line": 12,
|
||||||
|
"column": 3,
|
||||||
|
"taskfile": "/path/to/Taskfile.yml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"location": "/path/to/Taskfile.yml"
|
||||||
|
}
|
||||||
|
```
|
@@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
slug: /reference/package
|
title: CLI Reference
|
||||||
sidebar_position: 2
|
description: Complete reference for Task CLI commands, flags, and exit codes
|
||||||
---
|
---
|
||||||
|
|
||||||
# Package API
|
# Package API
|
||||||
|
|
||||||
:::warning
|
::: warning
|
||||||
|
|
||||||
**_Task's package API is still experimental and subject to breaking changes._**
|
**_Task's package API is still experimental and subject to breaking changes._**
|
||||||
|
|
||||||
@@ -39,9 +39,11 @@ fetching and executing tasks from a Taskfile. At this time, the vast majority of
|
|||||||
the this package's functionality is exposed via the [`task.Executor`] which
|
the this package's functionality is exposed via the [`task.Executor`] which
|
||||||
allows the user to fetch and execute tasks from a Taskfile.
|
allows the user to fetch and execute tasks from a Taskfile.
|
||||||
|
|
||||||
:::note
|
::: info
|
||||||
|
|
||||||
This is the package which is most likely to be the subject of breaking changes
|
This is the package which is most likely to be the subject of breaking changes
|
||||||
as we refine the API.
|
as we refine the API.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### [`github.com/go-task/task/v3/taskfile`]
|
### [`github.com/go-task/task/v3/taskfile`]
|
||||||
@@ -68,10 +70,10 @@ represent the Taskfile syntax in Go. This package provides a way to parse
|
|||||||
Taskfile YAML into an AST and store them in memory.
|
Taskfile YAML into an AST and store them in memory.
|
||||||
|
|
||||||
- [`ast.TaskfileGraph`] - Represents a set of Taskfiles and their dependencies
|
- [`ast.TaskfileGraph`] - Represents a set of Taskfiles and their dependencies
|
||||||
between one another.
|
between one another.
|
||||||
- [`ast.Taskfile`] - Represents a single Taskfile or a set of merged Taskfiles.
|
- [`ast.Taskfile`] - Represents a single Taskfile or a set of merged Taskfiles.
|
||||||
The `Taskfile` type contains all of the subtypes for the Taskfile syntax, such
|
The `Taskfile` type contains all of the subtypes for the Taskfile syntax, such
|
||||||
as `tasks`, `includes`, `vars`, etc. These are not listed here for brevity.
|
as `tasks`, `includes`, `vars`, etc. These are not listed here for brevity.
|
||||||
|
|
||||||
### [`github.com/go-task/task/v3/errors`]
|
### [`github.com/go-task/task/v3/errors`]
|
||||||
|
|
||||||
@@ -136,32 +138,44 @@ tf, err := tfg.Merge()
|
|||||||
This compiles the DAG into a single [`ast.Taskfile`] containing all the
|
This compiles the DAG into a single [`ast.Taskfile`] containing all the
|
||||||
namespaces and tasks from all the Taskfiles we read.
|
namespaces and tasks from all the Taskfiles we read.
|
||||||
|
|
||||||
:::note
|
::: info
|
||||||
|
|
||||||
We plan to remove AST merging in the future as it is unnecessarily complex and
|
We plan to remove AST merging in the future as it is unnecessarily complex and
|
||||||
causes lots of issues with scoping.
|
causes lots of issues with scoping.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[`github.com/go-task/task/v3`]: https://pkg.go.dev/github.com/go-task/task/v3
|
[`github.com/go-task/task/v3`]: https://pkg.go.dev/github.com/go-task/task/v3
|
||||||
[`github.com/go-task/task/v3/taskfile`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile
|
[`github.com/go-task/task/v3/taskfile`]:
|
||||||
[`github.com/go-task/task/v3/taskfile/ast`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile
|
||||||
[`github.com/go-task/task/v3/errors`]: https://pkg.go.dev/github.com/go-task/task/v3/errors
|
[`github.com/go-task/task/v3/taskfile/ast`]:
|
||||||
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast
|
||||||
[`ast.TaskfileGraph`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast#TaskfileGraph
|
[`github.com/go-task/task/v3/errors`]:
|
||||||
[`ast.Taskfile`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast#Taskfile
|
https://pkg.go.dev/github.com/go-task/task/v3/errors
|
||||||
|
[`ast.TaskfileGraph`]:
|
||||||
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast#TaskfileGraph
|
||||||
|
[`ast.Taskfile`]:
|
||||||
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile/ast#Taskfile
|
||||||
[`taskfile.Node`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#Node
|
[`taskfile.Node`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#Node
|
||||||
[`taskfile.FileNode`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#FileNode
|
[`taskfile.FileNode`]:
|
||||||
[`taskfile.HTTPNode`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#HTTPNode
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#FileNode
|
||||||
[`taskfile.GitNode`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#GitNode
|
[`taskfile.HTTPNode`]:
|
||||||
[`taskfile.StdinNode`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#StdinNode
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#HTTPNode
|
||||||
[`taskfile.NewFileNode`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#NewFileNode
|
[`taskfile.GitNode`]:
|
||||||
[`taskfile.Reader`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#Reader
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#GitNode
|
||||||
[`taskfile.NewReader`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#NewReader
|
[`taskfile.StdinNode`]:
|
||||||
[`taskfile.Snippet`]: https://pkg.go.dev/github.com/go-task/task/v3/taskfile#Snippet
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#StdinNode
|
||||||
|
[`taskfile.NewFileNode`]:
|
||||||
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#NewFileNode
|
||||||
|
[`taskfile.Reader`]:
|
||||||
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#Reader
|
||||||
|
[`taskfile.NewReader`]:
|
||||||
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#NewReader
|
||||||
|
[`taskfile.Snippet`]:
|
||||||
|
https://pkg.go.dev/github.com/go-task/task/v3/taskfile#Snippet
|
||||||
[`task.Executor`]: https://pkg.go.dev/github.com/go-task/task/v3#Executor
|
[`task.Executor`]: https://pkg.go.dev/github.com/go-task/task/v3#Executor
|
||||||
[`task.Formatter`]: https://pkg.go.dev/github.com/go-task/task/v3#Formatter
|
[`task.Formatter`]: https://pkg.go.dev/github.com/go-task/task/v3#Formatter
|
||||||
[`errors.TaskError`]: https://pkg.go.dev/github.com/go-task/task/v3/errors#TaskError
|
[`errors.TaskError`]:
|
||||||
|
https://pkg.go.dev/github.com/go-task/task/v3/errors#TaskError
|
||||||
[`error`]: https://pkg.go.dev/builtin#error
|
[`error`]: https://pkg.go.dev/builtin#error
|
||||||
|
|
||||||
[ast]: https://en.wikipedia.org/wiki/Abstract_syntax_tree
|
[ast]: https://en.wikipedia.org/wiki/Abstract_syntax_tree
|
||||||
{/* prettier-ignore-end */}
|
|
840
website/src/docs/reference/schema.md
Normal file
@@ -0,0 +1,840 @@
|
|||||||
|
---
|
||||||
|
title: Schema Reference
|
||||||
|
description:
|
||||||
|
Complete reference for the Taskfile schema based on the official JSON schema
|
||||||
|
outline: deep
|
||||||
|
---
|
||||||
|
|
||||||
|
# Schema Reference
|
||||||
|
|
||||||
|
This page documents all available properties and types for the Taskfile schema
|
||||||
|
version 3, based on the
|
||||||
|
[official JSON schema](https://taskfile.dev/schema.json).
|
||||||
|
|
||||||
|
## Root Schema
|
||||||
|
|
||||||
|
The root Taskfile schema defines the structure of your main `Taskfile.yml`.
|
||||||
|
|
||||||
|
### `version`
|
||||||
|
|
||||||
|
- **Type**: `string` or `number`
|
||||||
|
- **Required**: Yes
|
||||||
|
- **Valid values**: `"3"`, `3`, or any valid semver string
|
||||||
|
- **Description**: Version of the Taskfile schema
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
```
|
||||||
|
|
||||||
|
### `output`
|
||||||
|
|
||||||
|
- **Type**: `string` or `object`
|
||||||
|
- **Default**: `interleaved`
|
||||||
|
- **Options**: `interleaved`, `group`, `prefixed`
|
||||||
|
- **Description**: Controls how task output is displayed
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Simple string format
|
||||||
|
output: group
|
||||||
|
|
||||||
|
# Advanced object format
|
||||||
|
output:
|
||||||
|
group:
|
||||||
|
begin: "::group::{{.TASK}}"
|
||||||
|
end: "::endgroup::"
|
||||||
|
error_only: false
|
||||||
|
```
|
||||||
|
|
||||||
|
### `method`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Default**: `checksum`
|
||||||
|
- **Options**: `checksum`, `timestamp`, `none`
|
||||||
|
- **Description**: Default method for checking if tasks are up-to-date
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
method: timestamp
|
||||||
|
```
|
||||||
|
|
||||||
|
### [`includes`](#include)
|
||||||
|
|
||||||
|
- **Type**: `map[string]Include`
|
||||||
|
- **Description**: Include other Taskfiles
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
includes:
|
||||||
|
# Simple string format
|
||||||
|
docs: ./Taskfile.yml
|
||||||
|
|
||||||
|
# Full object format
|
||||||
|
backend:
|
||||||
|
taskfile: ./backend
|
||||||
|
dir: ./backend
|
||||||
|
optional: false
|
||||||
|
flatten: false
|
||||||
|
internal: false
|
||||||
|
aliases: [api]
|
||||||
|
excludes: [internal-task]
|
||||||
|
vars:
|
||||||
|
SERVICE_NAME: backend
|
||||||
|
checksum: abc123...
|
||||||
|
```
|
||||||
|
|
||||||
|
### [`vars`](#variable)
|
||||||
|
|
||||||
|
- **Type**: `map[string]Variable`
|
||||||
|
- **Description**: Global variables available to all tasks
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
vars:
|
||||||
|
# Simple values
|
||||||
|
APP_NAME: myapp
|
||||||
|
VERSION: 1.0.0
|
||||||
|
DEBUG: true
|
||||||
|
PORT: 8080
|
||||||
|
FEATURES: [auth, logging]
|
||||||
|
|
||||||
|
# Dynamic variables
|
||||||
|
COMMIT_HASH:
|
||||||
|
sh: git rev-parse HEAD
|
||||||
|
|
||||||
|
# Variable references
|
||||||
|
BUILD_VERSION:
|
||||||
|
ref: VERSION
|
||||||
|
|
||||||
|
# Map variables
|
||||||
|
CONFIG:
|
||||||
|
map:
|
||||||
|
database: postgres
|
||||||
|
cache: redis
|
||||||
|
```
|
||||||
|
|
||||||
|
### `env`
|
||||||
|
|
||||||
|
- **Type**: `map[string]Variable`
|
||||||
|
- **Description**: Global environment variables
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
env:
|
||||||
|
NODE_ENV: production
|
||||||
|
DATABASE_URL:
|
||||||
|
sh: echo $DATABASE_URL
|
||||||
|
```
|
||||||
|
|
||||||
|
### [`tasks`](#task)
|
||||||
|
|
||||||
|
- **Type**: `map[string]Task`
|
||||||
|
- **Description**: Task definitions
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
# Simple string format
|
||||||
|
hello: echo "Hello World"
|
||||||
|
|
||||||
|
# Array format
|
||||||
|
build:
|
||||||
|
- go mod tidy
|
||||||
|
- go build ./...
|
||||||
|
|
||||||
|
# Full object format
|
||||||
|
deploy:
|
||||||
|
desc: Deploy the application
|
||||||
|
cmds:
|
||||||
|
- ./scripts/deploy.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### `silent`
|
||||||
|
|
||||||
|
- **Type**: `bool`
|
||||||
|
- **Default**: `false`
|
||||||
|
- **Description**: Suppress task name and command output by default
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
silent: true
|
||||||
|
```
|
||||||
|
|
||||||
|
### `dotenv`
|
||||||
|
|
||||||
|
- **Type**: `[]string`
|
||||||
|
- **Description**: Load environment variables from .env files
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dotenv:
|
||||||
|
- .env
|
||||||
|
- .env.local
|
||||||
|
```
|
||||||
|
|
||||||
|
### `run`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Default**: `always`
|
||||||
|
- **Options**: `always`, `once`, `when_changed`
|
||||||
|
- **Description**: Default execution behavior for tasks
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
run: once
|
||||||
|
```
|
||||||
|
|
||||||
|
### `interval`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Default**: `100ms`
|
||||||
|
- **Pattern**: `^[0-9]+(?:m|s|ms)$`
|
||||||
|
- **Description**: Watch interval for file changes
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
interval: 1s
|
||||||
|
```
|
||||||
|
|
||||||
|
### `set`
|
||||||
|
|
||||||
|
- **Type**: `[]string`
|
||||||
|
- **Options**: `allexport`, `a`, `errexit`, `e`, `noexec`, `n`, `noglob`, `f`,
|
||||||
|
`nounset`, `u`, `xtrace`, `x`, `pipefail`
|
||||||
|
- **Description**: POSIX shell options for all commands
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
set: [errexit, nounset, pipefail]
|
||||||
|
```
|
||||||
|
|
||||||
|
### `shopt`
|
||||||
|
|
||||||
|
- **Type**: `[]string`
|
||||||
|
- **Options**: `expand_aliases`, `globstar`, `nullglob`
|
||||||
|
- **Description**: Bash shell options for all commands
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
shopt: [globstar]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Include
|
||||||
|
|
||||||
|
Configuration for including external Taskfiles.
|
||||||
|
|
||||||
|
### `taskfile`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Required**: Yes
|
||||||
|
- **Description**: Path to the Taskfile or directory to include
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
includes:
|
||||||
|
backend: ./backend/Taskfile.yml
|
||||||
|
# Shorthand for above
|
||||||
|
frontend: ./frontend
|
||||||
|
```
|
||||||
|
|
||||||
|
### `dir`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Working directory for included tasks
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
includes:
|
||||||
|
api:
|
||||||
|
taskfile: ./api
|
||||||
|
dir: ./api
|
||||||
|
```
|
||||||
|
|
||||||
|
### `optional`
|
||||||
|
|
||||||
|
- **Type**: `bool`
|
||||||
|
- **Default**: `false`
|
||||||
|
- **Description**: Don't error if the included file doesn't exist
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
includes:
|
||||||
|
optional-tasks:
|
||||||
|
taskfile: ./optional.yml
|
||||||
|
optional: true
|
||||||
|
```
|
||||||
|
|
||||||
|
### `flatten`
|
||||||
|
|
||||||
|
- **Type**: `bool`
|
||||||
|
- **Default**: `false`
|
||||||
|
- **Description**: Include tasks without namespace prefix
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
includes:
|
||||||
|
common:
|
||||||
|
taskfile: ./common.yml
|
||||||
|
flatten: true
|
||||||
|
```
|
||||||
|
|
||||||
|
### `internal`
|
||||||
|
|
||||||
|
- **Type**: `bool`
|
||||||
|
- **Default**: `false`
|
||||||
|
- **Description**: Hide included tasks from command line and `--list`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
includes:
|
||||||
|
internal:
|
||||||
|
taskfile: ./internal.yml
|
||||||
|
internal: true
|
||||||
|
```
|
||||||
|
|
||||||
|
### `aliases`
|
||||||
|
|
||||||
|
- **Type**: `[]string`
|
||||||
|
- **Description**: Alternative names for the namespace
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
includes:
|
||||||
|
database:
|
||||||
|
taskfile: ./db.yml
|
||||||
|
aliases: [db, data]
|
||||||
|
```
|
||||||
|
|
||||||
|
### `excludes`
|
||||||
|
|
||||||
|
- **Type**: `[]string`
|
||||||
|
- **Description**: Tasks to exclude from inclusion
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
includes:
|
||||||
|
shared:
|
||||||
|
taskfile: ./shared.yml
|
||||||
|
excludes: [internal-setup, debug-only]
|
||||||
|
```
|
||||||
|
|
||||||
|
### `vars`
|
||||||
|
|
||||||
|
- **Type**: `map[string]Variable`
|
||||||
|
- **Description**: Variables to pass to the included Taskfile
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
includes:
|
||||||
|
deploy:
|
||||||
|
taskfile: ./deploy.yml
|
||||||
|
vars:
|
||||||
|
ENVIRONMENT: production
|
||||||
|
```
|
||||||
|
|
||||||
|
### `checksum`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Expected checksum of the included file
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
includes:
|
||||||
|
remote:
|
||||||
|
taskfile: https://example.com/tasks.yml
|
||||||
|
checksum: c153e97e0b3a998a7ed2e61064c6ddaddd0de0c525feefd6bba8569827d8efe9
|
||||||
|
```
|
||||||
|
|
||||||
|
## Variable
|
||||||
|
|
||||||
|
Variables support multiple types and can be static values, dynamic commands,
|
||||||
|
references, or maps.
|
||||||
|
|
||||||
|
### Static Variables
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
vars:
|
||||||
|
# String
|
||||||
|
APP_NAME: myapp
|
||||||
|
# Number
|
||||||
|
PORT: 8080
|
||||||
|
# Boolean
|
||||||
|
DEBUG: true
|
||||||
|
# Array
|
||||||
|
FEATURES: [auth, logging, metrics]
|
||||||
|
# Null
|
||||||
|
OPTIONAL_VAR: null
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dynamic Variables (`sh`)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
vars:
|
||||||
|
COMMIT_HASH:
|
||||||
|
sh: git rev-parse HEAD
|
||||||
|
BUILD_TIME:
|
||||||
|
sh: date -u +"%Y-%m-%dT%H:%M:%SZ"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Variable References (`ref`)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
vars:
|
||||||
|
BASE_VERSION: 1.0.0
|
||||||
|
FULL_VERSION:
|
||||||
|
ref: BASE_VERSION
|
||||||
|
```
|
||||||
|
|
||||||
|
### Map Variables (`map`)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
vars:
|
||||||
|
CONFIG:
|
||||||
|
map:
|
||||||
|
database:
|
||||||
|
host: localhost
|
||||||
|
port: 5432
|
||||||
|
cache:
|
||||||
|
type: redis
|
||||||
|
ttl: 3600
|
||||||
|
```
|
||||||
|
|
||||||
|
### Variable Ordering
|
||||||
|
|
||||||
|
Variables can reference previously defined variables:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
vars:
|
||||||
|
GREETING: Hello
|
||||||
|
TARGET: World
|
||||||
|
MESSAGE: '{{.GREETING}} {{.TARGET}}!'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Task
|
||||||
|
|
||||||
|
Individual task configuration with multiple syntax options.
|
||||||
|
|
||||||
|
### Simple Task Formats
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
# String command
|
||||||
|
hello: echo "Hello World"
|
||||||
|
|
||||||
|
# Array of commands
|
||||||
|
build:
|
||||||
|
- go mod tidy
|
||||||
|
- go build ./...
|
||||||
|
|
||||||
|
# Object with cmd shorthand
|
||||||
|
test:
|
||||||
|
cmd: go test ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
### Task Properties
|
||||||
|
|
||||||
|
#### `cmds`
|
||||||
|
|
||||||
|
- **Type**: `[]Command`
|
||||||
|
- **Description**: Commands to execute
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
build:
|
||||||
|
cmds:
|
||||||
|
- go build ./...
|
||||||
|
- echo "Build complete"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `cmd`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Single command (alternative to `cmds`)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
test:
|
||||||
|
cmd: go test ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `deps`
|
||||||
|
|
||||||
|
- **Type**: `[]Dependency`
|
||||||
|
- **Description**: Tasks to run before this task
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
# Simple dependencies
|
||||||
|
deploy:
|
||||||
|
deps: [build, test]
|
||||||
|
cmds:
|
||||||
|
- ./deploy.sh
|
||||||
|
|
||||||
|
# Dependencies with variables
|
||||||
|
advanced-deploy:
|
||||||
|
deps:
|
||||||
|
- task: build
|
||||||
|
vars:
|
||||||
|
ENVIRONMENT: production
|
||||||
|
- task: test
|
||||||
|
vars:
|
||||||
|
COVERAGE: true
|
||||||
|
cmds:
|
||||||
|
- ./deploy.sh
|
||||||
|
|
||||||
|
# Silent dependencies
|
||||||
|
main:
|
||||||
|
deps:
|
||||||
|
- task: setup
|
||||||
|
silent: true
|
||||||
|
cmds:
|
||||||
|
- echo "Main task"
|
||||||
|
|
||||||
|
# Loop dependencies
|
||||||
|
test-all:
|
||||||
|
deps:
|
||||||
|
- for: [unit, integration, e2e]
|
||||||
|
task: test
|
||||||
|
vars:
|
||||||
|
TEST_TYPE: '{{.ITEM}}'
|
||||||
|
cmds:
|
||||||
|
- echo "All tests completed"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `desc`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Short description shown in `--list`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
test:
|
||||||
|
desc: Run unit tests
|
||||||
|
cmds:
|
||||||
|
- go test ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `summary`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Detailed description shown in `--summary`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
deploy:
|
||||||
|
desc: Deploy to production
|
||||||
|
summary: |
|
||||||
|
Deploy the application to production environment.
|
||||||
|
This includes building, testing, and uploading artifacts.
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `prompt`
|
||||||
|
|
||||||
|
- **Type**: `string` or `[]string`
|
||||||
|
- **Description**: Prompts shown before task execution
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
deploy:
|
||||||
|
prompt: "Deploy to production?"
|
||||||
|
# or multiple prompts
|
||||||
|
prompt:
|
||||||
|
- "Are you sure?"
|
||||||
|
- "This will affect live users!"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `aliases`
|
||||||
|
|
||||||
|
- **Type**: `[]string`
|
||||||
|
- **Description**: Alternative names for the task
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
build:
|
||||||
|
aliases: [compile, make]
|
||||||
|
cmds:
|
||||||
|
- go build ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `sources`
|
||||||
|
|
||||||
|
- **Type**: `[]string` or `[]Glob`
|
||||||
|
- **Description**: Source files to monitor for changes
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
build:
|
||||||
|
sources:
|
||||||
|
- '**/*.go'
|
||||||
|
- go.mod
|
||||||
|
# With exclusions
|
||||||
|
- exclude: '**/*_test.go'
|
||||||
|
cmds:
|
||||||
|
- go build ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `generates`
|
||||||
|
|
||||||
|
- **Type**: `[]string` or `[]Glob`
|
||||||
|
- **Description**: Files generated by this task
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
build:
|
||||||
|
sources: ['**/*.go']
|
||||||
|
generates:
|
||||||
|
- './app'
|
||||||
|
- exclude: '*.debug'
|
||||||
|
cmds:
|
||||||
|
- go build -o app ./cmd
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `status`
|
||||||
|
|
||||||
|
- **Type**: `[]string`
|
||||||
|
- **Description**: Commands to check if task should run
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
install-deps:
|
||||||
|
status:
|
||||||
|
- test -f node_modules/.installed
|
||||||
|
cmds:
|
||||||
|
- npm install
|
||||||
|
- touch node_modules/.installed
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `preconditions`
|
||||||
|
|
||||||
|
- **Type**: `[]Precondition`
|
||||||
|
- **Description**: Conditions that must be met before running
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
# Simple precondition (shorthand)
|
||||||
|
build:
|
||||||
|
preconditions:
|
||||||
|
- test -f ./src
|
||||||
|
cmds:
|
||||||
|
- go build ./...
|
||||||
|
|
||||||
|
# Preconditions with custom messages
|
||||||
|
deploy:
|
||||||
|
preconditions:
|
||||||
|
- sh: test -n "$API_KEY"
|
||||||
|
msg: 'API_KEY environment variable is required'
|
||||||
|
- sh: test -f ./app
|
||||||
|
msg: "Application binary not found. Run 'task build' first."
|
||||||
|
cmds:
|
||||||
|
- ./deploy.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `requires`
|
||||||
|
|
||||||
|
- **Type**: `Requires`
|
||||||
|
- **Description**: Required variables with optional enums
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
# Simple requirements
|
||||||
|
deploy:
|
||||||
|
requires:
|
||||||
|
vars: [API_KEY, ENVIRONMENT]
|
||||||
|
cmds:
|
||||||
|
- ./deploy.sh
|
||||||
|
|
||||||
|
# Requirements with enum validation
|
||||||
|
advanced-deploy:
|
||||||
|
requires:
|
||||||
|
vars:
|
||||||
|
- API_KEY
|
||||||
|
- name: ENVIRONMENT
|
||||||
|
enum: [development, staging, production]
|
||||||
|
- name: LOG_LEVEL
|
||||||
|
enum: [debug, info, warn, error]
|
||||||
|
cmds:
|
||||||
|
- echo "Deploying to {{.ENVIRONMENT}} with log level {{.LOG_LEVEL}}"
|
||||||
|
- ./deploy.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `watch`
|
||||||
|
|
||||||
|
- **Type**: `bool`
|
||||||
|
- **Default**: `false`
|
||||||
|
- **Description**: Automatically run task in watch mode
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
dev:
|
||||||
|
watch: true
|
||||||
|
cmds:
|
||||||
|
- npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `platforms`
|
||||||
|
|
||||||
|
- **Type**: `[]string`
|
||||||
|
- **Description**: Platforms where this task should run
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
windows-build:
|
||||||
|
platforms: [windows]
|
||||||
|
cmds:
|
||||||
|
- go build -o app.exe ./cmd
|
||||||
|
|
||||||
|
unix-build:
|
||||||
|
platforms: [linux, darwin]
|
||||||
|
cmds:
|
||||||
|
- go build -o app ./cmd
|
||||||
|
```
|
||||||
|
|
||||||
|
## Command
|
||||||
|
|
||||||
|
Individual command configuration within a task.
|
||||||
|
|
||||||
|
### Basic Commands
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
example:
|
||||||
|
cmds:
|
||||||
|
- echo "Simple command"
|
||||||
|
- ls -la
|
||||||
|
```
|
||||||
|
|
||||||
|
### Command Object
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
example:
|
||||||
|
cmds:
|
||||||
|
- cmd: echo "Hello World"
|
||||||
|
silent: true
|
||||||
|
ignore_error: false
|
||||||
|
platforms: [linux, darwin]
|
||||||
|
set: [errexit]
|
||||||
|
shopt: [globstar]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Task References
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
example:
|
||||||
|
cmds:
|
||||||
|
- task: other-task
|
||||||
|
vars:
|
||||||
|
PARAM: value
|
||||||
|
silent: false
|
||||||
|
```
|
||||||
|
|
||||||
|
### Deferred Commands
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
with-cleanup:
|
||||||
|
cmds:
|
||||||
|
- echo "Starting work"
|
||||||
|
# Deferred command string
|
||||||
|
- defer: echo "Cleaning up"
|
||||||
|
# Deferred task reference
|
||||||
|
- defer:
|
||||||
|
task: cleanup-task
|
||||||
|
vars:
|
||||||
|
CLEANUP_MODE: full
|
||||||
|
```
|
||||||
|
|
||||||
|
### For Loops
|
||||||
|
|
||||||
|
#### Loop Over List
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
greet-all:
|
||||||
|
cmds:
|
||||||
|
- for: [alice, bob, charlie]
|
||||||
|
cmd: echo "Hello {{.ITEM}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Loop Over Sources/Generates
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
process-files:
|
||||||
|
sources: ['*.txt']
|
||||||
|
cmds:
|
||||||
|
- for: sources
|
||||||
|
cmd: wc -l {{.ITEM}}
|
||||||
|
- for: generates
|
||||||
|
cmd: gzip {{.ITEM}}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Loop Over Variable
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
process-items:
|
||||||
|
vars:
|
||||||
|
ITEMS: 'item1,item2,item3'
|
||||||
|
cmds:
|
||||||
|
- for:
|
||||||
|
var: ITEMS
|
||||||
|
split: ','
|
||||||
|
as: CURRENT
|
||||||
|
cmd: echo "Processing {{.CURRENT}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Loop Over Matrix
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
test-matrix:
|
||||||
|
cmds:
|
||||||
|
- for:
|
||||||
|
matrix:
|
||||||
|
OS: [linux, windows, darwin]
|
||||||
|
ARCH: [amd64, arm64]
|
||||||
|
cmd: echo "Testing {{.OS}}/{{.ARCH}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Loop in Dependencies
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
build-all:
|
||||||
|
deps:
|
||||||
|
- for: [frontend, backend, worker]
|
||||||
|
task: build
|
||||||
|
vars:
|
||||||
|
SERVICE: '{{.ITEM}}'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Shell Options
|
||||||
|
|
||||||
|
### Set Options
|
||||||
|
|
||||||
|
Available `set` options for POSIX shell features:
|
||||||
|
|
||||||
|
- `allexport` / `a` - Export all variables
|
||||||
|
- `errexit` / `e` - Exit on error
|
||||||
|
- `noexec` / `n` - Read commands but don't execute
|
||||||
|
- `noglob` / `f` - Disable pathname expansion
|
||||||
|
- `nounset` / `u` - Error on undefined variables
|
||||||
|
- `xtrace` / `x` - Print commands before execution
|
||||||
|
- `pipefail` - Pipe failures propagate
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Global level
|
||||||
|
set: [errexit, nounset, pipefail]
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
debug:
|
||||||
|
# Task level
|
||||||
|
set: [xtrace]
|
||||||
|
cmds:
|
||||||
|
- cmd: echo "This will be traced"
|
||||||
|
# Command level
|
||||||
|
set: [noexec]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Shopt Options
|
||||||
|
|
||||||
|
Available `shopt` options for Bash features:
|
||||||
|
|
||||||
|
- `expand_aliases` - Enable alias expansion
|
||||||
|
- `globstar` - Enable `**` recursive globbing
|
||||||
|
- `nullglob` - Null glob expansion
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Global level
|
||||||
|
shopt: [globstar]
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
find-files:
|
||||||
|
# Task level
|
||||||
|
shopt: [nullglob]
|
||||||
|
cmds:
|
||||||
|
- cmd: ls **/*.go
|
||||||
|
# Command level
|
||||||
|
shopt: [globstar]
|
||||||
|
```
|
781
website/src/docs/reference/templating.md
Normal file
@@ -0,0 +1,781 @@
|
|||||||
|
---
|
||||||
|
title: Templating Reference
|
||||||
|
description:
|
||||||
|
Comprehensive guide to Task's templating system with Go text/template, special
|
||||||
|
variables, and available functions
|
||||||
|
outline: deep
|
||||||
|
---
|
||||||
|
|
||||||
|
# Templating Reference
|
||||||
|
|
||||||
|
Task's templating engine uses Go's
|
||||||
|
[text/template](https://pkg.go.dev/text/template) package to interpolate values.
|
||||||
|
This reference covers the main features and all available functions for creating
|
||||||
|
dynamic Taskfiles.
|
||||||
|
|
||||||
|
## Basic Usage
|
||||||
|
|
||||||
|
Most string values in Task can be templated using double curly braces
|
||||||
|
<span v-pre>`{{` and `}}`</span>. Anything inside the braces is executed as a Go
|
||||||
|
template.
|
||||||
|
|
||||||
|
### Simple Variable Interpolation
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
hello:
|
||||||
|
vars:
|
||||||
|
MESSAGE: 'Hello, World!'
|
||||||
|
cmds:
|
||||||
|
- 'echo {{.MESSAGE}}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Output:**
|
||||||
|
|
||||||
|
```
|
||||||
|
Hello, World!
|
||||||
|
```
|
||||||
|
|
||||||
|
### Conditional Logic
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
maybe-happy:
|
||||||
|
vars:
|
||||||
|
SMILE: ':\)'
|
||||||
|
FROWN: ':\('
|
||||||
|
HAPPY: true
|
||||||
|
cmds:
|
||||||
|
- 'echo {{if .HAPPY}}{{.SMILE}}{{else}}{{.FROWN}}{{end}}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Output:**
|
||||||
|
|
||||||
|
```
|
||||||
|
:)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Function Calls and Pipes
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
uniq:
|
||||||
|
vars:
|
||||||
|
NUMBERS: '0,1,1,1,2,2,3'
|
||||||
|
cmds:
|
||||||
|
- 'echo {{splitList "," .NUMBERS | uniq | join ", "}}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Output:**
|
||||||
|
|
||||||
|
```
|
||||||
|
0, 1, 2, 3
|
||||||
|
```
|
||||||
|
|
||||||
|
### Control Flow with Loops
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
loop:
|
||||||
|
vars:
|
||||||
|
NUMBERS: [0, 1, 1, 1, 2, 2, 3]
|
||||||
|
cmds:
|
||||||
|
- |
|
||||||
|
{{range $index, $num := .NUMBERS}}
|
||||||
|
{{if gt $num 1}}{{break}}{{end}}
|
||||||
|
echo {{$index}}: {{$num}}
|
||||||
|
{{end}}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Output:**
|
||||||
|
|
||||||
|
```
|
||||||
|
0: 0
|
||||||
|
1: 1
|
||||||
|
2: 1
|
||||||
|
3: 1
|
||||||
|
```
|
||||||
|
|
||||||
|
## Special Variables
|
||||||
|
|
||||||
|
Task provides special variables that are always available in templates. These
|
||||||
|
override any user-defined variables with the same name.
|
||||||
|
|
||||||
|
### CLI
|
||||||
|
|
||||||
|
#### `CLI_ARGS`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: All extra arguments passed after `--` as a string
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
test:
|
||||||
|
cmds:
|
||||||
|
- go test {{.CLI_ARGS}}
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task test -- -v -race
|
||||||
|
# Runs: go test -v -race
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `CLI_ARGS_LIST`
|
||||||
|
|
||||||
|
- **Type**: `[]string`
|
||||||
|
- **Description**: All extra arguments passed after `--` as a shell parsed list
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
docker-run:
|
||||||
|
cmds:
|
||||||
|
- docker run {{range .CLI_ARGS_LIST}}{{.}} {{end}}myapp
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `CLI_FORCE`
|
||||||
|
|
||||||
|
- **Type**: `bool`
|
||||||
|
- **Description**: Whether `--force` or `--force-all` flags were set
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
deploy:
|
||||||
|
cmds:
|
||||||
|
- |
|
||||||
|
{{if .CLI_FORCE}}
|
||||||
|
echo "Force deployment enabled"
|
||||||
|
{{end}}
|
||||||
|
./deploy.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `CLI_SILENT`
|
||||||
|
|
||||||
|
- **Type**: `bool`
|
||||||
|
- **Description**: Whether `--silent` flag was set
|
||||||
|
|
||||||
|
#### `CLI_VERBOSE`
|
||||||
|
|
||||||
|
- **Type**: `bool`
|
||||||
|
- **Description**: Whether `--verbose` flag was set
|
||||||
|
|
||||||
|
#### `CLI_OFFLINE`
|
||||||
|
|
||||||
|
- **Type**: `bool`
|
||||||
|
- **Description**: Whether `--offline` flag was set
|
||||||
|
|
||||||
|
### Task
|
||||||
|
|
||||||
|
#### `TASK`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Name of the current task
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
build:
|
||||||
|
cmds:
|
||||||
|
- echo "Running task {{.TASK}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `ALIAS`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Alias used for the current task, otherwise matches `TASK`
|
||||||
|
|
||||||
|
#### `TASK_EXE`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Task executable name or path
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
self-update:
|
||||||
|
cmds:
|
||||||
|
- echo "Updating {{.TASK_EXE}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### File Paths
|
||||||
|
|
||||||
|
#### `ROOT_TASKFILE`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Absolute path of the root Taskfile
|
||||||
|
|
||||||
|
#### `ROOT_DIR`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Absolute path of the root Taskfile directory
|
||||||
|
|
||||||
|
#### `TASKFILE`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Absolute path of the current (included) Taskfile
|
||||||
|
|
||||||
|
#### `TASKFILE_DIR`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Absolute path of the current Taskfile directory
|
||||||
|
|
||||||
|
#### `TASK_DIR`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Absolute path where the task is executed
|
||||||
|
|
||||||
|
#### `USER_WORKING_DIR`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Absolute path where `task` was called from
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
info:
|
||||||
|
cmds:
|
||||||
|
- echo "Root {{.ROOT_DIR}}"
|
||||||
|
- echo "Current {{.TASKFILE_DIR}}"
|
||||||
|
- echo "Working {{.USER_WORKING_DIR}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Status
|
||||||
|
|
||||||
|
#### `CHECKSUM`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Checksum of files in `sources` (only in `status` with
|
||||||
|
`checksum` method)
|
||||||
|
|
||||||
|
#### `TIMESTAMP`
|
||||||
|
|
||||||
|
- **Type**: `time.Time`
|
||||||
|
- **Description**: Greatest timestamp of files in `sources` (only in `status`
|
||||||
|
with `timestamp` method)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
build:
|
||||||
|
method: checksum
|
||||||
|
sources: ['**/*.go']
|
||||||
|
status:
|
||||||
|
- test "{{.CHECKSUM}}" = "$(cat .last-checksum)"
|
||||||
|
cmds:
|
||||||
|
- go build ./...
|
||||||
|
- echo "{{.CHECKSUM}}" > .last-checksum
|
||||||
|
```
|
||||||
|
|
||||||
|
### Loop
|
||||||
|
|
||||||
|
#### `ITEM`
|
||||||
|
|
||||||
|
- **Type**: `any`
|
||||||
|
- **Description**: Current iteration value when using `for` property
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
greet:
|
||||||
|
cmds:
|
||||||
|
- for: [alice, bob, charlie]
|
||||||
|
cmd: echo "Hello {{.ITEM}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
Can be renamed using `as`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
greet:
|
||||||
|
cmds:
|
||||||
|
- for:
|
||||||
|
var: NAMES
|
||||||
|
as: NAME
|
||||||
|
cmd: echo "Hello {{.NAME}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Defer
|
||||||
|
|
||||||
|
#### `EXIT_CODE`
|
||||||
|
|
||||||
|
- **Type**: `int`
|
||||||
|
- **Description**: Failed command exit code (only in `defer`, only when
|
||||||
|
non-zero)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
deploy:
|
||||||
|
cmds:
|
||||||
|
- ./deploy.sh
|
||||||
|
- defer: |
|
||||||
|
{{if .EXIT_CODE}}
|
||||||
|
echo "Deployment failed with code {{.EXIT_CODE}}"
|
||||||
|
./rollback.sh
|
||||||
|
{{end}}
|
||||||
|
```
|
||||||
|
|
||||||
|
### System
|
||||||
|
|
||||||
|
#### `TASK_VERSION`
|
||||||
|
|
||||||
|
- **Type**: `string`
|
||||||
|
- **Description**: Current version of Task
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
version:
|
||||||
|
cmds:
|
||||||
|
- echo "Using Task {{.TASK_VERSION}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Available Functions
|
||||||
|
|
||||||
|
Task provides a comprehensive set of functions for templating. Functions can be chained using pipes (`|`) and combined for powerful templating capabilities.
|
||||||
|
|
||||||
|
### Logic and Control Flow
|
||||||
|
|
||||||
|
#### `and`, `or`, `not`
|
||||||
|
|
||||||
|
Boolean operations for conditional logic
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
conditional:
|
||||||
|
vars:
|
||||||
|
DEBUG: true
|
||||||
|
VERBOSE: false
|
||||||
|
PRODUCTION: false
|
||||||
|
cmds:
|
||||||
|
- echo "{{if and .DEBUG .VERBOSE}}Debug mode with verbose{{end}}"
|
||||||
|
- echo "{{if or .DEBUG .VERBOSE}}Some kind of debug{{end}}"
|
||||||
|
- echo "{{if not .PRODUCTION}}Development build{{end}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `eq`, `ne`, `lt`, `le`, `gt`, `ge`
|
||||||
|
|
||||||
|
Comparison operations
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
compare:
|
||||||
|
vars:
|
||||||
|
VERSION: 3
|
||||||
|
cmds:
|
||||||
|
- echo "{{if gt .VERSION 2}}Version 3 or higher{{end}}"
|
||||||
|
- echo "{{if eq .VERSION 3}}Exactly version 3{{end}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Data Access and Manipulation
|
||||||
|
|
||||||
|
#### `index`
|
||||||
|
|
||||||
|
Access array/map elements by index or key
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
access:
|
||||||
|
vars:
|
||||||
|
SERVICES: [api, web, worker]
|
||||||
|
CONFIG:
|
||||||
|
map:
|
||||||
|
database: postgres
|
||||||
|
port: 5432
|
||||||
|
cmds:
|
||||||
|
- echo "First service {{index .SERVICES 0}}"
|
||||||
|
- echo "Database {{index .CONFIG "database"}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `len`
|
||||||
|
|
||||||
|
Get length of arrays, maps, or strings
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
length:
|
||||||
|
vars:
|
||||||
|
ITEMS: [a, b, c, d]
|
||||||
|
TEXT: "Hello World"
|
||||||
|
cmds:
|
||||||
|
- echo "Found {{len .ITEMS}} items"
|
||||||
|
- echo "Text has {{len .TEXT}} characters"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `slice`
|
||||||
|
|
||||||
|
Extract a portion of an array or string
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
slice-demo:
|
||||||
|
vars:
|
||||||
|
ITEMS: [a, b, c, d, e]
|
||||||
|
cmds:
|
||||||
|
- echo "{{slice .ITEMS 1 3}}" # [b c]
|
||||||
|
```
|
||||||
|
|
||||||
|
### String Functions
|
||||||
|
|
||||||
|
#### Basic String Operations
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
string-basic:
|
||||||
|
vars:
|
||||||
|
MESSAGE: ' Hello World '
|
||||||
|
NAME: 'john doe'
|
||||||
|
TEXT: "Hello World"
|
||||||
|
cmds:
|
||||||
|
- echo "{{.MESSAGE | trim}}" # "Hello World"
|
||||||
|
- echo "{{.NAME | title}}" # "John Doe"
|
||||||
|
- echo "{{.NAME | upper}}" # "JOHN DOE"
|
||||||
|
- echo "{{.MESSAGE | lower}}" # "hello world"
|
||||||
|
- echo "{{.NAME | trunc 4}}" # "john"
|
||||||
|
- echo "{{"test" | repeat 3}}" # "testtesttest"
|
||||||
|
- echo "{{substr .TEXT 0 5}}" # "Hello"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### String Testing and Searching
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
string-test:
|
||||||
|
vars:
|
||||||
|
FILENAME: 'app.tar.gz'
|
||||||
|
EMAIL: 'user@example.com'
|
||||||
|
cmds:
|
||||||
|
- echo "{{.FILENAME | hasPrefix "app"}}" # true
|
||||||
|
- echo "{{.FILENAME | hasSuffix ".gz"}}" # true
|
||||||
|
- echo "{{.EMAIL | contains "@"}}" # true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### String Replacement and Formatting
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
string-format:
|
||||||
|
vars:
|
||||||
|
TEXT: 'Hello, World!'
|
||||||
|
UNSAFE: 'file with spaces.txt'
|
||||||
|
cmds:
|
||||||
|
- echo "{{.TEXT | replace "," ""}}" # "Hello World!"
|
||||||
|
- echo "{{.TEXT | quote}}" # "\"Hello, World!\""
|
||||||
|
- echo "{{.UNSAFE | shellQuote}}" # Shell-safe quoting
|
||||||
|
- echo "{{.UNSAFE | q}}" # Short alias for shellQuote
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Regular Expressions
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
regex:
|
||||||
|
vars:
|
||||||
|
EMAIL: 'user@example.com'
|
||||||
|
TEXT: 'abc123def456'
|
||||||
|
cmds:
|
||||||
|
- echo "{{regexMatch "@" .EMAIL}}" # true
|
||||||
|
- echo "{{regexFind "[0-9]+" .TEXT}}" # "123"
|
||||||
|
- echo "{{regexFindAll "[0-9]+" .TEXT -1}}" # ["123", "456"]
|
||||||
|
- echo "{{regexReplaceAll "[0-9]+" .TEXT "X"}}" # "abcXdefX"
|
||||||
|
```
|
||||||
|
|
||||||
|
### List Functions
|
||||||
|
|
||||||
|
#### List Access and Basic Operations
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
list-basic:
|
||||||
|
vars:
|
||||||
|
ITEMS: ["apple", "banana", "cherry", "date"]
|
||||||
|
cmds:
|
||||||
|
- echo "First {{.ITEMS | first}}" # "apple"
|
||||||
|
- echo "Last {{.ITEMS | last}}" # "date"
|
||||||
|
- echo "Rest {{.ITEMS | rest}}" # ["banana", "cherry", "date"]
|
||||||
|
- echo "Initial {{.ITEMS | initial}}" # ["apple", "banana", "cherry"]
|
||||||
|
- echo "Length {{.ITEMS | len}}" # 4
|
||||||
|
```
|
||||||
|
|
||||||
|
#### List Manipulation
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
list-manipulate:
|
||||||
|
vars:
|
||||||
|
NUMBERS: [3, 1, 4, 1, 5, 9, 1]
|
||||||
|
FRUITS: ["apple", "banana"]
|
||||||
|
cmds:
|
||||||
|
- echo "{{.NUMBERS | uniq}}" # [3, 1, 4, 5, 9]
|
||||||
|
- echo "{{.NUMBERS | sortAlpha}}" # [1, 1, 1, 3, 4, 5, 9]
|
||||||
|
- echo"'{{append .FRUITS "cherry"}}"" # ["apple", "banana", "cherry"]
|
||||||
|
- echo "{{ without .NUMBERS 1}}" # [3, 4, 5, 9]
|
||||||
|
- echo "{{.NUMBERS | has 5}}" # true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### String Lists
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
string-lists:
|
||||||
|
vars:
|
||||||
|
CSV: 'apple,banana,cherry'
|
||||||
|
WORDS: ['hello', 'world', 'from', 'task']
|
||||||
|
MULTILINE: |
|
||||||
|
line1
|
||||||
|
line2
|
||||||
|
line3
|
||||||
|
cmds:
|
||||||
|
- echo "{{.CSV | splitList ","}}" # ["apple", "banana", "cherry"]
|
||||||
|
- echo "{{.WORDS | join " "}}" # "hello world from task"
|
||||||
|
- echo "{{.WORDS | sortAlpha}}" # ["from", "hello", "task", "world"]
|
||||||
|
- echo "{{.MULTILINE | splitLines}}" # Split on newlines (Unix/Windows)
|
||||||
|
- echo "{{.MULTILINE | catLines}}" # Replace newlines with spaces
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Shell Argument Parsing
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
shell-args:
|
||||||
|
vars:
|
||||||
|
ARGS: 'file1.txt -v --output="result file.txt"'
|
||||||
|
cmds:
|
||||||
|
- |
|
||||||
|
{{range .ARGS | splitArgs}}
|
||||||
|
echo "Arg: {{.}}"
|
||||||
|
{{end}}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Math Functions
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
math:
|
||||||
|
vars:
|
||||||
|
A: 10
|
||||||
|
B: 3
|
||||||
|
NUMBERS: [1, 5, 3, 9, 2]
|
||||||
|
cmds:
|
||||||
|
- echo "Addition {{add .A .B}}" # 13
|
||||||
|
- echo "Subtraction {{sub .A .B}}" # 7
|
||||||
|
- echo "Multiplication {{mul .A .B}}" # 30
|
||||||
|
- echo "Division {{div .A .B}}" # 3
|
||||||
|
- echo "Modulo {{mod .A .B}}" # 1
|
||||||
|
- echo "Maximum {{.NUMBERS | max}}" # 9
|
||||||
|
- echo "Minimum {{.NUMBERS | min}}" # 1
|
||||||
|
- echo "Random 1-99 {{randInt 1 100}}" # Random number
|
||||||
|
- echo "Random 0-999 {{randIntN 1000}}" # Random number 0-999
|
||||||
|
```
|
||||||
|
|
||||||
|
### Date and Time Functions
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
date-time:
|
||||||
|
vars:
|
||||||
|
BUILD_DATE: "2023-12-25"
|
||||||
|
cmds:
|
||||||
|
- echo "Now {{now | date "2006-01-02 15:04:05"}}"
|
||||||
|
- echo {{ toDate "2006-01-02" .BUILD_DATE }}
|
||||||
|
- echo "Build {{.BUILD_DATE | toDate "2006-01-02" | date "Jan 2, 2006"}}"
|
||||||
|
- echo "Unix timestamp {{now | unixEpoch}}"
|
||||||
|
- echo "Duration ago {{now | ago}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### System Functions
|
||||||
|
|
||||||
|
#### Platform Information
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
platform:
|
||||||
|
cmds:
|
||||||
|
- echo "OS {{OS}}" # linux, darwin, windows, etc.
|
||||||
|
- echo "Architecture {{ARCH}}" # amd64, arm64, etc.
|
||||||
|
- echo "CPU cores {{numCPU}}" # Number of CPU cores
|
||||||
|
- echo "Building for {{OS}}/{{ARCH}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Path Functions
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
paths:
|
||||||
|
vars:
|
||||||
|
WIN_PATH: 'C:\Users\name\file.txt'
|
||||||
|
OUTPUT_DIR: 'dist'
|
||||||
|
BINARY_NAME: 'myapp'
|
||||||
|
cmds:
|
||||||
|
- echo "{{.WIN_PATH | toSlash}}" # Convert to forward slashes
|
||||||
|
- echo "{{.WIN_PATH | fromSlash}}" # Convert to OS-specific slashes
|
||||||
|
- echo "{{joinPath .OUTPUT_DIR .BINARY_NAME}}" # Join path elements
|
||||||
|
- echo "Relative {{relPath .ROOT_DIR .TASKFILE_DIR}}" # Get relative path
|
||||||
|
```
|
||||||
|
|
||||||
|
### Data Structure Functions
|
||||||
|
|
||||||
|
#### Dictionary Operations
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
dict:
|
||||||
|
vars:
|
||||||
|
CONFIG:
|
||||||
|
map:
|
||||||
|
database: postgres
|
||||||
|
port: 5432
|
||||||
|
ssl: true
|
||||||
|
cmds:
|
||||||
|
- echo "Database {{.CONFIG | get "database"}}"
|
||||||
|
- echo "Keys {{.CONFIG | keys}}"
|
||||||
|
- echo "Has SSL {{.CONFIG | hasKey "ssl"}}"
|
||||||
|
- echo "{{dict "env" "prod" "debug" false}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Merging and Combining
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
merge:
|
||||||
|
vars:
|
||||||
|
BASE_CONFIG:
|
||||||
|
map:
|
||||||
|
timeout: 30
|
||||||
|
retries: 3
|
||||||
|
USER_CONFIG:
|
||||||
|
map:
|
||||||
|
timeout: 60
|
||||||
|
debug: true
|
||||||
|
cmds:
|
||||||
|
- echo "{{merge .BASE_CONFIG .USER_CONFIG | toJson}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Default Values and Coalescing
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
defaults:
|
||||||
|
vars:
|
||||||
|
API_URL: ""
|
||||||
|
DEBUG: false
|
||||||
|
ITEMS: []
|
||||||
|
cmds:
|
||||||
|
- echo "{{.API_URL | default "http://localhost:8080"}}"
|
||||||
|
- echo "{{.DEBUG | default true}}"
|
||||||
|
- echo "{{.MISSING_VAR | default "fallback"}}"
|
||||||
|
- echo "{{coalesce .API_URL .FALLBACK_URL "default"}}"
|
||||||
|
- echo "Is empty {{empty .ITEMS}}" # true
|
||||||
|
```
|
||||||
|
|
||||||
|
### Encoding and Serialization
|
||||||
|
|
||||||
|
#### JSON
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
json:
|
||||||
|
vars:
|
||||||
|
DATA:
|
||||||
|
map:
|
||||||
|
name: 'Task'
|
||||||
|
version: '3.0'
|
||||||
|
JSON_STRING: '{"key": "value", "number": 42}'
|
||||||
|
cmds:
|
||||||
|
- echo "{{.DATA | toJson}}"
|
||||||
|
- echo "{{.DATA | toPrettyJson}}"
|
||||||
|
- echo "{{.JSON_STRING | fromJson }}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### YAML
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
yaml:
|
||||||
|
vars:
|
||||||
|
CONFIG:
|
||||||
|
map:
|
||||||
|
database:
|
||||||
|
host: localhost
|
||||||
|
port: 5432
|
||||||
|
YAML_STRING: |
|
||||||
|
key: value
|
||||||
|
items:
|
||||||
|
- one
|
||||||
|
- two
|
||||||
|
cmds:
|
||||||
|
- echo "{{.CONFIG | toYaml}}"
|
||||||
|
- echo "{{.YAML_STRING | fromYaml}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Base64
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
base64:
|
||||||
|
vars:
|
||||||
|
SECRET: 'my-secret-key'
|
||||||
|
cmds:
|
||||||
|
- echo "{{.SECRET | b64enc}}" # Encode to base64
|
||||||
|
- echo "{{"bXktc2VjcmV0LWtleQ==" | b64dec}}" # Decode from base64
|
||||||
|
```
|
||||||
|
|
||||||
|
### Type Conversion
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
convert:
|
||||||
|
vars:
|
||||||
|
NUM_STR: '42'
|
||||||
|
FLOAT_STR: '3.14'
|
||||||
|
BOOL_STR: 'true'
|
||||||
|
ITEMS: [1, 2, 3]
|
||||||
|
cmds:
|
||||||
|
- echo "{{.NUM_STR | atoi | add 8}}" # String to int: 50
|
||||||
|
- echo "{{.FLOAT_STR | float64}}" # String to float: 3.14
|
||||||
|
- echo "{{.ITEMS | toStrings}}" # Convert to strings: ["1", "2", "3"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Utility Functions
|
||||||
|
|
||||||
|
#### UUID Generation
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
generate:
|
||||||
|
vars:
|
||||||
|
DEPLOYMENT_ID: "{{uuid}}"
|
||||||
|
cmds:
|
||||||
|
- echo "Deployment ID {{.DEPLOYMENT_ID}}"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Debugging
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
debug:
|
||||||
|
vars:
|
||||||
|
COMPLEX_VAR:
|
||||||
|
map:
|
||||||
|
items: [1, 2, 3]
|
||||||
|
nested:
|
||||||
|
key: value
|
||||||
|
cmds:
|
||||||
|
- echo "{{spew .COMPLEX_VAR}}" # Pretty-print for debugging
|
||||||
|
```
|
||||||
|
|
||||||
|
### Output Functions
|
||||||
|
|
||||||
|
#### Formatted Output
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tasks:
|
||||||
|
output:
|
||||||
|
vars:
|
||||||
|
VERSION: "1.2.3"
|
||||||
|
BUILD: 42
|
||||||
|
cmds:
|
||||||
|
- echo '{{print "Simple output"}}'
|
||||||
|
- echo '{{printf "Version %s.%d" .VERSION .BUILD}}'
|
||||||
|
- echo '{{println "With newline"}}'
|
||||||
|
```
|
@@ -1,6 +1,9 @@
|
|||||||
---
|
---
|
||||||
slug: /releasing/
|
title: Releasing
|
||||||
sidebar_position: 13
|
description:
|
||||||
|
Task release process including GoReleaser, Homebrew, npm, Snapcraft, winget,
|
||||||
|
and other package managers
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Releasing
|
# Releasing
|
||||||
@@ -17,18 +20,18 @@ Since v3.15.0, raw executables can also be reproduced and verified locally by
|
|||||||
checking out a specific tag and calling `goreleaser build`, using the Go version
|
checking out a specific tag and calling `goreleaser build`, using the Go version
|
||||||
defined in the above GitHub Actions.
|
defined in the above GitHub Actions.
|
||||||
|
|
||||||
# Homebrew
|
## Homebrew
|
||||||
|
|
||||||
Goreleaser will automatically push a new commit to the
|
Goreleaser will automatically push a new commit to the
|
||||||
[Formula/go-task.rb][gotaskrb] file in the [Homebrew tap][homebrewtap]
|
[Formula/go-task.rb][gotaskrb] file in the [Homebrew tap][homebrewtap]
|
||||||
repository to release the new version.
|
repository to release the new version.
|
||||||
|
|
||||||
# npm
|
## npm
|
||||||
|
|
||||||
To release to npm update the version in the [`package.json`][packagejson] file
|
To release to npm update the version in the [`package.json`][packagejson] file
|
||||||
and then run `task npm:publish` to push it.
|
and then run `task npm:publish` to push it.
|
||||||
|
|
||||||
# Snapcraft
|
## Snapcraft
|
||||||
|
|
||||||
The [snap package][snappackage] requires to manual steps to release a new
|
The [snap package][snappackage] requires to manual steps to release a new
|
||||||
version:
|
version:
|
||||||
@@ -37,7 +40,7 @@ version:
|
|||||||
- Moving both `amd64`, `armhf` and `arm64` new artifacts to the stable channel
|
- Moving both `amd64`, `armhf` and `arm64` new artifacts to the stable channel
|
||||||
on the [Snapcraft dashboard][snapcraftdashboard].
|
on the [Snapcraft dashboard][snapcraftdashboard].
|
||||||
|
|
||||||
# winget
|
## winget
|
||||||
|
|
||||||
winget also requires manual steps to be completed. By running
|
winget also requires manual steps to be completed. By running
|
||||||
`task goreleaser:test` locally, manifest files will be generated on
|
`task goreleaser:test` locally, manifest files will be generated on
|
||||||
@@ -46,7 +49,7 @@ winget also requires manual steps to be completed. By running
|
|||||||
and open a pull request into
|
and open a pull request into
|
||||||
[this repository](https://github.com/microsoft/winget-pkgs).
|
[this repository](https://github.com/microsoft/winget-pkgs).
|
||||||
|
|
||||||
# Scoop
|
## Scoop
|
||||||
|
|
||||||
Scoop is a command-line package manager for the Windows operating system. Scoop
|
Scoop is a command-line package manager for the Windows operating system. Scoop
|
||||||
package manifests are maintained by the community. Scoop owners usually take
|
package manifests are maintained by the community. Scoop owners usually take
|
||||||
@@ -54,19 +57,18 @@ care of updating versions there by editing
|
|||||||
[this file](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json).
|
[this file](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json).
|
||||||
If you think its Task version is outdated, open an issue to let us know.
|
If you think its Task version is outdated, open an issue to let us know.
|
||||||
|
|
||||||
# Nix
|
## Nix
|
||||||
|
|
||||||
Nix is a community owned installation method. Nix package maintainers usually
|
Nix is a community owned installation method. Nix package maintainers usually
|
||||||
take care of updating versions there by editing
|
take care of updating versions there by editing
|
||||||
[this file](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/go/go-task/package.nix).
|
[this file](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/go/go-task/package.nix).
|
||||||
If you think its Task version is outdated, open an issue to let us know.
|
If you think its Task version is outdated, open an issue to let us know.
|
||||||
|
|
||||||
{/* prettier-ignore-start */}
|
|
||||||
[goreleaser]: https://goreleaser.com/
|
[goreleaser]: https://goreleaser.com/
|
||||||
[homebrewtap]: https://github.com/go-task/homebrew-tap
|
[homebrewtap]: https://github.com/go-task/homebrew-tap
|
||||||
[gotaskrb]: https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb
|
[gotaskrb]: https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb
|
||||||
[packagejson]: https://github.com/go-task/task/blob/main/package.json#L3
|
[packagejson]: https://github.com/go-task/task/blob/main/package.json#L3
|
||||||
[snappackage]: https://github.com/go-task/snap
|
[snappackage]: https://github.com/go-task/snap
|
||||||
[snapcraftyaml]: https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml#L2
|
[snapcraftyaml]:
|
||||||
|
https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml#L2
|
||||||
[snapcraftdashboard]: https://snapcraft.io/task/releases
|
[snapcraftdashboard]: https://snapcraft.io/task/releases
|
||||||
{/* prettier-ignore-end */}
|
|
@@ -1,6 +1,9 @@
|
|||||||
---
|
---
|
||||||
slug: /styleguide/
|
title: Style Guide
|
||||||
sidebar_position: 11
|
description:
|
||||||
|
Official style guide for Taskfile.yml files with best practices and
|
||||||
|
recommended conventions
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Style Guide
|
# Style Guide
|
@@ -1,6 +1,9 @@
|
|||||||
---
|
---
|
||||||
slug: /taskfile-versions/
|
title: Taskfile Versions
|
||||||
sidebar_position: 6
|
description:
|
||||||
|
How to use the Taskfile schema version to ensure users are using the correct
|
||||||
|
versions of Task
|
||||||
|
outline: deep
|
||||||
---
|
---
|
||||||
|
|
||||||
# Taskfile Versions
|
# Taskfile Versions
|
66
website/src/donate.md
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
---
|
||||||
|
title: Donate
|
||||||
|
layout: doc
|
||||||
|
outline: false
|
||||||
|
---
|
||||||
|
|
||||||
|
# :pray: Support Taskfile
|
||||||
|
|
||||||
|
If you find this project useful, consider supporting its ongoing development.
|
||||||
|
|
||||||
|
> This is just a way to say **“thank you”** — donations won’t provide priority
|
||||||
|
> support or special privileges.
|
||||||
|
|
||||||
|
## :trophy: Gold Sponsorship
|
||||||
|
|
||||||
|
Companies donating **$50/month or more** can become a **Gold Sponsor**, featured
|
||||||
|
on:
|
||||||
|
|
||||||
|
- The website homepage
|
||||||
|
- The GitHub repository README
|
||||||
|
|
||||||
|
> 💬 To be featured, contact @andreynering with your logo.
|
||||||
|
>
|
||||||
|
> ⚠️ Suspicious or inappropriate businesses (e.g. gambling, casinos) will be
|
||||||
|
> rejected.
|
||||||
|
|
||||||
|
## :heart: GitHub Sponsors _(recommended)_
|
||||||
|
|
||||||
|
The preferred way to donate is through **GitHub Sponsors**. We suggest splitting
|
||||||
|
your donation equally between maintainers:
|
||||||
|
|
||||||
|
<div style="display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0;">
|
||||||
|
<a href="https://github.com/sponsors/andreynering" target="_blank">
|
||||||
|
<img src="https://img.shields.io/badge/@andreynering-30363d?logo=github&logoColor=white&style=for-the-badge" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/sponsors/pd93" target="_blank">
|
||||||
|
<img src="https://img.shields.io/badge/@pd93-30363d?logo=github&logoColor=white&style=for-the-badge" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/sponsors/vmaerten" target="_blank">
|
||||||
|
<img src="https://img.shields.io/badge/@vmaerten-30363d?logo=github&logoColor=white&style=for-the-badge" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## :globe_with_meridians: Open Collective
|
||||||
|
|
||||||
|
Prefer **Open Collective**? Choose a tier:
|
||||||
|
|
||||||
|
- [$2/month](https://opencollective.com/task/contribute/backer-4034/checkout)
|
||||||
|
- [$5/month](https://opencollective.com/task/contribute/supporter-8404/checkout)
|
||||||
|
- [$20/month](https://opencollective.com/task/contribute/sponsor-4035/checkout)
|
||||||
|
- [$50/month](https://opencollective.com/task/contribute/sponsor-28775/checkout)
|
||||||
|
- [🎯 Custom / One-time](https://opencollective.com/task/donate)
|
||||||
|
|
||||||
|
## :credit_card: PayPal
|
||||||
|
|
||||||
|
You can also make a **one-time donation** to @andreynering via PayPal:
|
||||||
|
|
||||||
|
[Donate via PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GSVDU63RKG45A¤cy_code=USD&source=url)
|
||||||
|
|
||||||
|
## :brazil: PIX (Brazil only)
|
||||||
|
|
||||||
|
If you're in Brazil, you can also support @andreynering via PIX:
|
||||||
|
|
||||||
|
<img src="/img/pix.png" width="200" height="200" alt="PIX QR Code" />
|
||||||
|
|
||||||
|
Thank you for helping Taskfile grow and stay maintained! 💚
|
48
website/src/index.md
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
---
|
||||||
|
layout: home
|
||||||
|
hero:
|
||||||
|
name: Task
|
||||||
|
text: The Modern Task Runner
|
||||||
|
tagline:
|
||||||
|
A fast, cross-platform build tool inspired by Make, designed for modern
|
||||||
|
workflows.
|
||||||
|
image:
|
||||||
|
src: /img/logo.png
|
||||||
|
alt: Task logo
|
||||||
|
actions:
|
||||||
|
- theme: brand
|
||||||
|
text: Install
|
||||||
|
link: /docs/installation
|
||||||
|
- theme: alt
|
||||||
|
text: Get Started
|
||||||
|
link: /docs/getting-started
|
||||||
|
- theme: alt
|
||||||
|
text: Guide
|
||||||
|
link: /docs/guide
|
||||||
|
|
||||||
|
features:
|
||||||
|
- title: 30-Second Setup
|
||||||
|
details:
|
||||||
|
Single binary download, zero dependencies. Works with Homebrew, Snapcraft,
|
||||||
|
Scoop and more.
|
||||||
|
icon: 🚀
|
||||||
|
|
||||||
|
- title: Truly cross-platform
|
||||||
|
icon: 🖥️
|
||||||
|
details:
|
||||||
|
Run the same Taskfile on Linux, macOS and Windows. No extra setup. Task
|
||||||
|
handles platform quirks so you don’t have to.
|
||||||
|
|
||||||
|
- title: Smart Caching
|
||||||
|
icon: 🎯
|
||||||
|
details:
|
||||||
|
Skip unnecessary rebuilds by tracking file changes (timestamp or
|
||||||
|
content-based).
|
||||||
|
|
||||||
|
- title: Ideal for code generation & scaffolding
|
||||||
|
icon: ⚡
|
||||||
|
details:
|
||||||
|
Use Task to wire up codegen tools, formatters, linters, or anything
|
||||||
|
repetitive. Chain commands, set dependencies, and keep your workflow
|
||||||
|
clean.
|
||||||
|
---
|
@@ -1,53 +0,0 @@
|
|||||||
---
|
|
||||||
slug: /donate/
|
|
||||||
hide_table_of_contents: true
|
|
||||||
---
|
|
||||||
|
|
||||||
# Donate
|
|
||||||
|
|
||||||
If you find this project useful, you can consider donating by using one of the
|
|
||||||
channels listed below.
|
|
||||||
|
|
||||||
This is just a way of saying "thank you", it won't give you any benefits like
|
|
||||||
higher priority on issues or something similar.
|
|
||||||
|
|
||||||
Companies who donate at least $50/month will be featured as a "Gold Sponsor" in
|
|
||||||
the website homepage and on the GitHub repository README. Make contact with
|
|
||||||
[@andreynering] with the logo you want to be shown. Suspect businesses
|
|
||||||
(gambling, casinos, etc) won't be allowed, though.
|
|
||||||
|
|
||||||
## GitHub Sponsors
|
|
||||||
|
|
||||||
The preferred way to donate to the maintainers is via GitHub Sponsors. Just use
|
|
||||||
the following links to do your donation. We suggest a equal weight split to each
|
|
||||||
maintainer of the total amount you plan to donate to the project.
|
|
||||||
|
|
||||||
- [@andreynering](https://github.com/sponsors/andreynering)
|
|
||||||
- [@pd93](https://github.com/sponsors/pd93)
|
|
||||||
- [@vmaerten](https://github.com/sponsors/vmaerten)
|
|
||||||
|
|
||||||
## Open Collective
|
|
||||||
|
|
||||||
If you prefer [Open Collective](https://opencollective.com/task) you can donate
|
|
||||||
by using these links:
|
|
||||||
|
|
||||||
- [$2 per month](https://opencollective.com/task/contribute/backer-4034/checkout)
|
|
||||||
- [$5 per month](https://opencollective.com/task/contribute/supporter-8404/checkout)
|
|
||||||
- [$20 per month](https://opencollective.com/task/contribute/sponsor-4035/checkout)
|
|
||||||
- [$50 per month](https://opencollective.com/task/contribute/sponsor-28775/checkout)
|
|
||||||
- [Custom value - One-time donation option supported](https://opencollective.com/task/donate)
|
|
||||||
|
|
||||||
## PayPal
|
|
||||||
|
|
||||||
You can donate to [@andreynering] via PayPal as well:
|
|
||||||
|
|
||||||
- [Any value - One-time donation](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GSVDU63RKG45A¤cy_code=USD&source=url)
|
|
||||||
|
|
||||||
## PIX (Brazil only)
|
|
||||||
|
|
||||||
And if you're Brazilian, you can also donate to [@andreynering] via PIX by
|
|
||||||
[using this QR Code](/img/pix.png).
|
|
||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
|
||||||
[@andreynering]: https://github.com/andreynering
|
|
||||||
<!-- prettier-ignore-end -->
|
|
20
website/src/public/_redirects
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Redirect specific docs pages
|
||||||
|
/changelog /docs/changelog
|
||||||
|
/community /docs/community
|
||||||
|
/contributing /docs/contributing
|
||||||
|
/faq /docs/faq
|
||||||
|
/getting-started /docs/getting-started
|
||||||
|
/installation /docs/installation
|
||||||
|
/integrations /docs/integrations
|
||||||
|
/releasing /docs/releasing
|
||||||
|
/styleguide /docs/styleguide
|
||||||
|
/taskfile-versions /docs/taskfile-versions
|
||||||
|
/usage /docs/guide
|
||||||
|
|
||||||
|
# Redirect some group docs pages
|
||||||
|
/deprecations/* /docs/deprecations/:splat
|
||||||
|
/experiments/* /docs/experiments:splat
|
||||||
|
/reference/* /docs/reference/:splat
|
||||||
|
|
||||||
|
# Redirect root /docs to something useful
|
||||||
|
/docs /docs/guide
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |
1
website/src/public/img/flag-brazil.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#009B3A" d="M36 27a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V9a4 4 0 0 1 4-4h28a4 4 0 0 1 4 4z"/><path fill="#FEDF01" d="M32.728 18 18 29.124 3.272 18 18 6.875z"/><circle cx="17.976" cy="17.924" r="6.458" fill="#002776"/><path fill="#CBE9D4" d="M12.277 14.887a6.4 6.4 0 0 0-.672 2.023c3.995-.29 9.417 1.891 11.744 4.595.402-.604.7-1.28.883-2.004-2.872-2.808-7.917-4.63-11.955-4.614"/><path fill="#88C9F9" d="M12 18.233h1v1h-1zm1 2h1v1h-1z"/><path fill="#55ACEE" d="M15 18.233h1v1h-1zm2 1h1v1h-1zm4 2h1v1h-1zm-3 1h1v1h-1zm3-6h1v1h-1z"/><path fill="#3B88C3" d="M19 20.233h1v1h-1z"/></svg>
|
After Width: | Height: | Size: 646 B |
1
website/src/public/img/flag-france.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#ED2939" d="M36 27a4 4 0 0 1-4 4h-8V5h8a4 4 0 0 1 4 4z"/><path fill="#002495" d="M4 5a4 4 0 0 0-4 4v18a4 4 0 0 0 4 4h8V5z"/><path fill="#EEE" d="M12 5h12v26H12z"/></svg>
|
After Width: | Height: | Size: 241 B |
1
website/src/public/img/flag-wales.svg
Normal file
After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 435 B After Width: | Height: | Size: 435 B |
Before Width: | Height: | Size: 360 B After Width: | Height: | Size: 360 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |