22
33set -e
44
5+ PR_NUMBER=" 38"
6+ SOURCE_SCRIPT=" pi/constants.sh"
57PARENT_IMAGE_TYPE=" "
6- PR_NUMBER=" "
7- SOURCE_SCRIPT=" pi/settings.sh"
88EDIT_DOCKERFILE=false
99
1010while getopts t:p:s:d: flag
@@ -22,7 +22,7 @@ source $SOURCE_SCRIPT
2222UPDATED_PARENT_TYPES=()
2323
2424if [ -n $PR_NUMBER ] && [ -z $PARENT_IMAGE_TYPE ]; then
25- UPDATED_FILES=$( gh pr diff $PR_NUMBER --name-only)
25+ UPDATED_FILES=$( gh pr diff $PR_NUMBER --name-only --repo code-kern-ai/refinery-submodule-parent-images )
2626 while IFS= read -r file; do
2727 if [[ $file != requirements/* ]] || [[ $file != * .in ]]; then
2828 continue
@@ -32,14 +32,16 @@ if [ -n $PR_NUMBER ] && [ -z $PARENT_IMAGE_TYPE ]; then
3232 UPDATED_PARENT_TYPES+=($parent_image_type )
3333
3434 done <<< " $UPDATED_FILES"
35- echo " ::notice::Exporting matrix for parent image types: $UPDATED_PARENT_TYPES "
35+ # TODO: UPDATED_PARENT_TYPES are not resolved correctly
36+ echo -e " ::notice::Exporting matrix for parent image types: $UPDATED_PARENT_TYPES "
3637elif [ -n $PARENT_IMAGE_TYPE ]; then
3738 echo " ::notice::Exporting matrix for parent image type: $PARENT_IMAGE_TYPE "
3839 UPDATED_PARENT_TYPES=( $PARENT_IMAGE_TYPE )
3940fi
4041
4142PARENT_IMAGE_TYPES=" "
4243UPDATE_APPS=" "
44+ INCLUDES=" "
4345for parent_image_type in " ${UPDATED_PARENT_TYPES[@]} " ; do
4446 PARENT_IMAGE_TYPES+=" \" $parent_image_type \" ,"
4547 if [ $EDIT_DOCKERFILE = true ]; then
@@ -51,6 +53,8 @@ for parent_image_type in "${UPDATED_PARENT_TYPES[@]}"; do
5153 if [[ ! " $UPDATE_APPS " == * " $app " * ]]; then
5254 UPDATE_APPS+=' "' $app ' ",'
5355 fi
56+ # Includes require keeping track of constants, but is a controlled approach (instead of UPDATE_APPS)
57+ INCLUDES+=' { "parent_image_type": "' ${parent_image_type} ' ", "app": "' ${app} ' " },'
5458 done
5559done
5660
0 commit comments