From cf104656dca1d29789c1dc9a14ae07c8471e19f3 Mon Sep 17 00:00:00 2001 From: Tomas Nevrlka Date: Tue, 17 Sep 2024 17:32:02 +0200 Subject: [PATCH] update README for the updated task-generator - 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 --- task-generator/README.md | 23 ++------------------ task-generator/remote/README.md | 21 ++++++++++++++++++ task-generator/trusted-artifacts/README.md | 25 ++++++++++++++++------ 3 files changed, 42 insertions(+), 27 deletions(-) create mode 100644 task-generator/remote/README.md diff --git a/task-generator/README.md b/task-generator/README.md index dd0d440291..80df5b5f72 100644 --- a/task-generator/README.md +++ b/task-generator/README.md @@ -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. diff --git a/task-generator/remote/README.md b/task-generator/remote/README.md new file mode 100644 index 0000000000..98a8a32979 --- /dev/null +++ b/task-generator/remote/README.md @@ -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 +``` diff --git a/task-generator/trusted-artifacts/README.md b/task-generator/trusted-artifacts/README.md index bd39ab7c22..10db6beae9 100644 --- a/task-generator/trusted-artifacts/README.md +++ b/task-generator/trusted-artifacts/README.md @@ -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 ./... +``` \ No newline at end of file