Skip to content

Commit f048abf

Browse files
committed
CI: Generate release and index only on real changes detected in charts.
Ignore CT "invalid directory" output. Revert to origin/master changes detection. Signed-off-by: Dinko Korunic <[email protected]>
1 parent adde4d6 commit f048abf

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

.circleci/config.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ jobs:
1616
steps:
1717
- checkout
1818
- run:
19-
command: |
20-
git remote add k8s https://github.com/haproxytech/helm-charts
21-
git fetch k8s master
22-
ct lint --config .circleci/ct.yaml
19+
command: ct lint --config .circleci/ct.yaml
2320
install-charts:
2421
machine: true
2522
steps:

.circleci/ct.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
remote: k8s
2-
target-branch: master
31
chart-dirs: .
42
helm-extra-args: --timeout 600s

.circleci/install_charts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ main() {
6262

6363
echo "Testing for chart repo changes"
6464
local changed
65-
changed=$(docker_exec ct list-changed 2>/dev/null | grep -v "is not a valid chart directory")
65+
changed=$(docker_exec ct list-changed | grep -v "is not a valid chart directory")
6666
if [[ -z "${changed}" ]]; then
6767
echo "No chart changes detected"
6868
return

.circleci/release.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,21 @@ main() {
7777
readarray -t changed_charts <<< "$(git diff --find-renames --name-only "${latest_tag_rev}" | grep '\.yaml$' | cut -d '/' -f 1 | sort -u)"
7878

7979
if [[ -n "${changed_charts[*]}" ]]; then
80+
local release_pending=no
8081
for chart in "${changed_charts[@]}"; do
8182
if [[ -f "${chart}/Chart.yaml" ]]; then
83+
release_pending=yes
8284
echo "Packaging chart ${chart}"
8385
package_chart "${chart}"
8486
fi
8587
done
8688

87-
release_charts
88-
update_index
89+
if [[ "${release_pending}" == "yes" ]]; then
90+
release_charts
91+
update_index
92+
else
93+
echo "Nothing to do. No chart changes detected."
94+
fi
8995
else
9096
echo "Nothing to do. No chart changes detected."
9197
fi

0 commit comments

Comments
 (0)