Merge pull request #984 from aiyengar2/bump_staging_scripts_version

[Staging] Bump version to v0.0.4
pull/981/head
aiyengar2 2021-02-08 14:10:54 -08:00 committed by GitHub
commit 02fa4822d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 60 additions and 20 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
bin
bin
*.DS_Store

View File

@ -1,8 +1,9 @@
CHARTS_BUILD_SCRIPT_VERSION := fdf0565
pull-scripts:
./scripts/pull-scripts
release:
./scripts/release-assets
TARGETS := prepare patch charts clean sync validate rebase docs
$(TARGETS):

View File

@ -25,7 +25,9 @@ This repository branch contains a `configuration.yaml` file that is used to spec
This branch syncs with the generated assets from the following branches:
- dev-v2.5-source-alt at https://github.com/rancher/charts.git
To release a new version of a chart, please open the relevant PRs to one of these branches. Merging should trigger a sync workflow on pushing to these branches.
To release a new version of a chart, please open the relevant PRs to one of these branches.
Merging should trigger a sync workflow on pushing to these branches.
#### Validate
@ -34,24 +36,31 @@ This branch validates against the generated assets of the following branches to
Before submitting any PRs, a Github Workflow will check to see if your package doesn't break any already released packages in these repository branches.
### Cutting a Release
In the Staging branch, cutting a release involves moving the contents of the `assets/` directory into `released/assets/`, deleting the contents of the `charts/` directory, and updating the `index.yaml` to point to the new location for those assets.
This process is entirely automated via the `make release` command.
Once you successfully run the `make release` command, ensure the following is true:
- The `assets/` and `charts/` directories each only have a single file contained within them: `README.md`
- The `released/assets/` directory has a .tgz file for each releaseCandidateVersion of a Chart that was created during this release.
- The `index.yaml` and `released/assets/index.yaml` both are identical and the `index.yaml`'s diff shows only two types of changes: a timestamp update or a modification of an existing URL from `assets/*` to `released/assets/*`.
No other changes are expected.
Note: these steps should be taken only after following the steps to cut a release to your Live Branch.
### Makefile
#### Package-Level (requires packages/ to exist)
#### Basic Commands
`make prepare`: Pulls in your charts from upstream and creates a basic `generated-changes/` directory with your dependencies from upstream
`make patch`: Updates your `generated-changes/` to reflect the difference between upstream and the current working directory of your branch. Requires prepare
`make charts`: Runs prepare and then exports your charts to `assets/` and `charts/` and generates or updates your `index.yaml`. Can be used for testing; a Rancher Helm Repository that points to a branch that has these directories with the `index.yaml` should be able to find and deploy working copies of your chart.
`make clean`: Cleans up all the working directories of charts to get your repository ready for a PR
#### Branch-Level (requires either packages/ or assets/ + charts/)
`make pull-scripts`: Pulls in the version of the `charts-build-scripts` indicated in scripts
`make validate`: Validates your current repository branch against all the repository branches indicated in your configuration.yaml
`make pull-scripts`: Pulls in the version of the `charts-build-scripts` indicated in scripts.
`make sync`: Syncs the assets in your current repository with the merged contents of all of the repository branches indicated in your configuration.yaml
`make update`: Pulls in the latest docs, scripts, etc. from the charts-build-scripts repository
`make validate`: Validates your current repository branch against all the repository branches indicated in your configuration.yaml
`make docs`: Pulls in the latest docs, scripts, etc. from the charts-build-scripts repository
`make release`: moves the contents of the `assets/` directory into `released/assets/`, deletes the contents of the `charts/` directory, and updates the `index.yaml` to point to the new location for those assets.

5
released/README.md Executable file
View File

@ -0,0 +1,5 @@
## Released Assets
This folder contains Helm chart archives for `releaseCandidateVersions` of Helm charts contained within Packages whose `packageVersion` have already been released at charts.rancher.io.
On cutting a release, a Release Captain should run the corresponding `make release` command on this repository to move already released assets into this directory and update the index.yaml with the new chart locations.

View File

@ -3,7 +3,7 @@ set -e
cd $(dirname $0)
CHARTS_BUILD_SCRIPT_VERSION=v0.0.3
source ./version
echo "Pulling in charts-build-scripts version ${CHARTS_BUILD_SCRIPT_VERSION}"

20
scripts/release-assets Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
set -e
cd $(dirname $0)
cd ..
mkdir -p released
if ! [[ -d assets ]] || ! [[ -d charts ]]; then
echo "No assets to move to released/"
exit 0
fi
cp -R assets/ released/assets
rm released/assets/README.md
rm -R $(ls -1 -d charts/*/) $(ls -1 -d assets/*/)
helm repo index --merge ./released/assets/index.yaml --url released/assets released/assets
cp released/assets/index.yaml index.yaml

4
scripts/version Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
set -e
CHARTS_BUILD_SCRIPT_VERSION=v0.0.4