From 4f8aee0ab60405919a46adee4f376632bffbda20 Mon Sep 17 00:00:00 2001 From: Fran Mulero Date: Mon, 18 Jul 2022 14:35:53 +0200 Subject: [PATCH] Update workflows according to the new folder structure (#23) Signed-off-by: Fran Mulero --- .github/workflows/cd-pipeline.yaml | 4 ++-- .github/workflows/ci-pipeline.yaml | 8 ++++---- .github/workflows/ci-scheduled-pipeline.yaml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cd-pipeline.yaml b/.github/workflows/cd-pipeline.yaml index c14cb2b87dd3..77385f20c8a3 100644 --- a/.github/workflows/cd-pipeline.yaml +++ b/.github/workflows/cd-pipeline.yaml @@ -4,7 +4,7 @@ on: # rebuild any PRs and main branch changes branches: - main paths: - - 'containers/**' + - 'bitnami/**' env: CSP_API_URL: https://console.cloud.vmware.com CSP_API_TOKEN: ${{ secrets.CSP_API_TOKEN }} @@ -32,7 +32,7 @@ jobs: files_changed_data=$(curl -s --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X GET -G "$URL") 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 "containers/[^/]*/[^/]*/[^/]*" | sort | uniq || true)) + containers+=($(echo "$files_changed" | xargs dirname | grep -o "bitnami/[^/]*/[^/]*/[^/]*" | sort | uniq || true)) done if [[ "${#containers[@]}" -le "0" ]]; then diff --git a/.github/workflows/ci-pipeline.yaml b/.github/workflows/ci-pipeline.yaml index b139d6878030..ad079eaa6403 100644 --- a/.github/workflows/ci-pipeline.yaml +++ b/.github/workflows/ci-pipeline.yaml @@ -31,15 +31,15 @@ jobs: files_changed_data=$(curl -s --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X GET -G "$URL") files_changed="$(echo $files_changed_data | jq -r '.[] | .filename')" # Adding || true to avoid "Process exited with code 1" errors - containers_dirs_changed="$(echo "$files_changed" | xargs dirname | grep -o "containers/[^/]*" | sort | uniq || true)" - flavors=($(echo "$files_changed" | xargs dirname | grep -o "containers/[^/]*/[^/]*/[^/]*" | sort | uniq || true)) + containers_dirs_changed="$(echo "$files_changed" | xargs dirname | grep -o "bitnami/[^/]*" | sort | uniq || true)" + flavors=($(echo "$files_changed" | xargs dirname | grep -o "bitnami/[^/]*/[^/]*/[^/]*" | sort | uniq || true)) flavors_json=$(printf "%s\n" "${flavors[@]}" | jq -R . | jq -cs .) # Using grep -c as a better alternative to wc -l when dealing with empty strings." - num_containers_changed="$(echo "$containers_dirs_changed" | grep -c "containers" || true)" + num_containers_changed="$(echo "$containers_dirs_changed" | grep -c "bitnami" || true)" if [[ "$num_containers_changed" -eq "1" ]]; then # Changes done in only one container -> OK - container_name=$(echo "$containers_dirs_changed" | sed "s|containers/||g") + container_name=$(echo "$containers_dirs_changed" | sed "s|bitnami/||g") echo "::set-output name=result::ok" echo "::set-output name=container::${container_name}" echo "::set-output name=flavors::${flavors_json}" diff --git a/.github/workflows/ci-scheduled-pipeline.yaml b/.github/workflows/ci-scheduled-pipeline.yaml index ab61a1c6e2a7..65e8f7bdfe5e 100644 --- a/.github/workflows/ci-scheduled-pipeline.yaml +++ b/.github/workflows/ci-scheduled-pipeline.yaml @@ -28,11 +28,11 @@ jobs: run: | container_name="${{ github.event.inputs.container }}" if [ -z "$container_name" ]; then - containers=(containers/*) + containers=(bitnami/*) random_index=$(( $RANDOM % ${#containers[@]} )) - container_name=$(echo "${containers[$random_index]}" | sed "s|containers/||g") + container_name=$(echo "${containers[$random_index]}" | sed "s|bitnami/||g") fi - flavors=(containers/${container_name}/*/*/) + flavors=(bitnami/${container_name}/*/*/) flavors_json="[" for flavor in "${flavors[@]}"; do tag="$(git log --pretty=tformat:"%s" -n 1 --grep=" release$" --author bitnami-bot@vmware.com --author containers@bitnami.com --author containers-bot@bitnami.com -- ${flavor} | awk '{print $1}')"