mirror of
https://github.com/bitnami/containers.git
synced 2026-03-11 16:07:50 +08:00
[bitnami/*] Change pipelines to get to build branch from readme (#191)
* Change pipelines to try to get modified branch from readme file Signed-off-by: Fran Mulero <fmulero@vmware.com> * Amend jspath to get README changes Signed-off-by: Fran Mulero <fmulero@vmware.com> * Apply suggestions Signed-off-by: Fran Mulero <fmulero@vmware.com>
This commit is contained in:
11
.github/workflows/cd-pipeline.yaml
vendored
11
.github/workflows/cd-pipeline.yaml
vendored
@@ -33,6 +33,17 @@ jobs:
|
||||
files_changed="$(echo $files_changed_data | jq -r '.files[] | .filename')"
|
||||
# Adding || true to avoid "Process exited with code 1" errors
|
||||
containers+=($(echo "$files_changed" | xargs dirname | grep -o "bitnami/[^/]*/[^/]*/[^/]*" | sort | uniq || true))
|
||||
# Changes done in readme files?
|
||||
readme_object="$(echo $files_changed_data | jq -r '[ .files[] | select(.filename | test("bitnami/[^/]+/README.md"))] | first')"
|
||||
if [[ "${readme_object}" != "null" ]]; then
|
||||
# Look for modified branch in Readme content
|
||||
container_name="$(echo ${readme_object} | jq -r '.filename' | sed -nr "s|bitnami/([^/]+)/README.md|\1|p")"
|
||||
branch="$(echo ${readme_object} | jq -r '.patch' | grep -o "([^/]*/[^/]*/Dockerfile)" | sort -u | sed -nr "s|\((.+)/Dockerfile\)|\1|p")"
|
||||
if [[ ! -z "${branch}" ]] && [[ ! -z "${container_name}" ]]; then
|
||||
# readme file changed and the diff contains a change about the latest version generated by EAM
|
||||
containers+=("bitnami/${container_name}/${branch}")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "${#containers[@]}" -le "0" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user