Skip to content

Commit 218049f

Browse files
committed
migrated documentation to Hugo
1 parent 33d1277 commit 218049f

File tree

260 files changed

+4537
-1194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+4537
-1194
lines changed

.github/workflows/build-docs.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and deploy docs
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- docs
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
jobs:
12+
docs:
13+
name: Build and deploy docs
14+
runs-on: ubuntu-22.04
15+
environment:
16+
name: github-pages
17+
url: ${{ steps.deployment.outputs.page_url }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Markdown Lint
23+
run: |
24+
cd docs
25+
npx markdownlint-cli content/
26+
27+
- name: Build with Hugo
28+
run: |
29+
pwd
30+
curl -sL https://github.com/gohugoio/hugo/releases/download/v0.101.0/hugo_0.101.0_Linux-64bit.tar.gz|tar xzf - hugo
31+
mv hugo ~/
32+
~/hugo --version||true
33+
cd docs
34+
test -e public||mkdir public
35+
~/hugo --minify
36+
find public
37+
38+
- name: Setup Pages
39+
uses: actions/configure-pages@v1
40+
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v1
43+
with:
44+
path: './docs/public'
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@main

.github/workflows/lint-docs.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Lint docs
2+
on: [push]
3+
jobs:
4+
docs:
5+
name: Lint docs
6+
runs-on: ubuntu-22.04
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v2
10+
11+
- name: Markdown Lint
12+
run: |
13+
cd docs
14+
npx markdownlint-cli content/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
/bin
44
/dist
55

6+
# hugo
7+
docs/public
8+
docs/.hugo_build.lock

README.md

Lines changed: 57 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,46 @@
1-
[![Coverage Status](https://coveralls.io/repos/github/cloudradar-monitoring/tacoscript/badge.svg)](https://coveralls.io/github/cloudradar-monitoring/tacoscript)
2-
[![Actions Status](https://github.com/cloudradar-monitoring/tacoscript/workflows/Go/badge.svg)](https://github.com/cloudradar-monitoring/tacoscript/actions)
3-
4-
![](logo.svg)
1+
<!-- markdownlint-disable -->
52
## Overview
6-
Tacoscript library provides functionality for provisioning of remote servers and local machines running on any OS. Tacoscript can be installed as a binary. Therefore it doesn't require any additional tools or programs on the host system.
7-
8-
Tacoscript can manage host systems from simple yaml files written in a [Salt Project](https://saltproject.io/) inspired configuration language.
9-
10-
Why do we need another provisioning tool? Unfortunately, the next competitors like Puppet, Ansible, or Salt have limited support for Windows. And they require the installation of additional dependencies, which is not always convenient.
11-
12-
Tacoscript is written in GO, so it is provided as an executable static binary for a big variety of host OS and platforms, and it requires no additional tools to be installed in the host system. You can find the list of supported OS and architectures [here](https://golang.org/doc/install/source#environment).
13-
14-
## Installation
15-
16-
### As a compiled binary
3+
<!-- markdownlint-restore -->
174

18-
Jump to [our release page](https://github.com/cloudradar-monitoring/tacoscript/releases/tag/latest) and download a binary for your host OS. Don't forget to download a corresponding md5 file as well and compare the checksums.
5+
![Logo](https://raw.githubusercontent.com/cloudradar-monitoring/tacoscript/master/logo.svg)
196

20-
#### On MacOS
21-
wget https://github.com/cloudradar-monitoring/tacoscript/releases/download/latest/tacoscript-latest-darwin-amd64.tar.gz
22-
tar xzf tacoscript-latest-darwin-amd64.tar.gz -C /usr/local/bin/ tacoscript
23-
24-
#### On linux
25-
wget https://github.com/cloudradar-monitoring/tacoscript/releases/download/latest/tacoscript-latest-linux-amd64.tar.gz
26-
tar xzf tacoscript-latest-linux-amd64.tar.gz -C /usr/local/bin/ tacoscript
7+
Tacoscript is a command line tool for the automation of tasks, the management of the operating system and applications.
8+
It can be installed as a single dependency-free binary. It doesn't require any scripting languages. Any Unix/Linux and
9+
Microsoft Windows are supported equally.
2710

28-
#### On Windows
29-
iwr https://github.com/cloudradar-monitoring/tacoscript/releases/download/latest/tacoscript-latest-windows-amd64.zip `
30-
-OutFile tacoscript-latest-windows-amd64.zip
31-
$dest = "C:\Program Files\tacoscript"
32-
mkdir $dest
33-
mkdir "$($dest)\bin"
34-
Expand-Archive -Path $file -DestinationPath $dest -force
35-
mv "$($dest)\tacoscript.exe" "$($dest)\bin"
11+
Tacoscript can manage host systems from simple yaml files written in a [Salt Project](https://saltproject.io/) inspired configuration language.
3612

37-
$ENV:PATH="$ENV:PATH;$($dest)\bin"
13+
Why do we need another provisioning tool? All competitors like Puppet, Ansible, or Salt have limited
14+
support for Windows. And they require the installation of additional dependencies, which is not always convenient.
15+
Tacoscript is the first tool – written in Go – that is shipped as a static binary. A big variety of host OS and platforms,
16+
in a convenient way.
3817

39-
[Environment]::SetEnvironmentVariable(
40-
"Path",
41-
[Environment]::GetEnvironmentVariable(
42-
"Path", [EnvironmentVariableTarget]::Machine
43-
) + ";$($dest)\bin",
44-
[EnvironmentVariableTarget]::Machine
45-
)
46-
& tacoscript --version
47-
48-
## Install as a go binary:
49-
50-
go get github.com/cloudradar-monitoring/tacoscript
18+
Tacoscript is declarative. You define how the system, a file or a software should look like after tacoscript has run.
19+
Before each run, Tacoscript compares the desired outcome with the current state. Only the missing steps are preformed.
5120

5221
## Program execution
5322

54-
Prepare a script in the yaml format (see the _Configuration_ section below), e.g. `tascoscript.yaml`
55-
The tacoscript binary expects a script file to be provided in the input:
23+
Prepare a script in the yaml format , e.g. `tascoscript.yaml`, then execute it.
5624

57-
tacoscript tascoscript.yaml
25+
```shell
26+
tacoscript tascoscript.yaml
27+
```
5828

5929
You can also output the execution details with `-v` flag:
6030

61-
tacoscript -v tascoscript.yaml
31+
```shel
32+
tacoscript -v tascoscript.yaml
33+
```
6234

6335
_You can use any file extension. Using `.taco` for example is fine too._
36+
6437
## Scripting
6538

66-
The script file uses the yaml format. The file consists of a list of tasks that define the states of the host system. The desired state can be an installed program or files with pre-defined content.
39+
The script file uses the yaml format. The file consists of a list of tasks that define the states of the host system.
40+
The desired state can be an installed program or files with pre-defined content.
6741

6842
Here is the minimal possible `tacoscript.yaml` for Unix:
43+
6944
```yaml
7045
# unique id of the task, can be any string
7146
create-file:
@@ -74,58 +49,75 @@ create-file:
7449
#Paramter, command to run
7550
- name: touch /tmp/somefile.txt
7651
```
52+
7753
On Windows, the file can be:
54+
7855
```yaml
7956
create-file:
8057
cmd.run:
8158
- name: New-Item -ItemType file C:\Users\Public\Documents\somefile.txt
8259
- shell: powershell
8360
```
84-
61+
8562
We can read the script as:
86-
> Inside a script, we have a task with the id `create-file`. It consists of the function `cmd.run` which executes `touch /tmp/somefile.txt` or its PowerShell equivalent. The desired result of this script execution would be an empty file at `/tmp/somefile.txt`.
87-
63+
> Inside a script, we have a task with the id `create-file`. It consists of the function `cmd.run` which executes
64+
> `touch /tmp/somefile.txt` or its PowerShell equivalent. The desired result of this script execution would be an empty
65+
> file at `/tmp/somefile.txt`.
8866

8967
### Scripts
90-
The tacoscript.yaml file contains a collection of tasks. Each task defines a desired state of the host system. You can add as many tasks as you want. The tacoscript binary will execute tasks from the file sequentially.
9168

92-
![](docs/script-structure.png)
69+
The tacoscript.yaml file contains a collection of tasks. Each task defines a desired state of the host system.
70+
You can add as many tasks as you want. The tacoscript binary will execute tasks from the file sequentially.
9371

9472
### Tasks
95-
Each script contains a collection of tasks. Each task has a unique id, and a function that identifies the kind of operation the task can do. Tasks get a list of parameters under it as input data. In the example above, the function `cmd.run` receives the parameter `-name` with value `/tmp/somefile.txt` and interprets it as a command which should be executed.
9673

97-
### Task types
74+
Each script contains a collection of tasks. Each task has a unique id, and a function that identifies the kind of
75+
operation the task can do. Tasks get a list of parameters under it as input data. In the example above, the function
76+
`cmd.run` receives the parameter `-name` with value `/tmp/somefile.txt` and interprets it as a command which should be
77+
executed.
78+
79+
### Supported functions aka task types
9880

99-
- [cmd.run](docs/functions/cmd/README.md)
100-
- [file.managed](docs/functions/file/README.md)
101-
- [pkg.installed](docs/functions/pkg/README.md#pkginstalled)
102-
- [pkg.uptodate](docs/functions/pkg/README.md#pkguptodate)
103-
- [pkg.removed](docs/functions/pkg/README.md#pkgremoved)
81+
- `cmd.run` Run shell commands and scripts [Read more](https://tacoscript.io/functions/commands/)
82+
- `file.managed` copy, manipulate, download and manage files [Read More](https://tacoscript.io/functions/file/)
83+
- `pkg.installed` install packages via package manager [Read More](https://tacoscript.io/functions/packages/#pkginstalled)
84+
- `pkg.uptodate` update packages via package manager [Read More](https://tacoscript.io/functions/packages/#pkguptodate)
85+
- `pkg.removed` remove packages via package manager [Read More](https://tacoscript.io/functions/packages/#pkgremoved)
86+
87+
[Read full documentation]
10488

10589
### Templates
106-
See [Templates rendering](docs/general/templates/README.md)
90+
91+
See [Templates rendering](https://tacoscript.io/get-started/template-engine/)
10792

10893
### Known limitations
94+
10995
- to use shell pipes, redirects or glob expands, please specify a `shell` parameter
11096
- `user` parameter will require sudo rights for tacoscript, in Windows this parameter is ignored
11197
- if you use cmd.run tasks in Windows, you'd better specify the shell parameter as `cmd.exe`, otherwise you will get errors like:
11298
`exec: "xxx": executable file not found in %PATH%`
113-
- the order of the scripts is not guaranteed. If you don't use the [require](docs/general/dependencies/require.md) values, the scripts will be executed in any order.
99+
- the order of the scripts is not guaranteed. If you don't use the [require](https://tacoscript.io/get-started/dependencies/)
100+
values, the scripts will be executed in any order.
114101

115102
## Development instructions
116103

117104
### Unit-tests
105+
118106
You can run unit-tests as:
119107

120-
make test
121-
108+
```shell
109+
make test
110+
```
111+
122112
### Static Code Analyses
113+
123114
Execute static code analytic tools
124115

125116
1. Install golangci-lint using instructions from [this site](https://golangci-lint.run/usage/install/)
126117

127118
1. Run the tool using `make sca`
128119

129120
### Compile tacoscript binary for your host OS
121+
130122
1. Compile tacoscript binary for Unix with `make build`.
131123
1. Compile tacoscript binary for Windows with `make build-win`

docs/.markdownlint.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Default state for all rules
2+
default: true
3+
4+
# MD013/line-length - Line length
5+
MD013:
6+
# Number of characters
7+
line_length: 160
8+
# Number of characters for headings
9+
heading_line_length: 80
10+
# Number of characters for code blocks
11+
code_block_line_length: 120
12+
# Include code blocks
13+
code_blocks: true
14+
# Include tables
15+
tables: true
16+
# Include headings
17+
headings: true
18+
# Include headings
19+
headers: true
20+
# Strict length checking
21+
strict: false
22+
# Stern length checking
23+
stern: false
24+
25+
# MD024/no-duplicate-heading
26+
MD024: false

docs/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# About documentation
2+
3+
The documentation system is based on [Hugo](https://gohugo.io/) and the [Geekdocs Theme](https://geekdocs.de/)
4+
5+
## Write
6+
Use markdown with the [shortcodes from Geekdocs](https://geekdocs.de/shortcodes/).
7+
8+
Start a local Hugo server to get a live preview of your changes
9+
```shell
10+
cd docs
11+
hugo server
12+
```
13+
14+
## Check
15+
Before pushing, check your file with [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli)
16+
```shell
17+
npx markdownlint-cli content/
18+
```

docs/archetypes/default.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "{{ replace .Name "-" " " | title }}"
3+
date: {{ .Date }}
4+
draft: true
5+
---
6+

0 commit comments

Comments
 (0)