From 65d947d0a2f8c826c1e2cfc241d9839d462cdb20 Mon Sep 17 00:00:00 2001 From: fumingwei Date: Mon, 28 Oct 2024 15:41:26 +0800 Subject: [PATCH] feature: Add containers and helmcharts dir README.md. --- containers/README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++ helmcharts/README.md | 31 +++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 containers/README.md create mode 100644 helmcharts/README.md diff --git a/containers/README.md b/containers/README.md new file mode 100644 index 00000000..379ce0a9 --- /dev/null +++ b/containers/README.md @@ -0,0 +1,50 @@ +# Container Guide +## Description +The directories for containers serve the purpose of obtaining container image tar files. You can get these image tar files through a Dockerfile, by pulling images from a registry, or by downloading tar files from URLs and other sources. There are many directories, with each one corresponding to a specific job. One job can depend on another job. +## Structure +The job structure of Container is as follows: +``` +dirs/ + files/ + templates/ + build.mk + Dockerfile.j2 + entrypoint.sh + manifest.yaml +``` +### files/ +Contains files used with the copy resource. +### templates/ +Contains files used with the template resource. +### build.mk +The `build.mk` file is included by the top-level Makefile in the containers directory for builds. `build.mk` defines `Makefile rules`, which generate both `file targets`(build/{{rule_name}}/build.done) and `phony targets`. This file supports the following variables, allowing you to set these variables to modify the content of the Makefile rules. +``` +rule_name # Makefile rule name. +rule_prerequisites: # Makefile rule prerequisites. +rule_recipes # Makefile rule recipes. +``` +### entrypoint.sh (Optional) +The entrypoint scripts in the container runtime should include a preparation process (such as rendering configuration templates) before executing the container command. +### Dockerfile.j2 (Optional) +A template file for generating a Dockerfile. If container images are not generated using a Dockerfile, this file is not required. +### manifest.yaml (Optional) +A data file used for rendering the Dockerfile. If container images are not generated using a Dockerfile, this file is also not required. +This file configures how to install online RPMs within a Dockerfile. The process involves two steps: downloading and installing the RPMs. +``` +name # The name of the RPM. +version # The version of the RPM. +url # The download URL for the RPM (required if download_command is specified). +download_command # The command to download the RPM. Supported values: dnf and curl. +download_command_options # Options for the download command. +install_command # The command to install the RPM. Supported values: dnf and rpm. +install_command_options # Options for the install command. +``` +## Build +To start the build process, enter the containers directory and run the following command: +``` +make YUM_REPO_FILE=/directory/path/yum.conf IMAGE_TAG=v1.0.0 +``` +- `YUM_REPO_FILE` specifies the path to the YUM repository configuration file. +- `IMAGE_TAG` sets the version tag for the container image. + +Once the build is complete, the image tar files will be available in the `build/images` directory. \ No newline at end of file diff --git a/helmcharts/README.md b/helmcharts/README.md new file mode 100644 index 00000000..aca02326 --- /dev/null +++ b/helmcharts/README.md @@ -0,0 +1,31 @@ +# Container Guide +## Description +The directories for generate helmchart packages manifest files. There are many directories, with each one corresponding to a specific job. One job can depend on another job. +## Structure +The job structure of Container is as follows: +``` +dirs/ + files/ + templates/ + build.mk +``` +### files/ +Contains files used with the copy resource. +### templates/ +Contains files used with the template resource. +### build.mk +The `build.mk` file is included by the top-level Makefile in the `helmcharts` directory for builds. `build.mk` defines `Makefile rules`, which generate both `file targets`(build/{{rule_name}}/build.done) and `phony targets`. This file supports the following variables, allowing you to set these variables to modify the content of the Makefile rules. +``` +rule_name # Makefile rule name. +rule_prerequisites: # Makefile rule prerequisites. +rule_recipes # Makefile rule recipes. +``` +## Build +To start the build process, enter the `helmcharts` directory and run the following command: +``` +make VERSION=v1.0.0 APP_VERSION=v2.0.0 +``` +- `VERSION` sets the `version` field in helmchart package. +- `APP_VERSION` sets the `appVersion` field in helmchart package. + +Once the build is complete, the helmcharts package files will be found in the `build/helmcharts` directory and the manifest files will be found in the `build/manifests` directory. \ No newline at end of file