Add Taskfile to replace Makefile
What
Adds a Taskfile.yaml
file to for use by Taskfile.dev.
Closes #716 (closed)
Why
Our Makefile
has arguably gotten fairly difficult to parse, making it more difficult to debug and contribute. Taskfile has the potential to simplify the setup and address these concerns.
References
- Introduction to Taskfile: a Makefile alternative - DEV Community
- Taskfile or GNU make – which one to use for automation?
Examples
Testing
-
Run
task --list
to view list of available tasks:$ task --list task: Available tasks for this project: * build_chart: Build out the charts/ directory from the Chart.lock file. * build_dir: Ensures that the build directory is present. * build_operator: Build the Operator manifest using `$HELM template`. * build_operator_openshift: Build the Operator manifest for OpenShift using `$HELM template`. * build_test_cr: Build a test GitLab custom resource using `$KUSTOMIZE build`. * bundle: Generate bundle manifests and metadata, and then validate generated files. * bundle-build: Builds the bundle image using `podman build`. * clean: Clean up build and install directories. * delete_operator: Delete controller from the configured cluster using `$HELM uninstall`. * delete_test_cr: Deletes the test Custom Resource using `$KUBECTL delete`. * dependencies: Ensures dependencies installed. * deploy_operator: Deploy controller in the configured cluster using `$HELM upgrade`. * deploy_test_cr: Applies the test Custom Resource using `$KUBECTL apply`. * docker-build: Build the Docker image using `$CONTAINER_CLI build`. * docker-push: Push the Docker image using `$CONTAINER_CLI push`. * fmt: Formats code using `go fmt`. * generate: Generates Kubernetes API extension resources and code with `controller-gen`. * install_dir: Ensures that the install directory is present. * manager: Build the manager binary using `go build`. * manifests: Generates manifests for CRD and webhook using `controller-gen`. * restore_kustomize_files: Restores the state of the config/test directory using `git checkout`. * retrieve-charts: Retrieves GitLab charts at the versions in the CHART_VERSIONS file. * run: Run the manager against the cluster configured in ~/.kube/config. * test: Runs tests. * test_cr_files: List of files used for building the test Custom Resource. * vet: Vets code using `go vet`.
-
Validate that manifests were created and attached as artifacts correctly in the build_manifest job.
-
Run various
task
tasks.
Edited by Mitchell Nielsen