feat(nextcloud): BREAKING CHANGE - rework fully (#9169)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [x] ⚙️ Feature/App addition
- [x] 🪛 Bugfix
- [x] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [x] ⚖️ My code follows the style guidelines of this project
- [x] 👀 I have performed a self-review of my own code
- [x] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [x] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [x] ⬆️ I increased versions for any altered app according to semantic
versioning

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._

---------

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Signed-off-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Co-authored-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
This commit is contained in:
Stavros Kois
2023-06-17 00:10:56 +03:00
committed by GitHub
parent fde414e95b
commit 8dfaee1c9b
19 changed files with 4818 additions and 1 deletions

View File

@@ -4,6 +4,16 @@ function check_version() {
chart_path=${1:?"No chart path provided to [Version Check]"}
target_branch=${2:?"No target branch provided to [Version Check]"}
chart_dir=$(dirname "$chart_path")
# If only docs changed, skip version check
chart_changes=$(git diff "$target_branch" -- "$chart_dir" :^docs)
if [[ -z "$chart_changes" ]]; then
echo "Looks like only docs changed. Skipping chart version check"
echo -e "\t✅ Chart version: No bump required"
return
fi
new=$(git diff "$target_branch" -- "$chart_path" | sed -nr 's/^\+version: (.*)$/\1/p')
old=$(git diff "$target_branch" -- "$chart_path" | sed -nr 's/^\-version: (.*)$/\1/p')
@@ -63,6 +73,25 @@ function helm_lint(){
}
export -f helm_lint
function helm_template(){
chart_path=${1:?"No chart path provided to [Helm template]"}
# Print only errors and warnings
helm_template_output=$(helm template "$chart_path" 2>&1 >/dev/null)
helm_template_exit_code=$?
while IFS= read -r line; do
echo -e "\t$line"
done <<< "$helm_template_output"
if [ $helm_template_exit_code -ne 0 ]; then
echo -e "\t❌ Helm template: Failed"
curr_result=1
else
echo -e "\t✅ Helm template: Passed"
fi
}
export -f helm_template
function yaml_lint(){
file_path=${1:?"No file path provided to [YAML lint]"}
@@ -97,6 +126,16 @@ function lint_chart(){
echo "👣 Helm Lint - [$chart_path]"
helm_lint "$chart_path"
echo "👣 Helm Template - [$chart_path]"
helm_template "$chart_path"
for values in $chart_path/ci/*values.yaml; do
if [ -f "${values}" ]; then
echo "👣 Helm Template - [$values]"
helm_template "$chart_path" -f "$values"
fi
done
echo "👣 Chart Version - [$chart_path] against [$target_branch]"
check_version "$chart_path" "$target_branch"