Skip to content

3‐Makefile

Nicholas openSUSE Software Engineer edited this page Oct 8, 2024 · 8 revisions

Basic Commands

make pull-scripts: Pulls in the version of the charts-build-scripts indicated in scripts.


Package Commands

Command Action Options
make prepare - Pulls in your charts from upstream and creates a basic generated-changes/ directory with your dependencies from upstream.
- Default: prepares every Package in your repository
Scope it by providing PACKAGE=<packagePrefix>, where packagePrefix can either be:
1. the exact folder in which a package.yaml resides in packages/
2. a directory that contains multiple directories with package.yaml files; in the latter case, all packages in that prefix will be prepared.
3. If you are working with a local chart with no dependencies, this command does nothing.
make patch Updates your generated-changes/ to reflect the difference between upstream and the current working directory of your branch (note: this command should only be run after make prepare). - Unlike make prepare, PACKAGE=<packagePrefix> must point to an exact folder in which a package.yaml resides in packages/.
- If you are working with a local chart with no dependencies, this command does nothing.
make clean Cleans up all the working directories of charts to get your repository ready for a PR. - Supports PACKAGE=<packagePrefix> as defined above.
- If you are working with a local chart with no dependencies, this command does nothing.
make charts Runs make prepare and then exports your charts to assets/ and charts/ and generates or updates your index.yaml. Supports PACKAGE=<packagePrefix> as defined above.

Please see 1-Developing for more information on how to use these commands in a normal developer workflow.


Assets, Chart, and Index Commands

Command Action Options
make index Reconstructs the index.yaml based on the existing charts. Used by make charts and make validate under the hood.
make remove Removes the asset and chart associated with a provided chart version. Performs the equivalent of an rm -rf on the provided CHART=<chart> and VERSION=<version> entries and runs make index.
make zip Reconstruct archives in the assets directory based on the current contents in charts and update the charts/ contents based on the packaged archive(s). Can be scoped to specific charts via specifying CHART={chart} or CHART={chart}/{version}. Runs make index after reconstruction.

Please see 1-Developing for more information on how to use these commands to modify released charts.


CI Commands

Command Action Options
make validate - Checks whether all generated assets used to serve a Helm repository (charts/, assets/, and index.yaml) are up-to-date.
- If validate.url and validate.branch are provided in the configuration.yaml, it will also ensure that any additional changes introduced only modify chart or package versions specified in the release.yaml;
- otherwise it will output the expected release.yaml based on assets it detected changes in.
make validate-release-charts Used by CI, run the necessary validations for a chart to be released. - --branch="release-v2.y" BRANCH="release-v2.y"
- --gh_token=****** GH_TOKEN=****
- --pr_number=1234 PR_NUMBER=1234
- --skip
make compare-index-files Compare the index.yaml between the git repository and charts.rancher.io after a release is done

Please see 4-Validation for more information on how CI is performed.


Release Commands

Command Action Options
make lifecycle-status Analyzes the state of the current branch, analyzes the state of the official development and production branches for the given branch version, saves everything to logs on logs/ folder. BRANCH_VERSION="<2.x>" CHART="<some_chart>"
make release Execute the release script to release chart from the dev-v2.* to the release-v2.* branch by updating/inserting in the index.yaml and copy/pasting the assets/<target_chart> and charts/<target_chart> folders. - --branch-version="2.*" BRANCH_VERSION="2.*"
- --fork="<fork_URL>" FORK="<fokr_URL>"
- --chart="<chart_name>" CHART="<chart_name>"
- --version="<chart_version>" VERSION="<chart_version>"

Docs and Scripts Commands

Command Action Options
make template Updates the current directory by applying the configuration.yaml on upstream Go templates to pull in the most up-to-date docs, scripts, etc. from rancher/charts-build-scripts.

Advanced Commands

Command Action Options
make list Prints the list of all packages tracked in the current repository and recognized by the scripts. export PORCELAIN=1 allows you to specify that the output of this command should be script-friendly.
make unzip Reconstructs all charts in the charts directory based on the current contents in assets. Can be scoped to specific charts via specifying ASSET=<asset> or ASSET=<asset}>/<chart>-<version>.tgz. Runs make index after reconstruction.
make standardize Takes an arbitrary Helm repository (defined as any repository with a set of Helm charts under charts/) and standardizes it to the expected repository structure of these scripts.
make clean-cache Deletes .charts-build-scripts/.cache. - Only used if export USE_CACHE=1 is set, which indicates that you are using the experimental caching feature introduced in v0.3.0 of the scripts.
- Please see 5-Experimental for more information.