Skip to content

Commit

Permalink
update README for the updated task-generator
Browse files Browse the repository at this point in the history
- reflect the move of the trusted-artifacts
task generator to the task-generator directory
in the README
- add a README into every task-generator subdirectory
  • Loading branch information
tnevrlka committed Sep 20, 2024
1 parent 5b0f4a5 commit 6f92346
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 27 deletions.
23 changes: 2 additions & 21 deletions task-generator/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
# Task generator
Task generator is a tool used for generating various versions of tasks.

## Buildah remote task generation
The Buildah task builds source code into a container image and pushes the image into container registry using the Buildah tool.
While the standard Buildah task runs directly on the cluster, the remote task is run on a remote host.
This must be used in combination with the Multi Arch Controller, which provides the credentials and host name used to perform the build.

The remote versions of the Buildah task are programmatically generated by this script from the buildah task to keep them in sync. The generated remote tasks should not be manually modified.

### Arguments
- `buildah-task` - The location of the buildah task YAML file (required)
- `remote-task` - The location of the buildah-remote task YAML file to overwrite (required)
- `task-version` - The version of the task to overwrite, e.g. `0.2` (required)

Example usage:
```
go run remote/main.go \
--buildah-task ../task/buildah/0.2/buildah.yaml \
--remote-task ../task/buildah-remote/0.2/buildah-remote.yaml \
--task-version 0.2
```
The Task generator is a collection of tools used for generating various versions of tasks.

Each tool has its own subdirectory with a README.
21 changes: 21 additions & 0 deletions task-generator/remote/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Buildah remote task generation
The Buildah task builds source code into a container image and pushes the image into container registry using the Buildah tool.
While the standard Buildah task runs directly on the cluster, the remote task is run on a remote host.
This must be used in combination with the Multi Arch Controller, which provides the credentials and host name used to perform the build.

The remote versions of the Buildah task are programmatically generated by this script from the buildah task to keep them in sync. The generated remote tasks should not be manually modified.

This tool is used by the `hack/generate-buildah-remote.sh` script.

## Arguments
- `buildah-task` - The location of the buildah task YAML file (required)
- `remote-task` - The location of the buildah-remote task YAML file to overwrite (required)
- `task-version` - The version of the task to overwrite, e.g. `0.2` (required)

Example usage:
```
go run remote/main.go \
--buildah-task ../task/buildah/0.2/buildah.yaml \
--remote-task ../task/buildah-remote/0.2/buildah-remote.yaml \
--task-version 0.2
```
25 changes: 19 additions & 6 deletions task-generator/trusted-artifacts/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
# Trusted Artifacts variants generator

## Description and usage
## Description

The code in here will process a set of directions in `recipe.yaml` file and
This tool is used for the generation of trusted artifacts variants of a task.
It will process a set of directions in `recipe.yaml` file and
based on that and a set of builtin conventions generate the Tekton Task
definition in YAML format.

Usage (from this directory):
This tool is used by the `hack/generate-ta-tasks.sh` script.

go run . path/to/recipe.yaml
## Usage

The tool uses only one argument - path to the `recipe.yaml` file.
These `recipe.yaml` files are stored in the task directories ending with `-oci-ta`.

Usage (from the `task-generator/trusted-artifacts` directory)
```
go run . path/to/recipe.yaml
```

The generated Trusted Artifacts Task is provided on the standard output.

## Development
## Testing

To build the tool executable run `go build`, to run the tests run `go test`.
There are various included tests in the `golden` folder.
They use the `base.yaml` file which gets modified based on the `recipe.yaml` and is compared to the `ta.yaml`
```
go test ./...
```

0 comments on commit 6f92346

Please sign in to comment.