mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
More CI improvements
This commit is contained in:
parent
d83abae451
commit
bcded223a6
41 changed files with 359 additions and 120 deletions
|
@ -97,8 +97,10 @@ function filterChangedCharts(files, parentFolder) {
|
|||
let changedCharts = [];
|
||||
filteredChartFiles.forEach((file) => {
|
||||
const absoluteParentFolder = path.resolve(parentFolder);
|
||||
const absoluteChartFolder = path.resolve(path.dirname(file));
|
||||
const chart = absoluteChartFolder.slice(absoluteParentFolder.length + 1);
|
||||
const absoluteFileDirname = path.resolve(path.dirname(file));
|
||||
const relativeFileDirname = absoluteFileDirname.slice(absoluteParentFolder.length + 1);
|
||||
const chartPathParts = relativeFileDirname.split("/");
|
||||
const chart = `${chartPathParts[0]}/${chartPathParts[1]}`;
|
||||
changedCharts.push(chart);
|
||||
});
|
||||
// Return only unique items
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -71,8 +71,12 @@ function filterChangedCharts(files: string[], parentFolder: string) {
|
|||
let changedCharts: string[] = [];
|
||||
filteredChartFiles.forEach((file) => {
|
||||
const absoluteParentFolder = path.resolve(parentFolder);
|
||||
const absoluteChartFolder = path.resolve(path.dirname(file));
|
||||
const chart = absoluteChartFolder.slice(absoluteParentFolder.length + 1);
|
||||
const absoluteFileDirname = path.resolve(path.dirname(file));
|
||||
const relativeFileDirname = absoluteFileDirname.slice(
|
||||
absoluteParentFolder.length + 1
|
||||
);
|
||||
const chartPathParts = relativeFileDirname.split("/");
|
||||
const chart = `${chartPathParts[0]}/${chartPathParts[1]}`;
|
||||
changedCharts.push(chart);
|
||||
});
|
||||
|
||||
|
|
35
.github/actions/override-chart-deps/action.yaml
vendored
Normal file
35
.github/actions/override-chart-deps/action.yaml
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
name: "Override chart dependencies"
|
||||
description: "Overrides the dependencies for a Helm chart"
|
||||
inputs:
|
||||
chart:
|
||||
required: true
|
||||
description: "Which chart to override the dependencies for"
|
||||
overrides:
|
||||
required: true
|
||||
description: "A JSON encoded list of dependency overrides"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Override dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
overrides=( $(yq --null-input e -o=j -I=0 '${{ inputs.overrides }}[]' ) )
|
||||
chartFile="charts/${{ matrix.chart }}/Chart.yaml"
|
||||
|
||||
if [[ ! -f ${chartFile} ]]; then
|
||||
echo "Could not find ${chartFile}"!
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for override in "${overrides[@]}"; do
|
||||
name=$(echo "$override" | yq e '.name' -)
|
||||
repository=$(echo "$override" | yq e '.repository' -)
|
||||
version=$(echo "$override" | yq e '.version' -)
|
||||
|
||||
yq -i "(.dependencies[] | select(.name == \"$name\").repository) |= \"$repository\"" "${chartFile}"
|
||||
yq -i "(.dependencies[] | select(.name == \"$name\").version) |= \"$version\"" "${chartFile}"
|
||||
done
|
||||
|
||||
echo "Resulting chart:"
|
||||
cat ${chartFile}
|
Loading…
Add table
Add a link
Reference in a new issue