Skip to content

Commit

Permalink
read environment variables STACKS and STACKS_DIR added under get_stac…
Browse files Browse the repository at this point in the history
…ks.sh and validate_devfile_schemas.sh scripts.

Signed-off-by: Michael Valdron <[email protected]>
  • Loading branch information
michael-valdron committed Jul 31, 2023
1 parent 1b375fb commit 85b03b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions tests/get_stacks.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
#!/bin/bash

stacks_dir=${STACKS_DIR:-stacks}

diff=$(git diff origin/main HEAD --name-only)

changed_stacks=()

if [ "$TEST_DELTA" == "true" ]; then
for file in $diff; do
if [[ $file =~ stacks\/(.*)\/devfile\.yaml ]]; then
if [[ $file =~ ${stacks_dir}\/(.*)\/devfile\.yaml ]]; then
changed_stacks+=(${BASH_REMATCH[1]})
fi
done
else
for file in $(find stacks -name devfile.yaml); do
if [[ $file =~ stacks\/(.*)\/devfile\.yaml ]]; then
for file in $(find ${stacks_dir} -name devfile.yaml); do
if [[ $file =~ ${stacks_dir}\/(.*)\/devfile\.yaml ]]; then
changed_stacks+=(${BASH_REMATCH[1]})
fi
done
Expand Down
2 changes: 1 addition & 1 deletion tests/validate_devfile_schemas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -x

stacksDir=${STACKS_DIR:-"$(pwd)/stacks"}
stacksDir="$(pwd)/${STACKS_DIR:-stacks}"
stackDirs=${STACKS:-"$(bash "$(pwd)/tests/get_stacks.sh")"}

ginkgo run --procs 2 \
Expand Down

0 comments on commit 85b03b6

Please sign in to comment.